From df7ac9b815423c8e9d8afdf5830a55177318a20a Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Mon, 2 Oct 2023 14:36:16 +0200 Subject: [PATCH] :lipstick: --- crates/assistant/src/assistant_panel.rs | 2 -- crates/assistant/src/prompts.rs | 9 ++------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rs index 816047e325..4a4dc08790 100644 --- a/crates/assistant/src/assistant_panel.rs +++ b/crates/assistant/src/assistant_panel.rs @@ -581,8 +581,6 @@ impl AssistantPanel { codegen_kind, ); - dbg!(&prompt); - let mut messages = Vec::new(); let mut model = settings::get::(cx) .default_open_ai_model diff --git a/crates/assistant/src/prompts.rs b/crates/assistant/src/prompts.rs index 8699c77cd1..0646534e01 100644 --- a/crates/assistant/src/prompts.rs +++ b/crates/assistant/src/prompts.rs @@ -144,15 +144,9 @@ pub fn generate_content_prompt( writeln!(prompt, "```\n{outline}\n```").unwrap(); } - // Assume for now that we are just generating - if range.clone().start == range.end { - writeln!(prompt, "In particular, the user's cursor is current on the '<|START|>' span in the above outline, with no text selected.").unwrap(); - } else { - writeln!(prompt, "In particular, the user has selected a section of the text between the '<|START|' and '|END|>' spans.").unwrap(); - } - match kind { CodegenKind::Generate { position: _ } => { + writeln!(prompt, "In particular, the user's cursor is current on the '<|START|>' span in the above outline, with no text selected.").unwrap(); writeln!( prompt, "Assume the cursor is located where the `<|START|` marker is." @@ -170,6 +164,7 @@ pub fn generate_content_prompt( .unwrap(); } CodegenKind::Transform { range: _ } => { + writeln!(prompt, "In particular, the user has selected a section of the text between the '<|START|' and '|END|>' spans.").unwrap(); writeln!( prompt, "Modify the users code selected text based upon the users prompt: {user_prompt}"