diff --git a/router/src/lib.rs b/router/src/lib.rs index 7370477b..eac41276 100644 --- a/router/src/lib.rs +++ b/router/src/lib.rs @@ -21,8 +21,8 @@ use serde::{Deserialize, Serialize}; use tokenizers::Encoding; use tracing::warn; use utoipa::ToSchema; -use validation::Validation; use uuid::Uuid; +use validation::Validation; #[allow(clippy::large_enum_variant)] #[derive(Clone)] @@ -997,11 +997,11 @@ impl ChatRequest { )) } - fn next_int_id(&self) -> Result>{ + fn next_int_id(&self) -> Result> { let mut id: usize = 0; - for message in &self.messages{ - if let MessageBody::Tool{tool_calls} = &message.body { - for tool_call in tool_calls{ + for message in &self.messages { + if let MessageBody::Tool { tool_calls } = &message.body { + for tool_call in tool_calls { let new_id: usize = tool_call.id.parse()?; id = std::cmp::max(id, new_id + 1); } @@ -1013,8 +1013,8 @@ impl ChatRequest { /// Try to have linearly increasing id /// or resort to using Uuid if the initial /// scheme is not understood - fn next_tool_call_id(&self) -> String{ - self.next_int_id().unwrap_or_else(|_|{ + fn next_tool_call_id(&self) -> String { + self.next_int_id().unwrap_or_else(|_| { let uid = Uuid::new_v4().to_string(); uid.to_string() })