From 6239deccccb7eb5f60d599c98394d0ce1d21b499 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Mon, 10 Nov 2025 17:59:01 +0000 Subject: [PATCH] V10 --- codex-rs/api-client/src/chat.rs | 36 --------------------------------- 1 file changed, 36 deletions(-) diff --git a/codex-rs/api-client/src/chat.rs b/codex-rs/api-client/src/chat.rs index cb07fc72ba..b70bda04f8 100644 --- a/codex-rs/api-client/src/chat.rs +++ b/codex-rs/api-client/src/chat.rs @@ -2,16 +2,9 @@ use std::time::Duration; use async_trait::async_trait; use codex_otel::otel_event_manager::OtelEventManager; -use codex_protocol::models::ContentItem; -use codex_protocol::models::FunctionCallOutputContentItem; -use codex_protocol::models::ReasoningItemContent; -use codex_protocol::models::ResponseItem; use codex_protocol::protocol::SessionSource; use futures::TryStreamExt; -use serde_json::Value; -use serde_json::json; use tokio::sync::mpsc; -use tracing::trace; use crate::aggregate::ChatAggregationMode; use crate::api::ApiClient; @@ -149,32 +142,3 @@ impl ChatCompletionsApiClient { Ok(()) } } - -fn create_tools_json_for_chat_completions_api( - tools: &[serde_json::Value], -) -> Result> { - let tools_json = tools - .iter() - .filter_map(|tool| { - if tool.get("type") != Some(&serde_json::Value::String("function".to_string())) { - return None; - } - - let function_value = if let Some(function) = tool.get("function") { - function.clone() - } else if let Some(map) = tool.as_object() { - let mut function = map.clone(); - function.remove("type"); - Value::Object(function) - } else { - return None; - }; - - Some(json!({ - "type": "function", - "function": function_value, - })) - }) - .collect::>(); - Ok(tools_json) -}