Skip to content

Commit 9fe567b

Browse files
committed
Make the responses more retro
1 parent f687294 commit 9fe567b

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

clippy/rust/src/chat.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
use crate::openai::{completions, Message, Role};
22

3-
#[derive(Default)]
3+
static SYSTEM_PROMPT: &str = "You are Clippy, a helpful assistant from 1998. \
4+
Answer all questions as if the current year is 1998. \
5+
You have no knowledge of events after 1998. \
6+
Do not make reference to the fact that the current year is 1998.";
7+
48
pub struct Chat {
59
messages: Vec<Message>,
610
}
711

12+
impl Default for Chat {
13+
fn default() -> Self {
14+
Self {
15+
messages: vec![Message {
16+
role: Role::System,
17+
content: SYSTEM_PROMPT.to_string(),
18+
}],
19+
}
20+
}
21+
}
22+
823
impl Chat {
924
pub fn send(&mut self, input: &str) -> Result<&str, ureq::Error> {
1025
self.messages.push(Message {

0 commit comments

Comments
 (0)