メインコンテンツまでスキップ
バージョン: 21 R3 BETA

OpenAIChatCompletionsStreamResult

継承元

プロパティ

プロパティ説明
dataObjectサーバーから送信されたストリームデータを格納しています。

計算プロパティ

プロパティ説明
choiceOpenAIChoicedelta メッセージ付きの選択データを返します。
choicesCollectiondelta メッセージ付きのOpenAIChoice データのコレクションを返します。

Overridden properties

プロパティ説明
successBooleanストリーミングデータがオブジェクトとして正常にデコードされた場合には True を返します。
terminatedBooleanHTTP リクエストが終了したかどうかを示すブール値。 言い換えると onTerminate が呼ばれたかどうかを表します。
usageObjectReturns token usage information from the stream data (only available in the final chunk when stream_options.include_usage is set to True).

usage

The usage property returns an object containing token usage information, available only in the final streaming chunk when enabled via stream_options.include_usage: True in the request parameters.

The structure is the same as OpenAIChatCompletionsResult:

フィールド説明
prompt_tokensIntegerNumber of tokens in the prompt.
completion_tokensIntegerNumber of tokens in the completion.
total_tokensIntegerTotal tokens used (prompt + completion).
prompt_tokens_detailsObjectBreakdown of prompt tokens (optional).
completion_tokens_detailsObjectBreakdown of completion tokens (optional).

Note: To receive usage information in streaming responses, you must set stream_options: {include_usage: True} in your request parameters. See OpenAIChatCompletionsParameters for details.