Chat
ChatCompletions
List available chat completion models
chat.completions.models(CompletionModelsParams**kwargs) -> CompletionModelsResponse
GET/v5/chat/completions/models
Generate OpenAI chat completion from messages
chat.completions.create(CompletionCreateParams**kwargs) -> CompletionCreateResponse
POST/v5/chat/completions
ModelsExpand Collapse
class ChatCompletion: …
class ChatCompletion: …
choices: List[Choice]
choices: List[Choice]
message: ChoiceMessageA chat completion message generated by the model.
message: ChoiceMessage
A chat completion message generated by the model.
audio: Optional[ChoiceMessageAudio]If the audio output modality is requested, this object contains data
about the audio response from the model. Learn more.
audio: Optional[ChoiceMessageAudio]
If the audio output modality is requested, this object contains data about the audio response from the model. Learn more.
function_call: Optional[ChoiceMessageFunctionCall]Deprecated and replaced by tool_calls.
The name and arguments of a function that should be called, as generated by the model.
function_call: Optional[ChoiceMessageFunctionCall]
Deprecated and replaced by tool_calls.
The name and arguments of a function that should be called, as generated by the model.
class ChatCompletionChunk: …
class ChatCompletionChunk: …
choices: List[Choice]
choices: List[Choice]
delta: ChoiceDeltaA chat completion delta generated by streamed model responses.
delta: ChoiceDelta
A chat completion delta generated by streamed model responses.
One of the following:
class ChatCompletion: …
class ChatCompletion: …
choices: List[Choice]
choices: List[Choice]
message: ChoiceMessageA chat completion message generated by the model.
message: ChoiceMessage
A chat completion message generated by the model.
audio: Optional[ChoiceMessageAudio]If the audio output modality is requested, this object contains data
about the audio response from the model. Learn more.
audio: Optional[ChoiceMessageAudio]
If the audio output modality is requested, this object contains data about the audio response from the model. Learn more.
function_call: Optional[ChoiceMessageFunctionCall]Deprecated and replaced by tool_calls.
The name and arguments of a function that should be called, as generated by the model.
function_call: Optional[ChoiceMessageFunctionCall]
Deprecated and replaced by tool_calls.
The name and arguments of a function that should be called, as generated by the model.
class ChatCompletionChunk: …
class ChatCompletionChunk: …
choices: List[Choice]
choices: List[Choice]
delta: ChoiceDeltaA chat completion delta generated by streamed model responses.
delta: ChoiceDelta
A chat completion delta generated by streamed model responses.