mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🚀 feat: Add OPENAI_ORGANIZATION for all OpenAI Requests (#1590)
This commit is contained in:
parent
7e2e19a134
commit
a7c54573c4
4 changed files with 17 additions and 0 deletions
|
|
@ -53,6 +53,10 @@ const fetchModels = async ({ apiKey, baseURL, name = 'OpenAI', azure = false })
|
|||
payload.httpsAgent = new HttpsProxyAgent(PROXY);
|
||||
}
|
||||
|
||||
if (process.env.OPENAI_ORGANIZATION && baseURL.includes('openai')) {
|
||||
payload.headers['OpenAI-Organization'] = process.env.OPENAI_ORGANIZATION;
|
||||
}
|
||||
|
||||
const res = await axios.get(`${baseURL}${azure ? '' : '/models'}`, payload);
|
||||
models = res.data.data.map((item) => item.id);
|
||||
} catch (err) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue