Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/openai/lib/ChatCompletionStream.ts>ChatCompletionSnapshot.Choice

Deno build of the official Typescript library for the OpenAI API.
Extremely Popular
Go to Latest
namespace ChatCompletionSnapshot.Choice
import { ChatCompletionSnapshot } from "https://deno.land/x/openai@v4.21.0/lib/ChatCompletionStream.ts";
const { Choice } = ChatCompletionSnapshot;
interface ChatCompletionSnapshot.Choice
import { type ChatCompletionSnapshot } from "https://deno.land/x/openai@v4.21.0/lib/ChatCompletionStream.ts";
const { Choice } = ChatCompletionSnapshot;

Properties

A chat completion delta generated by streamed model responses.

finish_reason: ChatCompletion.Choice["finish_reason"] | null

The reason the model stopped generating tokens. This will be stop if the model hit a natural stop point or a provided stop sequence, length if the maximum number of tokens specified in the request was reached, content_filter if content was omitted due to a flag from our content filters, or function_call if the model called a function.

index: number

The index of the choice in the list of choices.