cargo clippy and fmt

This commit is contained in:
Adil Hafeez 2025-09-17 11:15:42 -07:00
parent 0c6600ac47
commit 9758354e33
No known key found for this signature in database
GPG key ID: 9B18EF7691369645
2 changed files with 13 additions and 10 deletions

View file

@ -78,13 +78,13 @@ impl PipelineProcessor {
debug!("Received response from filter agent {}", agent_name); debug!("Received response from filter agent {}", agent_name);
// Parse the response content as new message history // Parse the response content as new message history
chat_completions_history = serde_json::from_str(&response_content).map_err(|err| { chat_completions_history =
warn!( serde_json::from_str(&response_content).inspect_err(|err| {
"Failed to parse response from agent {}, response: {}", warn!(
agent_name, response_content "Failed to parse response from agent {}, err: {}, response: {}",
); agent_name, err, response_content
err )
})?; })?;
} }
Ok(chat_completions_history) Ok(chat_completions_history)

View file

@ -79,9 +79,12 @@ impl RouterService {
trace_parent: Option<String>, trace_parent: Option<String>,
usage_preferences: Option<Vec<ModelUsagePreference>>, usage_preferences: Option<Vec<ModelUsagePreference>>,
) -> Result<Option<(String, String)>> { ) -> Result<Option<(String, String)>> {
if usage_preferences.is_none() if messages.is_empty() {
|| usage_preferences.as_ref().unwrap().len() < 2 return Ok(None);
|| messages.is_empty() }
if (usage_preferences.is_none() || usage_preferences.as_ref().unwrap().len() < 2)
&& !self.llm_usage_defined
{ {
return Ok(None); return Ok(None);
} }