Skip to content

Commit 3f84620

Browse files
committed
Add logging
1 parent 04d3ac7 commit 3f84620

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

mistralrs-core/src/engine/search_request.rs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,14 +356,31 @@ async fn do_custom_tool(
356356
}
357357

358358
let result = if let Some(cb) = this.tool_callbacks.get(&tool_calls.function.name) {
359-
cb(&tool_calls.function).unwrap_or_else(|e| format!("ERROR: {e}"))
359+
tracing::info!("Called tool `{}`.", tool_calls.function.name);
360+
cb(&tool_calls.function).unwrap_or_else(|e| {
361+
tracing::error!(
362+
"Error when calling tool `{}`: {e}",
363+
tool_calls.function.name
364+
);
365+
format!("ERROR: {e}")
366+
})
360367
} else if let Some(callback_with_tool) = this
361368
.tool_callbacks_with_tools
362369
.get(&tool_calls.function.name)
363370
{
364-
(callback_with_tool.callback)(&tool_calls.function)
365-
.unwrap_or_else(|e| format!("ERROR: {e}"))
371+
tracing::info!("Called tool `{}`.", tool_calls.function.name);
372+
(callback_with_tool.callback)(&tool_calls.function).unwrap_or_else(|e| {
373+
tracing::error!(
374+
"Error when calling tool `{}`: {e}",
375+
tool_calls.function.name
376+
);
377+
format!("ERROR: {e}")
378+
})
366379
} else {
380+
tracing::error!(
381+
"Attempted to call tool `{}`, but it doesn't exist.",
382+
tool_calls.function.name
383+
);
367384
format!("ERROR: no tool callback for {}", tool_calls.function.name)
368385
};
369386

mistralrs/examples/mcp_client/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ async fn main() -> Result<()> {
119119

120120
// Build the model with MCP client configuration
121121
// The MCP client will automatically connect to configured servers and discover available tools
122-
let model = TextModelBuilder::new("../hf_models/qwen3_4b".to_string())
122+
let model = TextModelBuilder::new("Qwen/Qwen3-4B".to_string())
123123
.with_isq(IsqType::Q8_0) // Use 8-bit quantization for efficiency
124124
.with_logging()
125125
.with_paged_attn(|| {

0 commit comments

Comments
 (0)