Improve prompts for tools (#11669)

Improves the descriptions for some of the tools. I wish we had metrics
to back up changes in how the model responds to tool schema changes so
anecdotally I'm just going to say this _seems_ improved.

Release Notes:

- N/A
This commit is contained in:
Kyle Kelley 2024-05-10 13:18:05 -07:00 committed by GitHub
parent fc584017d1
commit 38f110852f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 171 additions and 26 deletions

View file

@ -35,11 +35,11 @@ impl LanguageModelTool for CreateBufferTool {
type View = CreateBufferView;
fn name(&self) -> String {
"create_buffer".to_string()
"create_file".to_string()
}
fn description(&self) -> String {
"Create a new buffer in the current codebase".to_string()
"Create a new untitled file in the current codebase. Side effect: opens it in a new pane/tab for the user to edit.".to_string()
}
fn view(&self, cx: &mut WindowContext) -> View<Self::View> {
@ -61,7 +61,7 @@ pub struct CreateBufferView {
impl Render for CreateBufferView {
fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {
div().child("Opening a buffer")
ui::Label::new("Opening a buffer")
}
}
@ -81,8 +81,9 @@ impl ToolOutput for CreateBufferView {
}
}
fn set_input(&mut self, input: Self::Input, _cx: &mut ViewContext<Self>) {
fn set_input(&mut self, input: Self::Input, cx: &mut ViewContext<Self>) {
self.input = Some(input);
cx.notify();
}
fn execute(&mut self, cx: &mut ViewContext<Self>) -> Task<Result<()>> {