diff --git a/openai/src/chatgpt/model/resp.rs b/openai/src/chatgpt/model/resp.rs index 4c2ca0241..b310ffbd1 100644 --- a/openai/src/chatgpt/model/resp.rs +++ b/openai/src/chatgpt/model/resp.rs @@ -211,6 +211,10 @@ impl ConvoResponse { .collect() } + pub fn raw_messages(&self) -> &[String] { + self.message.content.parts.as_slice() + } + pub fn message_id(&self) -> &str { &self.message.id } diff --git a/openai/src/serve/proxy/toapi/mod.rs b/openai/src/serve/proxy/toapi/mod.rs index 7192e0d22..80ed93d3e 100644 --- a/openai/src/serve/proxy/toapi/mod.rs +++ b/openai/src/serve/proxy/toapi/mod.rs @@ -311,7 +311,7 @@ async fn event_convert_handler( set_role: &mut bool, convo: ConvoResponse, ) -> anyhow::Result { - let messages = convo.messages(); + let messages = convo.raw_messages(); let message = messages .first() .ok_or(anyhow::anyhow!("message is empty"))?;