about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--config.json.sample3
-rw-r--r--src/main.rs3
2 files changed, 4 insertions, 2 deletions
diff --git a/config.json.sample b/config.json.sample
index 7f6a4fa..20c3594 100644
--- a/config.json.sample
+++ b/config.json.sample
@@ -1,5 +1,6 @@
 {
 	"base_url": "https://api.openai.com",
 	"key": "sk-...",
-	"model": "gpt-4o"
+	"model": "gpt-4o",
+	"timeout": 300
 }
diff --git a/src/main.rs b/src/main.rs
index 78bb61b..0605dd9 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -10,6 +10,7 @@ struct Config {
     base_url: String,
     key: String,
     model: String,
+    timeout: u64,
 }
 
 async fn get_horoscope(sign: &str) -> String {
@@ -26,7 +27,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
     let client = LlmClient::openai_with_config(
         &config.key,
         Some(&config.base_url),
-        Some(300),
+        Some(config.timeout),
         None,
     )?;
     eprintln!("Config Setup");