LanguageModelChat

Represents a language model for making chat requests.

See also

Properties

Link copied to clipboard
abstract val family: String

Opaque family-name of the language model. Values might be gpt-3.5-turbo, gpt4, phi2, or llama but they are defined by extensions contributing languages and subject to change.

Link copied to clipboard
abstract val id: String

Opaque identifier of the language model.

Link copied to clipboard
abstract val maxInputTokens: Int

The maximum number of tokens that can be sent to the model in a single request.

Link copied to clipboard
abstract val name: String

Human-readable name of the language model.

Link copied to clipboard
abstract val vendor: String

A well-known identifier of the vendor of the language model. An example is copilot, but values are defined by extensions contributing chat models and need to be looked up with them.

Link copied to clipboard
abstract val version: String

Opaque version string of the model. This is defined by the extension contributing the language model and subject to change.

Functions

Link copied to clipboard
abstract fun countTokens(text: JsAny, token: CancellationToken = definedExternally): PromiseLike<JsInt>

Count the number of tokens in a message using the model specific tokenizer-logic.

Link copied to clipboard
abstract fun sendRequest(    messages: ReadonlyArray<LanguageModelChatMessage>,     options: LanguageModelChatRequestOptions = definedExternally,     token: CancellationToken = definedExternally): PromiseLike<LanguageModelChatResponse>

Make a chat request using a language model.