OpenAI API

Text content part

object

Learn about text inputs.

typestringrequired

The type of the content part.

Allowed values:text

textstringrequired

The text content.

Example

System message

object

Developer-provided instructions that the model should follow, regardless of
messages sent by the user. With o1 models and newer, use developer messages
for this purpose instead.

contentOne Of
required

The contents of the system message.

Text contentstring

The contents of the system message.

rolestringrequired

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

Allowed values:system

namestring

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

Example

ChatCompletionRequestSystemMessageContentPart

One Of
typestringrequired

The type of the content part.

Allowed values:text

textstringrequired

The text content.

Example

Tool message

object
rolestringrequired

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

Allowed values:tool

contentOne Of
required

The contents of the tool message.

Text contentstring

The contents of the tool message.

tool_call_idstringrequired

Tool call that this message is responding to.

Example

ChatCompletionRequestToolMessageContentPart

One Of
typestringrequired

The type of the content part.

Allowed values:text

textstringrequired

The text content.

Example