LanguageModelChatResponse

Represents a language model response.

See also

Properties

Link copied to clipboard
abstract var stream: AsyncIterable<JsAny>

An async iterable that is a stream of text and tool-call parts forming the overall response. A LanguageModelTextPart is part of the assistant's response to be shown to the user. A LanguageModelToolCallPart is a request from the language model to call a tool. The latter will only be returned if tools were passed in the request via LanguageModelChatRequestOptions.tools. The unknown-type is used as a placeholder for future parts, like image data parts.

Link copied to clipboard
abstract var text: AsyncIterable<JsString>

This is equivalent to filtering everything except for text parts from a LanguageModelChatResponse.stream.