data
ChatMessage
Bases: NullableBaseModel
Model representing a chat message, contained within a request or response model under messages or choices field.
Attributes:
| Name | Type | Description |
|---|---|---|
role |
Literal['system', 'user', 'assistant', 'tool', 'function', 'developer']
|
The role of the message sender (user, assistant, etc.). |
refusal |
str | None
|
The refusal message, if applicable. |
tool_calls |
list[ToolCall] | None
|
A list of tool calls made during the message. |
content |
str | list[dict[str, Any]] | None
|
The content of the message. |
audio |
Audio | None
|
The audio data associated with the message. |
annotations |
list[Annotation] | None
|
Any annotations associated with the message. |
name |
str | None
|
The name of the message sender. |
thinking |
str | None
|
The thinking process associated with the message. |
split_thinking_from_response
split_thinking_from_response() -> Self
Splits the thinking process from the response content.
Returns:
| Type | Description |
|---|---|
Self
|
A tuple containing the thinking process and the response content. |