cargo fmt
This commit is contained in:
@@ -197,10 +197,7 @@ impl ClaudeApi {
|
|||||||
|
|
||||||
// Get tools from the executor if still alive
|
// Get tools from the executor if still alive
|
||||||
let executor = self.tool_executor.upgrade();
|
let executor = self.tool_executor.upgrade();
|
||||||
let tools = executor
|
let tools = executor.as_ref().map(|te| te.tools()).unwrap_or_default();
|
||||||
.as_ref()
|
|
||||||
.map(|te| te.tools())
|
|
||||||
.unwrap_or_default();
|
|
||||||
let mut messages = vec![MessageContent::user(prompt)];
|
let mut messages = vec![MessageContent::user(prompt)];
|
||||||
|
|
||||||
info!("Claude request: {}", prompt);
|
info!("Claude request: {}", prompt);
|
||||||
|
|||||||
@@ -22,7 +22,10 @@ use http::{Method, Request, Response, StatusCode};
|
|||||||
use http_body::Body;
|
use http_body::Body;
|
||||||
use http_body_util::BodyExt;
|
use http_body_util::BodyExt;
|
||||||
use prometheus_http_client::{AlertStatus, ExtractLabels};
|
use prometheus_http_client::{AlertStatus, ExtractLabels};
|
||||||
use std::{fmt::Write, net::SocketAddr, path::PathBuf, sync::Arc, sync::Mutex, sync::OnceLock, sync::Weak, time::Duration};
|
use std::{
|
||||||
|
fmt::Write, net::SocketAddr, path::PathBuf, sync::Arc, sync::Mutex, sync::OnceLock, sync::Weak,
|
||||||
|
time::Duration,
|
||||||
|
};
|
||||||
use tokio::{
|
use tokio::{
|
||||||
join,
|
join,
|
||||||
sync::mpsc::{UnboundedReceiver, UnboundedSender, unbounded_channel},
|
sync::mpsc::{UnboundedReceiver, UnboundedSender, unbounded_channel},
|
||||||
|
|||||||
@@ -479,10 +479,9 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_log_filter_combined() {
|
fn test_log_filter_combined() {
|
||||||
// msg_contains AND module_equals must both match
|
// msg_contains AND module_equals must both match
|
||||||
let filter: LogFilter = serde_json::from_str(
|
let filter: LogFilter =
|
||||||
r#"{"msg_contains": "error", "module_equals": "test::module"}"#,
|
serde_json::from_str(r#"{"msg_contains": "error", "module_equals": "test::module"}"#)
|
||||||
)
|
.unwrap();
|
||||||
.unwrap();
|
|
||||||
assert!(filter.matches(&make_log_msg("an error occurred")));
|
assert!(filter.matches(&make_log_msg("an error occurred")));
|
||||||
|
|
||||||
// Wrong module
|
// Wrong module
|
||||||
|
|||||||
Reference in New Issue
Block a user