pub struct InferenceCreateChatCompletionBodyMessagesItem {
pub content: Option<String>,
pub reasoning_content: Option<String>,
pub refusal: Option<String>,
pub role: InferenceCreateChatCompletionBodyMessagesItemRole,
pub tool_call_id: Option<String>,
pub tool_calls: Vec<InferenceCreateChatCompletionBodyMessagesItemToolCallsItem>,
}Expand description
A message in the chat conversation.
JSON schema
{
"description": "A message in the chat conversation.",
"type": "object",
"required": [
"role"
],
"properties": {
"content": {
"description": "The contents of the message.",
"examples": [
"Hello, how are you?"
],
"type": [
"string",
"null"
]
},
"reasoning_content": {
"description": "The reasoning content generated by the model (assistant messages only).",
"type": [
"string",
"null"
]
},
"refusal": {
"description": "The refusal message generated by the model (assistant messages only).",
"type": [
"string",
"null"
]
},
"role": {
"description": "The role of the message author.",
"examples": [
"user"
],
"type": "string",
"enum": [
"system",
"developer",
"user",
"assistant",
"tool"
]
},
"tool_call_id": {
"description": "Tool call that this message is responding to (tool messages only).",
"examples": [
"call_abc123"
],
"type": "string"
},
"tool_calls": {
"description": "The tool calls generated by the model (assistant messages only).",
"type": "array",
"items": {
"type": "object",
"required": [
"function",
"id",
"type"
],
"properties": {
"function": {
"type": "object",
"required": [
"arguments",
"name"
],
"properties": {
"arguments": {
"description": "The arguments to call the function with, as generated by the model in JSON format.",
"examples": [
"{\"location\": \"Boston\"}"
],
"type": "string"
},
"name": {
"description": "The name of the function to call.",
"examples": [
"get_weather"
],
"type": "string"
}
}
},
"id": {
"description": "The ID of the tool call.",
"examples": [
"call_abc123"
],
"type": "string"
},
"type": {
"description": "The type of the tool. Currently, only function is supported.",
"examples": [
"function"
],
"type": "string",
"enum": [
"function"
]
}
}
}
}
}
}Fields§
§content: Option<String>The contents of the message.
reasoning_content: Option<String>The reasoning content generated by the model (assistant messages only).
refusal: Option<String>The refusal message generated by the model (assistant messages only).
role: InferenceCreateChatCompletionBodyMessagesItemRoleThe role of the message author.
tool_call_id: Option<String>Tool call that this message is responding to (tool messages only).
tool_calls: Vec<InferenceCreateChatCompletionBodyMessagesItemToolCallsItem>The tool calls generated by the model (assistant messages only).
Trait Implementations§
Source§impl Clone for InferenceCreateChatCompletionBodyMessagesItem
impl Clone for InferenceCreateChatCompletionBodyMessagesItem
Source§fn clone(&self) -> InferenceCreateChatCompletionBodyMessagesItem
fn clone(&self) -> InferenceCreateChatCompletionBodyMessagesItem
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de> Deserialize<'de> for InferenceCreateChatCompletionBodyMessagesItem
impl<'de> Deserialize<'de> for InferenceCreateChatCompletionBodyMessagesItem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&InferenceCreateChatCompletionBodyMessagesItem> for InferenceCreateChatCompletionBodyMessagesItem
impl From<&InferenceCreateChatCompletionBodyMessagesItem> for InferenceCreateChatCompletionBodyMessagesItem
Source§fn from(value: &InferenceCreateChatCompletionBodyMessagesItem) -> Self
fn from(value: &InferenceCreateChatCompletionBodyMessagesItem) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for InferenceCreateChatCompletionBodyMessagesItem
impl RefUnwindSafe for InferenceCreateChatCompletionBodyMessagesItem
impl Send for InferenceCreateChatCompletionBodyMessagesItem
impl Sync for InferenceCreateChatCompletionBodyMessagesItem
impl Unpin for InferenceCreateChatCompletionBodyMessagesItem
impl UnsafeUnpin for InferenceCreateChatCompletionBodyMessagesItem
impl UnwindSafe for InferenceCreateChatCompletionBodyMessagesItem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more