From e4f3794cdc2f93fbf4438ff5c3b23889512ff41f Mon Sep 17 00:00:00 2001 From: Afanti <127061691+threewebcode@users.noreply.github.com> Date: Fri, 14 Feb 2025 07:10:50 +0800 Subject: [PATCH] fix: enhance tracing messages (#287) * fix: enhance tracing messages * chore: fix typos --- rig-core/examples/agent_with_grok.rs | 2 +- rig-core/examples/multi_turn_agent.rs | 4 ++-- rig-core/src/embeddings/embed.rs | 2 +- rig-core/src/providers/moonshot.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rig-core/examples/agent_with_grok.rs b/rig-core/examples/agent_with_grok.rs index 6ddfa08f..4d28cc05 100644 --- a/rig-core/examples/agent_with_grok.rs +++ b/rig-core/examples/agent_with_grok.rs @@ -10,7 +10,7 @@ use rig::{ use serde::{Deserialize, Serialize}; use serde_json::json; -/// Runs 4 agents based on grok (dervived from the other examples) +/// Runs 4 agents based on grok (derived from the other examples) #[tokio::main] async fn main() -> Result<(), anyhow::Error> { println!("Running basic agent with grok"); diff --git a/rig-core/examples/multi_turn_agent.rs b/rig-core/examples/multi_turn_agent.rs index 7cfd226c..14ee446e 100644 --- a/rig-core/examples/multi_turn_agent.rs +++ b/rig-core/examples/multi_turn_agent.rs @@ -195,11 +195,11 @@ impl Tool for Subtract { "properties": { "x": { "type": "number", - "description": "The number to substract from" + "description": "The number to subtract from" }, "y": { "type": "number", - "description": "The number to substract" + "description": "The number to subtract" } } } diff --git a/rig-core/src/embeddings/embed.rs b/rig-core/src/embeddings/embed.rs index e8acc613..384c72ac 100644 --- a/rig-core/src/embeddings/embed.rs +++ b/rig-core/src/embeddings/embed.rs @@ -9,7 +9,7 @@ //! //! Finally, the module implements [Embed] for many common primitive types. -/// Error type used for when the [Embed::embed] method fo the [Embed] trait fails. +/// Error type used for when the [Embed::embed] method of the [Embed] trait fails. /// Used by default implementations of [Embed] for common types. #[derive(Debug, thiserror::Error)] #[error("{0}")] diff --git a/rig-core/src/providers/moonshot.rs b/rig-core/src/providers/moonshot.rs index 9b828bff..b2888ef4 100644 --- a/rig-core/src/providers/moonshot.rs +++ b/rig-core/src/providers/moonshot.rs @@ -197,12 +197,12 @@ impl completion::CompletionModel for CompletionModel { if response.status().is_success() { let t = response.text().await?; - tracing::debug!(target: "rig", "Azure completion error: {}", t); + tracing::debug!(target: "rig", "MoonShot completion error: {}", t); match serde_json::from_str::>(&t)? { ApiResponse::Ok(response) => { tracing::info!(target: "rig", - "Azure completion token usage: {:?}", + "MoonShot completion token usage: {:?}", response.usage.clone().map(|usage| format!("{usage}")).unwrap_or("N/A".to_string()) ); response.try_into()