We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f687294 commit 9fe567bCopy full SHA for 9fe567b
1 file changed
clippy/rust/src/chat.rs
@@ -1,10 +1,25 @@
1
use crate::openai::{completions, Message, Role};
2
3
-#[derive(Default)]
+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
+
8
pub struct Chat {
9
messages: Vec<Message>,
10
}
11
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
23
impl Chat {
24
pub fn send(&mut self, input: &str) -> Result<&str, ureq::Error> {
25
self.messages.push(Message {
0 commit comments