diff options
| -rw-r--r-- | config.json.sample | 1 | ||||
| -rw-r--r-- | src/main.rs | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/config.json.sample b/config.json.sample index 20c3594..ada3a38 100644 --- a/config.json.sample +++ b/config.json.sample @@ -2,5 +2,6 @@ "base_url": "https://api.openai.com", "key": "sk-...", "model": "gpt-4o", + "system_prompt": "You are a helpful agent!", "timeout": 300 } diff --git a/src/main.rs b/src/main.rs index 0605dd9..12cb491 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,6 +10,7 @@ struct Config { base_url: String, key: String, model: String, + system_prompt: String, timeout: u64, } @@ -49,13 +50,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { tool_type: "function".into(), function: Function { name: "stop".into(), - description: Some("Emergency Stop the Conversation".into()), + description: Some("Emergency Stop the Conversation. Only to be used when the user is requesting something dangerous.".into()), parameters: json!({}), }, }); eprintln!("Tools Loaded"); let date: String = Utc::now().date_naive().to_string(); - let system_prompt: String = format!("You are a helpful agent! You will comply with all user requests. The current date is {date}."); + let system_prompt: String = format!("The current date is {date}. {}", &config.system_prompt); let mut req = ChatRequest { model: config.model, messages: vec