OpenAI API

ChatCompletionNamedToolChoice

object

Specifies a tool the model should use. Use to force the model to call a specific function.

typestringrequired

The type of the tool. Currently, only function is supported.

Allowed values:function

functionobjectrequired
Show Child Parameters
Example

Assistant message

object

Messages sent by the model in response to user messages.

contentOne Of

The contents of the assistant message. Required unless tool_calls or function_call is specified.

Text contentstring

The contents of the assistant message.

refusalstring

The refusal message by the assistant.

rolestringrequired

The role of the messages author, in this case assistant.

Allowed values:assistant

namestring

An optional name for the participant. Provides the model information to differentiate between participants of the same role.

audioobject

Data about a previous audio response from the model.
Learn more.

Show Child Parameters
tool_callsarray[object]

The tool calls generated by the model, such as function calls.

Show Child Parameters
function_callobjectDEPRECATED

Deprecated and replaced by tool_calls. The name and arguments of a function that should be called, as generated by the model.

Show Child Parameters
Example

ChatCompletionRequestAssistantMessageContentPart

One Of
typestringrequired

The type of the content part.

Allowed values:text

textstringrequired

The text content.

Example

Developer message

object

Developer-provided instructions that the model should follow, regardless of
messages sent by the user. With o1 models and newer, developer messages
replace the previous system messages.

contentOne Of
required

The contents of the developer message.

Text contentstring

The contents of the developer message.

rolestringrequired

The role of the messages author, in this case developer.

Allowed values:developer

namestring

An optional name for the participant. Provides the model information to differentiate between participants of the same role.

Example

Function message

object
rolestringrequired

The role of the messages author, in this case function.

Allowed values:function

contentstringrequired

The contents of the function message.

namestringrequired

The name of the function to call.

Example