OpenAI API

ChatCompletionRequestToolMessageContentPart

One Of
typestringrequired

The type of the content part.

Allowed values:text

textstringrequired

The text content.

Example

User message

object

Messages sent by an end user, containing prompts or additional context
information.

contentOne Of
required

The contents of the user message.

Text contentstring

The text contents of the message.

rolestringrequired

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

Allowed values:user

namestring

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

Example

ChatCompletionRequestUserMessageContentPart

One Of
typestringrequired

The type of the content part.

Allowed values:text

textstringrequired

The text content.

Example

ChatCompletionResponseMessage

object

A chat completion message generated by the model.

contentstringrequired

The contents of the message.

refusalstringrequired

The refusal message generated by the model.

tool_callsarray[object]

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

Show Child Parameters
rolestringrequired

The role of the author of this message.

Allowed values:assistant

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
audioobject

If the audio output modality is requested, this object contains data
about the audio response from the model. Learn more.

Show Child Parameters
Example

ChatCompletionRole

string

The role of the author of a message

Allowed values:developersystemuserassistanttoolfunction