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

    See also VS Code ILanguageModelChatMetadata

    Implements

    Index

    Constructors

    • Parameters

      • id: string

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

      • model: string

        the model id as it is used by the OpenAI API

      • status: LanguageModelStatus
      • enableStreaming: boolean

        whether the streaming API shall be used

      • apiKey: () => undefined | string

        a function that returns the API key to use for this model, called on each request

      • apiVersion: () => undefined | string

        a function that returns the OpenAPI version to use for this model, called on each request

      • supportsStructuredOutput: boolean
      • url: undefined | string

        the OpenAI API compatible endpoint where the model is hosted. If not provided the default OpenAI endpoint will be used.

      • deployment: undefined | string
      • openAiModelUtils: OpenAiModelUtils
      • responseApiUtils: OpenAiResponseApiUtils
      • developerMessageSettings: DeveloperMessageSettings = 'developer'

        how to handle system messages

      • maxRetries: number = 3

        the maximum number of retry attempts when a request fails

      • useResponseApi: boolean = false

        whether to use the newer OpenAI Response API instead of the Chat Completion API

      • OptionaltokenUsageService: TokenUsageService
      • Optionalproxy: string

      Returns OpenAiModel

    Properties

    apiKey: () => undefined | string

    a function that returns the API key to use for this model, called on each request

    apiVersion: () => undefined | string

    a function that returns the OpenAPI version to use for this model, called on each request

    deployment: undefined | string
    developerMessageSettings: DeveloperMessageSettings = 'developer'

    how to handle system messages

    enableStreaming: boolean

    whether the streaming API shall be used

    id: string

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

    maxRetries: number = 3

    the maximum number of retry attempts when a request fails

    model: string

    the model id as it is used by the OpenAI API

    openAiModelUtils: OpenAiModelUtils
    proxy?: string
    responseApiUtils: OpenAiResponseApiUtils
    runnerOptions: RunnerOptions = ...

    The options for the OpenAI runner.

    supportsStructuredOutput: boolean
    tokenUsageService?: TokenUsageService
    url: undefined | string

    the OpenAI API compatible endpoint where the model is hosted. If not provided the default OpenAI endpoint will be used.

    useResponseApi: boolean = false

    whether to use the newer OpenAI Response API instead of the Chat Completion API

    Methods

    • Gets the settings for a request, optionally including reasoning parameters.

      Parameters

      • request: LanguageModelRequest

        The language model request

      • forResponseApi: boolean = false

        Whether the settings are for the Response API (true) or Chat Completions API (false). GPT-5 reasoning parameters are only supported with the Response API.

      Returns Record<string, unknown>

    • Checks if the model is a GPT-5 series model (gpt-5, gpt-5.1, gpt-5.2). These models use a different reasoning parameter format: reasoning: { effort: 'none' | 'low' | 'medium' | 'high' }

      Returns boolean

    • Checks if the model is an o-series model that supports reasoning. Models like o1, o1-mini, o1-preview, o3, o3-mini, o4-mini support the reasoning_effort parameter. These models use: reasoning_effort: 'low' | 'medium' | 'high'

      Returns boolean