Chat
Create Chat Completion
chat.create_completion(ChatCreateCompletionParams**kwargs) -> object
POST/chat/completions
ModelsExpand Collapse
class ChatCompletionContentPartAudio: …Learn about audio inputs.
class ChatCompletionContentPartAudio: …
Learn about audio inputs.
input_audio: InputAudio
input_audio: InputAudio
data: str
format: Literal["wav", "mp3"]
format: Literal["wav", "mp3"]
One of the following:
"wav"
"mp3"
type: Literal["input_audio"]
class ChatCompletionContentPartImage: …Learn about image inputs.
class ChatCompletionContentPartImage: …
Learn about image inputs.
image_url: ImageURL
image_url: ImageURL
url: str
detail: Optional[Literal["auto", "low", "high"]]
detail: Optional[Literal["auto", "low", "high"]]
One of the following:
"auto"
"low"
"high"
type: Literal["image_url"]
class ChatCompletionContentPartRefusal: …
class ChatCompletionContentPartRefusal: …
refusal: str
type: Literal["refusal"]
class ChatCompletionContentPartText: …Learn about text inputs.
class ChatCompletionContentPartText: …
Learn about text inputs.
text: str
type: Literal["text"]
class ChatCompletionMessageFunctionToolCall: …A call to a function tool created by the model.
class ChatCompletionMessageFunctionToolCall: …
A call to a function tool created by the model.
id: str
function: FunctionThe function that the model called.
function: Function
The function that the model called.
arguments: str
name: str
type: Literal["function"]
class File: …Learn about file inputs for text generation.
class File: …
Learn about file inputs for text generation.
file: File
file: File
file_data: Optional[str]
file_id: Optional[str]
filename: Optional[str]
type: Literal["file"]
class Message: …
class Message: …
author: Author
author: Author
role: Literal["user", "assistant", "system", 2 more]The role of a message author (mirrors chat::Role).
role: Literal["user", "assistant", "system", 2 more]
The role of a message author (mirrors chat::Role).
One of the following:
"user"
"assistant"
"system"
"developer"
"tool"
name: Optional[str]
channel: Optional[str]
content: Optional[List[object]]
content_type: Optional[str]
recipient: Optional[str]