groq-model-comparison/rust-learning/src/config.rs
2024-12-27 02:27:22 -05:00

19 lines
361 B
Rust

use dotenv::dotenv;
use std::sync::LazyLock;
pub struct Config {
pub groq_api_key: String,
}
impl Config {
pub fn new() -> Self {
dotenv().ok();
Self {
groq_api_key: std::env::var("GROQ_API_KEY").expect("GROQ_API_KEY must be set"),
}
}
}
pub static CONFIG: LazyLock<Config> = LazyLock::new(|| Config::new());