Skip to content

Commit

Permalink
fix: read the model from the config file
Browse files Browse the repository at this point in the history
  • Loading branch information
pythops committed Jan 19, 2024
1 parent 5109979 commit b27252c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/chatgpt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use std::sync::mpsc::Sender;
pub struct ChatGPT {
client: reqwest::blocking::Client,
openai_api_key: String,
model: String,
url: String,
}

Expand All @@ -41,6 +42,7 @@ You need to define one wether in the configuration file or as an environment var
Self {
client: reqwest::blocking::Client::new(),
openai_api_key,
model: config.model,
url: config.url,
}
}
Expand Down Expand Up @@ -73,7 +75,7 @@ impl LLM for ChatGPT {
messages.extend(chat_messages);

let body: Value = json!({
"model": "gpt-3.5-turbo",
"model": self.model,
"messages": messages,
"stream": true,
});
Expand Down

0 comments on commit b27252c

Please sign in to comment.