diff --git a/llgtrt/src/chat.rs b/llgtrt/src/chat.rs index e9e5b58..41b0fcb 100644 --- a/llgtrt/src/chat.rs +++ b/llgtrt/src/chat.rs @@ -162,7 +162,22 @@ impl ChatCompletionMessageParams { name: name.clone(), } } - x => x.clone(), + ChatCompletionMessageParams::Assistant { + content, + name, + tool_calls, + } => ChatCompletionMessageParams::Assistant { + content: content.as_ref().map(|x| x.flatten()), + name: name.clone(), + tool_calls: tool_calls.clone(), + }, + ChatCompletionMessageParams::Tool { + content, + tool_call_id, + } => ChatCompletionMessageParams::Tool { + content: content.as_ref().map(|x| x.flatten()), + tool_call_id: tool_call_id.clone(), + }, } } } diff --git a/llgtrt/src/routes/openai.rs b/llgtrt/src/routes/openai.rs index 922e07c..e2c60aa 100644 --- a/llgtrt/src/routes/openai.rs +++ b/llgtrt/src/routes/openai.rs @@ -252,12 +252,12 @@ pub enum ChatCompletionMessageParams { name: Option, }, Assistant { - content: Option, + content: Option, name: Option, tool_calls: Option>, }, Tool { - content: Option, + content: Option, tool_call_id: String, }, }