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

OpenAIChatCompletionsResult

継承元

計算プロパティ

プロパティ説明
choicesCollectionOpen AI レスポンスからOpenAIChoice のコレクションを返します。
choiceOpenAIChoicechoices コレクションの中から最初のOpenAIChoice を返します。
usageObjectトークン使用状況の情報をかえします(OpenAIResult から継承されます)。

usage

usage プロパティはチャット補完のトークン使用状況情報を格納したオブジェクトを返します。

フィールド説明
prompt_tokensIntegerプロンプト内のトークンの数。
completion_tokensInteger補完内でのトークンの数。
total_tokensInteger使用されたトークンの総数(プロンプト + 補完)。
prompt_tokens_detailsObjectプロンプトトークンの詳細な内訳(オプション)。
completion_tokens_detailsObject補完トークンの詳細な内訳(オプション)。

prompt_tokens_details

フィールド説明
cached_tokensIntegerキャッシュから提供されたトークンの数。
audio_tokensIntegerオーディオトークンの数(該当する場合)。

completion_tokens_details

フィールド説明
reasoning_tokensIntegerリーズニング(例: o1 モデルなど)に使用されたトークン。
audio_tokensIntegerオーディオトークンの数(該当する場合)。
accepted_prediction_tokensInteger受け入れられた予測からのトークン。
rejected_prediction_tokensInteger却下された予測からのトークン。

レスポンスの例:

{
"prompt_tokens": 19,
"completion_tokens": 10,
"total_tokens": 29,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
}

注意: *_tokens_details オブジェクトは全てのレスポンスにいるとは限らず、また全てのプロバイダーから返されるとも限りません。

参照