Theia API Documentation v1.76.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

      • Optionalproxy: string
      • OptionalreasoningSupport: ReasoningSupport
      • OptionalmaxInputTokens: number
      • OptionalserverTools: ServerToolDescriptor[]
      • serverSideCompactionSupport: boolean = false

        whether this model supports server-side compaction (only available via the Response API)

      • serverSideCompactionEnabledByDefault: boolean = false

        resolved default enablement of server-side compaction (global preference folded with the per-provider override)

      • OptionalserverSideCompactionTokenThresholdByDefault: number
      • Optionalheaders: Record<string, string>
      • Optionalreleased: number

      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

    headers?: Record<string, string>
    id: string

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

    maxInputTokens?: number
    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
    reasoningSupport?: ReasoningSupport
    released?: number

    Release date (ms since epoch) as reported by the provider, where it reports one. Lets the model lists offer the newest models first instead of ordering them by name.

    responseApiUtils: OpenAiResponseApiUtils
    runnerOptions: RunnerOptions = ...

    The options for the OpenAI runner.

    serverSideCompactionEnabledByDefault: boolean = false

    resolved default enablement of server-side compaction (global preference folded with the per-provider override)

    serverSideCompactionSupport: boolean = false

    whether this model supports server-side compaction (only available via the Response API)

    serverSideCompactionTokenThresholdByDefault?: number
    serverTools?: ServerToolDescriptor[]

    Server tools this model offers, declared code-level by the provider package. Note: If you provide these, you must also provide vendor because server tools are vendor-specific.

    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.

    useResponseApi: boolean = false

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

    vendor: "openai" = 'openai'

    Methods

    • Augments the Response API settings with the server-side compaction directive when compaction is enabled for the given request. When disabled, the settings are returned unchanged so the default path is byte-for-byte identical.

      Parameters

      Returns Record<string, unknown>