From 700d8a3245f1133c37e035039e511a1e5dce1a5d Mon Sep 17 00:00:00 2001 From: sigoden Date: Mon, 3 Feb 2025 22:35:01 +0800 Subject: feat: strip reasoning contents (#1141) --- src/config/input.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/config/input.rs') diff --git a/src/config/input.rs b/src/config/input.rs index e468f19..482b1d5 100644 --- a/src/config/input.rs +++ b/src/config/input.rs @@ -244,6 +244,13 @@ impl Input { init_client(&self.config, Some(self.role().model().clone())) } + pub async fn fetch_chat_text(&self) -> Result { + let client = self.create_client()?; + let text = client.chat_completions(self.clone()).await?.text; + let text = strip_think_tag(&text).to_string(); + Ok(text) + } + pub fn prepare_completion_data( &self, model: &Model, -- cgit v1.2.3