mirror of
https://github.com/katanemo/plano.git
synced 2026-06-17 15:25:17 +02:00
cargo clippy and fmt
This commit is contained in:
parent
0c6600ac47
commit
9758354e33
2 changed files with 13 additions and 10 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue