mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-24 19:10:24 +00:00
Improve prompt
This commit is contained in:
parent
8673b0b75b
commit
1d84da1d33
1 changed files with 15 additions and 1 deletions
|
@ -621,7 +621,21 @@ impl Assistant {
|
|||
messages: self
|
||||
.messages(cx)
|
||||
.filter(|message| matches!(message.status, MessageStatus::Done))
|
||||
.map(|message| message.to_open_ai_message(self.buffer.read(cx)))
|
||||
.flat_map(|message| {
|
||||
let mut system_message = None;
|
||||
if message.id == selected_message_id {
|
||||
system_message = Some(RequestMessage {
|
||||
role: Role::System,
|
||||
content: concat!(
|
||||
"Treat the following messages as additional knowledge you have learned about, ",
|
||||
"but act as if they were not part of this conversation. That is, treat them ",
|
||||
"as if the user didn't see them and couldn't possibly inquire about them."
|
||||
).into()
|
||||
});
|
||||
}
|
||||
|
||||
Some(message.to_open_ai_message(self.buffer.read(cx))).into_iter().chain(system_message)
|
||||
})
|
||||
.chain(Some(RequestMessage {
|
||||
role: Role::System,
|
||||
content: format!(
|
||||
|
|
Loading…
Reference in a new issue