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);
// Parse the response content as new message history
chat_completions_history = serde_json::from_str(&response_content).map_err(|err| {
warn!(
"Failed to parse response from agent {}, response: {}",
agent_name, response_content
);
err
})?;
chat_completions_history =
serde_json::from_str(&response_content).inspect_err(|err| {
warn!(
"Failed to parse response from agent {}, err: {}, response: {}",
agent_name, err, response_content
)
})?;
}
Ok(chat_completions_history)

View file

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