Theia API Documentation v1.77.0
    Preparing search index...

    A chat agent is a specialized agent with a common interface for its invocation.

    Hierarchy (View Summary)

    Index
    additionalToolRequests: ToolRequest<ToolInvocationContext>[]
    agentSpecificVariables: AgentSpecificVariables[]

    The list of local variable identifiers that can be made available to this agent during execution, these variables are context specific and do not exist for other agents.

    This array is primarily used for documentation purposes in the AI Configuration View to show which variables can be made available to the agent. Referenced variables are NOT automatically handed over by the framework, this must be explicitly done in the agent implementation or in prompts.

    chatToolRequestService: ChatToolRequestService
    contentMatchers: ResponseContentMatcher[]
    defaultContentFactory: DefaultResponseContentFactory
    defaultLanguageModelPurpose: string = 'chat'
    description: string = ...

    A markdown description of its functionality and its privacy-relevant requirements, including function call handlers that access some data autonomously.

    fileReadTracker: FileReadTracker | undefined
    functions: string[]

    The list of global function identifiers that are always available to this agent during execution, regardless of whether they are referenced in prompts.

    This array is primarily used for documentation purposes in the AI Configuration View to show which functions are guaranteed to be available to the agent. Referenced functions are NOT automatically handed over by the framework, this must be explicitly done in the agent implementation.

    iconClass: string = 'codicon codicon-comment'
    id: string = UniversalChatAgentId

    Used to identify an agent, e.g. when it is requesting language models, etc.

    This parameter might be removed in favor of name. Therefore, it is recommended to set id to the same value as name for now.

    languageModelRegistry: LanguageModelRegistry
    languageModelRequirements: LanguageModelRequirement[] = ...

    Required language models. This includes the purpose and optional language model selector arguments. See #47.

    languageModelService: LanguageModelService
    locations: ChatAgentLocation[]
    logger: ILogger
    name: string = UniversalChatAgentId

    Human-readable name shown to users to identify the agent. Must be unique. Use short names without "Agent" or "Chat" (see tags for adding further properties).

    prompts: {
        defaultVariant: BasePromptFragment;
        id: string;
        variants: BasePromptFragment[];
    }[] = ...

    The prompts introduced and used by this agent.

    promptService: PromptService
    serverToolCallResponseContentFactory: ServerToolCallResponseContentFactory
    systemPromptId: string = 'universal-system'
    tags: string[]

    A list of tags to filter agents and to display capabilities in the UI

    tokenUsageService: TokenUsageService | undefined
    toolCallResponseContentFactory: ToolCallChatResponseContentFactory
    variables: string[]

    The list of global variable identifiers that are always available to this agent during execution, regardless of whether they are referenced in prompts.

    This array is primarily used for documentation purposes in the AI Configuration View to show which variables are guaranteed to be available to the agent. Referenced variables are NOT automatically handed over by the framework, this must be explicitly done in the agent implementation.

    • Creates a ToolCallChatResponseContent instance from the provided tool call data.

      This method is called when parsing stream response tokens that contain tool call data. Subclasses can override this method to customize the creation of tool call response contents.

      Parameters

      Returns ChatResponseContent

      A ChatResponseContent representing the tool call.

    • Returns { [key: string]: unknown } | undefined

      the settings, such as temperature, to be used in all language model requests. Returns undefined by default.

    • Extracts session settings from the request, separating Theia-specific common settings from arbitrary provider settings.

      Parameters

      Returns {
          commonSettings: CommonChatSessionSettings | undefined;
          providerSettings: Record<string, unknown>;
      }

      An object with commonSettings (Theia-specific) and providerSettings (passed to LLM)

    • Invoked after the response by the LLM completed successfully.

      The default implementation sets the state of the response to complete. Subclasses may override this method to perform additional actions or keep the response open for processing further requests.

      Parameters

      Returns Promise<void>

    • Resolves a concrete language model (or alias) id to a ready model, or undefined if none is ready.

      Parameters

      • modelId: string

      Returns Promise<LanguageModel | undefined>