MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / init_openai_env

Function init_openai_env

src/config.rs:95–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

93
94
95pub fn init_openai_env() {
96 let model = std::env::var("OPENAI_MODEL_NAME").unwrap_or_else(|_| panic!("OPENAI_MODEL_NAME not set"));
97 let endpoint = std::env::var("OPENAI_ENDPOINT").unwrap_or_else(|_| panic!("OPENAI_ENDPOINT not set"));
98
99 OPENAI_MODEL_NAME.set(model).unwrap();
100 OPENAI_ENDPOINT.set(endpoint).unwrap();
101}
102
103pub fn get_config() -> RwLockReadGuard<'static, Config>{
104 CONFIG_INSTANCE.get().unwrap().read().unwrap()

Callers 2

test_get_clientFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_get_clientFunction · 0.68