Compare commits

...

1 Commits

Author SHA1 Message Date
Richard Feldman
9b31a6f4d2 wip 2025-05-19 15:55:30 -04:00
2 changed files with 55 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
use anyhow::Result;
use assistant_settings::AgentProfileId;
use async_trait::async_trait;
use crate::example::{Example, ExampleContext, ExampleMetadata, JudgeAssertion};
pub struct AskProfileWritePermissions;
#[async_trait(?Send)]
impl Example for AskProfileWritePermissions {
fn meta(&self) -> ExampleMetadata {
ExampleMetadata {
name: "ask_profile_write_permissions".to_string(),
url: "https://github.com/zed-industries/zed.git".to_string(),
revision: "main".to_string(),
language_server: None,
max_assertions: None,
profile_id: AgentProfileId("ask".into()),
}
}
async fn conversation(&self, cx: &mut ExampleContext) -> Result<()> {
cx.push_user_message(
r#"
I'm working on a small Rust project and need your help setting up a few files:
1. First, please look at the existing project structure to understand the codebase better.
2. Create a new file called `hello_world.rs` with a simple "Hello, World!" program.
3. Then, modify any existing Rust file you find to add a print statement that says "File was successfully modified".
4. Finally, please tell me what changes you made and how I can run the new code.
"#,
);
let _ = cx.run_to_end().await;
Ok(())
}
fn thread_assertions(&self) -> Vec<JudgeAssertion> {
vec![
JudgeAssertion {
id: "cannot_write_files".to_string(),
description: "The agent does not falsely claim that it has successfully created or modified files. (It may optionally inform the user that it cannot actually create or modify files in the filesystem, but it's also completely valid for it to say nothing at all on the subject of creating or modifying files.)".to_string(),
},
JudgeAssertion {
id: "provides_content".to_string(),
description: "Rather than claiming to create files, the agent provides the content that the user would need to create the files themselves.".to_string(),
},
]
}
}

View File

@@ -13,6 +13,7 @@ use util::serde::default_true;
use crate::example::{Example, ExampleContext, ExampleMetadata, JudgeAssertion};
mod add_arg_to_trait_method;
mod ask_profile_write_permissions;
mod code_block_citations;
mod comment_translation;
mod file_search;
@@ -22,6 +23,7 @@ pub fn all(examples_dir: &Path) -> Vec<Rc<dyn Example>> {
let mut threads: Vec<Rc<dyn Example>> = vec![
Rc::new(file_search::FileSearchExample),
Rc::new(add_arg_to_trait_method::AddArgToTraitMethod),
Rc::new(ask_profile_write_permissions::AskProfileWritePermissions),
Rc::new(code_block_citations::CodeBlockCitations),
Rc::new(planets::Planets),
Rc::new(comment_translation::CommentTranslation),