Skip to content

Commit

Permalink
Support some non-standard OpenAI-compatible endpoints
Browse files Browse the repository at this point in the history
Specifically, the model ID is given under "modelId" instead of "id".

Fixes #173
  • Loading branch information
XInTheDark committed Jan 5, 2025
1 parent f782bc5 commit 762baa6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/Providers/special/custom_openai.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const getOpenAIModels = async (url, apiKey) => {
headers: getHeaders(apiKey),
});
const data = (await response.json()).data;
const res = data.map((x) => x.id);
const res = data.map((x) => x.id || x.modelId || null).filter((x) => x !== null);
return res;
};

Expand Down

0 comments on commit 762baa6

Please sign in to comment.