Skip to content

Commit

Permalink
[cli] On interrupt repair messages (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsibbison-square authored Nov 28, 2024
1 parent 2654c49 commit 545d6ab
Show file tree
Hide file tree
Showing 5 changed files with 352 additions and 10 deletions.
4 changes: 1 addition & 3 deletions crates/goose-cli/src/agents/mock_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ pub struct MockAgent;

#[async_trait]
impl Agent for MockAgent {
fn add_system(&mut self, _system: Box<dyn System>) {

}
fn add_system(&mut self, _system: Box<dyn System>) {}

async fn reply(&self, _messages: &[Message]) -> Result<BoxStream<'_, Result<Message>>> {
Ok(Box::pin(futures::stream::empty()))
Expand Down
3 changes: 3 additions & 0 deletions crates/goose-cli/src/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ pub trait Prompt {
println!("Goose is running! Enter your instructions, or try asking what goose can do.");
println!("\n");
}
// Used for testing. Allows us to downcast to any type.
#[cfg(test)]
fn as_any(&self) -> &dyn std::any::Any;
}

pub struct Input {
Expand Down
5 changes: 5 additions & 0 deletions crates/goose-cli/src/prompt/cliclack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ impl Prompt for CliclackPrompt {
fn close(&self) {
// No cleanup required
}

#[cfg(test)]
fn as_any(&self) -> &dyn std::any::Any {
panic!("Not implemented");
}
}

//////
Expand Down
5 changes: 5 additions & 0 deletions crates/goose-cli/src/prompt/rustyline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,9 @@ impl Prompt for RustylinePrompt {
fn close(&self) {
// No cleanup required
}

#[cfg(test)]
fn as_any(&self) -> &dyn std::any::Any {
panic!("Not implemented");
}
}
Loading

0 comments on commit 545d6ab

Please sign in to comment.