This commit is contained in:
Antonio Scandurra 2023-10-02 14:36:16 +02:00
parent 64a55681e6
commit df7ac9b815
2 changed files with 2 additions and 9 deletions

View file

@ -581,8 +581,6 @@ impl AssistantPanel {
codegen_kind, codegen_kind,
); );
dbg!(&prompt);
let mut messages = Vec::new(); let mut messages = Vec::new();
let mut model = settings::get::<AssistantSettings>(cx) let mut model = settings::get::<AssistantSettings>(cx)
.default_open_ai_model .default_open_ai_model

View file

@ -144,15 +144,9 @@ pub fn generate_content_prompt(
writeln!(prompt, "```\n{outline}\n```").unwrap(); 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 { match kind {
CodegenKind::Generate { position: _ } => { 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!( writeln!(
prompt, prompt,
"Assume the cursor is located where the `<|START|` marker is." "Assume the cursor is located where the `<|START|` marker is."
@ -170,6 +164,7 @@ pub fn generate_content_prompt(
.unwrap(); .unwrap();
} }
CodegenKind::Transform { range: _ } => { CodegenKind::Transform { range: _ } => {
writeln!(prompt, "In particular, the user has selected a section of the text between the '<|START|' and '|END|>' spans.").unwrap();
writeln!( writeln!(
prompt, prompt,
"Modify the users code selected text based upon the users prompt: {user_prompt}" "Modify the users code selected text based upon the users prompt: {user_prompt}"