pub struct ChatCompletionMessage {
pub role: Role,
pub audio: Option<ChatCompletionAudio>,
pub content: Option<String>,
pub reasoning_content: Option<String>,
pub reasoning: Option<String>,
pub tool_calls: Option<Vec<ChatCompletionMessageToolCall>>,
pub refusal: Option<String>,
pub annotations: Option<Vec<Annotation>>,
}Fields§
§role: RoleThe role of the author of this message. This shall always
be Role::Assistant
audio: Option<ChatCompletionAudio>If the audio output modality is requested, this object contains data about the audio response from the model. Learn more from OpenAI.
content: Option<String>The contents of the message.
reasoning_content: Option<String>For thinking models: the reasoning contents of the assistant message, before the final answer.
reasoning: Option<String>vLLM: the reasoning contents of the assistant message, under the key vLLM actually emits.
vLLM accepts reasoning_content on the way in but serializes the
chain of thought as reasoning on the way out — in its ChatMessage
the two names are aliases of one field, and reasoning is the
serialization name. Current vLLM does not emit
reasoning_content in responses, so for a vLLM backend the field
above stays None and this one carries the chain of thought. Map it
back onto reasoning_content when feeding it into a follow-up
request.
tool_calls: Option<Vec<ChatCompletionMessageToolCall>>The tool calls generated by the model, such as function calls. Tool calls deserialization is not supported yet.
refusal: Option<String>The refusal message generated by the model.
annotations: Option<Vec<Annotation>>Annotations for the message, when applicable, such as URL citations when the model uses a web search tool.