LanguageModelChatProvider

A LanguageModelChatProvider implements access to language models, which users can then use through the chat view, or through extension API by acquiring a LanguageModelChat. An example of this would be an OpenAI provider that provides models like gpt-5, o3, etc.

Online Documentation

Properties

Link copied to clipboard

An optional event fired when the available set of language models changes.

Functions

Link copied to clipboard

Get the list of available language models provided by this provider

Link copied to clipboard

Returns the response for a chat request, passing the results to the progress callback. The {@linkcode LanguageModelChatProvider} must emit the response parts to the progress callback as they are received from the language model.

Link copied to clipboard
abstract fun provideTokenCount(model: T, text: JsAny, token: CancellationToken): PromiseLike<JsInt>

Returns the number of tokens for a given text using the model-specific tokenizer logic