Skip to content

Commit 2703563

Browse files
committed
feat: Add OpenAI API settings to project.
- Import and integrate the `async_openai` module with `API_BASE` constant - Add `api_base` field to `OpenAISettings` for more customization options - Implement prefix parsing of environment variables for easier settings collection
1 parent 908f4c7 commit 2703563

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/settings.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use std::{collections::HashMap, fs, path::PathBuf, str::FromStr};
22
#[cfg(unix)]
33
use std::{fs::Permissions, os::unix::prelude::PermissionsExt};
44

5+
use async_openai::API_BASE;
56
use config::{
67
builder::DefaultState, Config, ConfigBuilder, ConfigError, Environment, File, Source,
78
};
@@ -223,7 +224,7 @@ impl Settings {
223224
.set_default(
224225
"openai",
225226
Some(OpenAISettings {
226-
api_base: None,
227+
api_base: Some(API_BASE.to_string()),
227228
api_key: None,
228229
model: Some(DEFAULT_OPENAI_MODEL.to_string()),
229230
retries: Some(2),

0 commit comments

Comments
 (0)