update the assistant panel to use new prompt templates

This commit is contained in:
KCaverly 2023-10-18 14:20:12 -04:00
parent b9bb27512c
commit aa1825681c
5 changed files with 33 additions and 146 deletions

View file

@ -44,22 +44,22 @@ impl PromptTemplate for FileContext {
.unwrap();
if start == end {
writeln!(prompt, "<|START|>").unwrap();
write!(prompt, "<|START|>").unwrap();
} else {
writeln!(prompt, "<|START|").unwrap();
write!(prompt, "<|START|").unwrap();
}
writeln!(
write!(
prompt,
"{}",
buffer.text_for_range(start..end).collect::<String>()
)
.unwrap();
if start != end {
writeln!(prompt, "|END|>").unwrap();
write!(prompt, "|END|>").unwrap();
}
writeln!(
write!(
prompt,
"{}",
buffer.text_for_range(end..buffer.len()).collect::<String>()