fix(chat): skip serializing tool_calls if null, to avoid 422 error
This commit is contained in:
@@ -9,6 +9,7 @@ use crate::v1::{common, constants, tool};
|
||||
pub struct ChatMessage {
|
||||
pub role: ChatMessageRole,
|
||||
pub content: String,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub tool_calls: Option<Vec<tool::ToolCall>>,
|
||||
}
|
||||
impl ChatMessage {
|
||||
|
||||
Reference in New Issue
Block a user