fix(chat): skip serializing tool_calls if null, to avoid 422 error

This commit is contained in:
seurimas
2024-05-08 14:08:29 +00:00
committed by Ivan Gabriele
parent 7a5e0679c1
commit da5fe54115

View File

@@ -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 {