@ainulabs/ainu - v0.0.5
    Preparing search index...

    Class Agent

    Index

    Constructors

    Properties

    clients: Record<string, MCP> = {}

    MCP Clients the agent is connected to

    name: string

    The name of the agent.

    provider: Provider<any, any, any>

    The provider

    settings: AgentSettings = ...

    The system prompt for the agent. Uses the default settings returned by defaultSettings if not provided.

    toolMap: Record<string, Tool>

    The tools available to the agent.

    Methods

    • Removes a tool from the agent

      Parameters

      • name: string

      Returns void

    • Returns a tool by name

      Parameters

      • name: string

      Returns Promise<Tool>

    • Call the Provider's language model to generate a text response from the supplied prompt or messages.

      Parameters

      Returns Promise<Result<undefined | GenerateTextResult<ToolSet, unknown>>>

    • Adds or replaces a tool in the agent's tools.

      Parameters

      Returns void

    • This will compile all agent tool sources into a single map. It will use all class tools, all mcp client tools, and any extra tools passed in as an argument to the function.

      Parameters

      • extraTools: Tool[] = []

      Returns Promise<Record<string, Tool>>