Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions rust/crates/tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ reqwest = { version = "0.12", default-features = false, features = ["blocking",
serde = { version = "1", features = ["derive"] }
serde_json.workspace = true
tokio = { version = "1", features = ["rt-multi-thread"] }
aspect-core = "0.1"
aspect-macros = "0.1"
aspect-std = "0.1"
log = "0.4"

[lints]
workspace = true
4 changes: 4 additions & 0 deletions rust/crates/tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ use std::path::{Path, PathBuf};
use std::process::Command;
use std::time::{Duration, Instant};

use aspect_macros::aspect;
use aspect_std::LoggingAspect;

use api::{
max_tokens_for_model, resolve_model_alias, ContentBlockDelta, InputContentBlock, InputMessage,
MessageRequest, MessageResponse, OutputContentBlock, ProviderClient,
Expand Down Expand Up @@ -536,6 +539,7 @@ pub fn mvp_tool_specs() -> Vec<ToolSpec> {
]
}

#[aspect(LoggingAspect::new().log_args().log_result())]
pub fn execute_tool(name: &str, input: &Value) -> Result<String, String> {
match name {
"bash" => from_value::<BashCommandInput>(input).and_then(run_bash),
Expand Down