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

    See also VS Code ILanguageModelChatMetadata

    Implements

    Index

    Constructors

    Properties

    DEFAULT_REQUEST_SETTINGS: Partial<Omit<ChatRequest, "stream" | "model">> = ...
    host: () => undefined | string
    id: string

    the unique id for this language model. It will be used to identify the model in the UI.

    model: string

    the unique model name as used in the Ollama environment.

    providerId: "ollama" = 'ollama'
    tokenUsageService?: TokenUsageService
    vendor: string = 'Ollama'

    Methods

    • Maps budget tokens to Ollama effort levels.

      Parameters

      • budgetTokens: undefined | number

        Optional budget tokens from thinking mode settings.

      Returns "low" | "medium" | "high"

      The effort level ('low', 'medium', or 'high').

    • Check if the Ollama server supports thinking.

      Use the Ollama 'show' request to get information about the model, so we can check the capabilities for the 'thinking' capability.

      Parameters

      • ollama: Ollama

        The Ollama client instance.

      • model: string

        The name of the Ollama model.

      Returns Promise<boolean>

      A boolean indicating whether the Ollama model supports thinking.

    • Retrieves the settings for the chat request, merging the request-specific settings with the default settings.

      Parameters

      Returns Partial<ChatRequest>

      A partial ChatRequest object containing the merged settings.

    • Determines the value for Ollama's 'think' parameter based on the request's thinking mode settings.

      Note: Most models support boolean values for 'think', but some models (e.g., GPT-OSS) require effort levels ('low', 'medium', 'high') and ignore boolean values.

      Parameters

      • thinkingMode: undefined | ThinkingModeSettings

        The thinking mode settings from the request.

      • model: string

        The model name to check for special handling.

      Returns boolean | "low" | "medium" | "high"

      The appropriate 'think' parameter value for the model.

    • Checks if the model requires effort levels instead of boolean for the 'think' parameter.

      Parameters

      • model: string

        The model name to check.

      Returns boolean

      true if the model requires effort levels.