Skip to content

Commit

Permalink
fix: enhance tracing messages (#287)
Browse files Browse the repository at this point in the history
* fix: enhance tracing messages

* chore: fix typos
  • Loading branch information
threewebcode authored Feb 13, 2025
1 parent 7c13e97 commit e4f3794
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rig-core/examples/agent_with_grok.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions rig-core/examples/multi_turn_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion rig-core/src/embeddings/embed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}")]
Expand Down
4 changes: 2 additions & 2 deletions rig-core/src/providers/moonshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<ApiResponse<openai::CompletionResponse>>(&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()
Expand Down

0 comments on commit e4f3794

Please sign in to comment.