diff --git a/router/src/lib.rs b/router/src/lib.rs index 965f45d4a..40253d5df 100644 --- a/router/src/lib.rs +++ b/router/src/lib.rs @@ -610,40 +610,6 @@ impl From for TextMessage { } } -#[derive(Clone, Debug, Deserialize, ToSchema)] -struct FunctionSpec { - name: String, - description: String, - parameters: serde_json::Value, -} - -impl FunctionSpec { - fn to_schema(&self) -> serde_json::Value { - json!({ - "type": "object", - "properties": { - "id": { - "type": "string", - }, - "type": { - "const": "function", - }, - "function": { - "type": "object", - "properties": { - "name": { - "const": self.name, - }, - "arguments": self.parameters, - }, - "required": ["name", "arguments"], - }, - }, - "required": ["id", "type", "function"], - }) - } -} - #[derive(Clone, Debug, Deserialize, ToSchema)] struct ChatCompletionRequest { model: String, diff --git a/router/src/server.rs b/router/src/server.rs index 3bbd7c043..758348fdf 100644 --- a/router/src/server.rs +++ b/router/src/server.rs @@ -408,7 +408,7 @@ async fn chat_completions_v1( } let mut choice_content = vec![]; - for (i, gen) in generations.iter().enumerate() { + for (_, gen) in generations.iter().enumerate() { let (tool_calls, output) = if using_tools { let gen_text_value: Value = serde_json::from_str(&gen).map_err(|e| { InferError::ToolError(format!( diff --git a/router/src/validation.rs b/router/src/validation.rs index 1487d0898..76ec6d7ca 100644 --- a/router/src/validation.rs +++ b/router/src/validation.rs @@ -2,9 +2,7 @@ use crate::adapter::Adapter; use crate::batch::ValidGenerateRequest; use crate::config::Config; use crate::validation::ValidationError::{BestOfSampling, BestOfSeed, EmptyInput}; -use crate::{ - GenerateParameters, GenerateRequest, HubPreprocessorConfig, Idefics2Preprocessor, Tool, -}; +use crate::{GenerateParameters, GenerateRequest, HubPreprocessorConfig, Idefics2Preprocessor}; use base64::{engine::general_purpose::STANDARD, Engine}; use image::{ImageFormat, ImageReader}; use lorax_client::{NextTokenChooserParameters, StoppingCriteriaParameters, TokenizedInputs};