Skip to content
Merged
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
128 changes: 125 additions & 3 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl Evaluation for ComputerControllerScript {
}

// Parse the arguments as JSON
if let Ok(args) = serde_json::from_value::<Value>(serde_json::Value::Object(tool_call.arguments.clone().unwrap_or_default())) {
if let Ok(args) = serde_json::from_value::<Value>(tool_call.arguments.clone()) {
// Check all required parameters match exactly
args.get("script").and_then(Value::as_str).is_some_and(|s| s.contains("beep"))
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl Evaluation for ComputerControllerWebScrape {
}

// Parse the arguments as JSON
if let Ok(args) = serde_json::from_value::<Value>(serde_json::Value::Object(tool_call.arguments.clone().unwrap_or_default())) {
if let Ok(args) = serde_json::from_value::<Value>(tool_call.arguments.clone()) {
// Check all required parameters match exactly
args.get("url").and_then(Value::as_str).map(|s| s.trim_end_matches('/')) == Some("https://news.ycombinator.com")
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl Evaluation for DeveloperCreateFile {
}

// Parse the arguments as JSON
if let Ok(args) = serde_json::from_value::<Value>(serde_json::Value::Object(tool_call.arguments.clone().unwrap_or_default())) {
if let Ok(args) = serde_json::from_value::<Value>(tool_call.arguments.clone()) {
// Check all required parameters match exactly
args.get("command").and_then(Value::as_str) == Some("write") &&
args.get("path").and_then(Value::as_str).is_some_and(|s| s.contains("test.txt")) &&
Expand Down Expand Up @@ -82,7 +82,7 @@ impl Evaluation for DeveloperCreateFile {
}

// Parse the arguments as JSON
if let Ok(args) = serde_json::from_value::<Value>(serde_json::Value::Object(tool_call.arguments.clone().unwrap_or_default())) {
if let Ok(args) = serde_json::from_value::<Value>(tool_call.arguments.clone()) {
// Check all required parameters match exactly
args.get("command").and_then(Value::as_str) == Some("view") &&
args.get("path").and_then(Value::as_str).is_some_and(|s| s.contains("test.txt"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl Evaluation for DeveloperListFiles {
// Check if the tool call is for shell with ls or rg --files
if let Ok(tool_call) = tool_req.tool_call.as_ref() {
// Parse arguments as JSON Value first
if let Ok(args) = serde_json::from_value::<Value>(serde_json::Value::Object(tool_call.arguments.clone().unwrap_or_default())) {
if let Ok(args) = serde_json::from_value::<Value>(tool_call.arguments.clone()) {
tool_call.name == "developer__shell" &&
args.get("command")
.and_then(Value::as_str).is_some_and(|cmd| {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ impl Evaluation for SimpleRepoCloneTest {
}

if let Ok(args) =
serde_json::from_value::<Value>(serde_json::Value::Object(
tool_call.arguments.clone().unwrap_or_default(),
))
serde_json::from_value::<Value>(tool_call.arguments.clone())
{
let command = args.get("command").and_then(Value::as_str);
command.is_some_and(|cmd| {
Expand Down Expand Up @@ -80,9 +78,7 @@ impl Evaluation for SimpleRepoCloneTest {
}

if let Ok(args) =
serde_json::from_value::<Value>(serde_json::Value::Object(
tool_call.arguments.clone().unwrap_or_default(),
))
serde_json::from_value::<Value>(tool_call.arguments.clone())
{
let command = args.get("command").and_then(Value::as_str);
command.is_some_and(|cmd| {
Expand Down Expand Up @@ -114,9 +110,7 @@ impl Evaluation for SimpleRepoCloneTest {
}

if let Ok(args) =
serde_json::from_value::<Value>(serde_json::Value::Object(
tool_call.arguments.clone().unwrap_or_default(),
))
serde_json::from_value::<Value>(tool_call.arguments.clone())
{
let command = args.get("command").and_then(Value::as_str);
let file_text = args.get("file_text").and_then(Value::as_str);
Expand Down Expand Up @@ -158,9 +152,7 @@ impl Evaluation for SimpleRepoCloneTest {
}

if let Ok(args) =
serde_json::from_value::<Value>(serde_json::Value::Object(
tool_call.arguments.clone().unwrap_or_default(),
))
serde_json::from_value::<Value>(tool_call.arguments.clone())
{
let command = args.get("command").and_then(Value::as_str);
command.is_some_and(|cmd| {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ impl Evaluation for DeveloperImage {
if let MessageContent::ToolRequest(tool_req) = content {
if let Ok(tool_call) = tool_req.tool_call.as_ref() {
if let Ok(args) =
serde_json::from_value::<Value>(serde_json::Value::Object(
tool_call.arguments.clone().unwrap_or_default(),
))
serde_json::from_value::<Value>(tool_call.arguments.clone())
{
if tool_call.name == "developer__screen_capture"
&& (args.get("display").and_then(Value::as_i64) == Some(0))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl Evaluation for MemoryRememberMemory {
}

// Parse the arguments as JSON
if let Ok(args) = serde_json::from_value::<Value>(serde_json::Value::Object(tool_call.arguments.clone().unwrap_or_default())) {
if let Ok(args) = serde_json::from_value::<Value>(tool_call.arguments.clone()) {
// Check all required parameters match exactly
args.get("category").and_then(Value::as_str).is_some_and(|s| s.contains("fact")) &&
args.get("data").and_then(Value::as_str) == Some("The capital of France is Paris.") &&
Expand Down
4 changes: 1 addition & 3 deletions crates/goose-bench/src/eval_suites/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ fn count_tool_calls(messages: &[Message]) -> (i64, HashMap<String, i64>) {
total_count += 1;

// Count by name
*counts_by_name
.entry(tool_call.name.to_string())
.or_insert(0) += 1;
*counts_by_name.entry(tool_call.name.clone()).or_insert(0) += 1;
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions crates/goose-bench/src/eval_suites/vibes/flappy_bird.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ impl Evaluation for FlappyBird {

// Parse the arguments as JSON
if let Ok(args) =
serde_json::from_value::<Value>(serde_json::Value::Object(
tool_call.arguments.clone().unwrap_or_default(),
))
serde_json::from_value::<Value>(tool_call.arguments.clone())
{
// Only check command is write and correct filename
args.get("command").and_then(Value::as_str) == Some("write")
Expand Down
4 changes: 1 addition & 3 deletions crates/goose-bench/src/eval_suites/vibes/goose_wiki.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ impl Evaluation for GooseWiki {

// Parse the arguments as JSON
if let Ok(args) =
serde_json::from_value::<Value>(serde_json::Value::Object(
tool_call.arguments.clone().unwrap_or_default(),
))
serde_json::from_value::<Value>(tool_call.arguments.clone())
{
// Only check command is write and correct filename
args.get("command").and_then(Value::as_str) == Some("write")
Expand Down
Loading
Loading