-
-
Notifications
You must be signed in to change notification settings - Fork 430
OpenAI compatibility API #919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
|
||
| export function checkApiKey(apiKey) { | ||
| export function checkApiKey(apiKey, customEndpoint = null) { | ||
| return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds support for a custom OpenAI compatibility API endpoint and a model override input, along with updating API call functions to accommodate these changes.
- Adds a custom endpoint input in the GUI and passes it to API request functions
- Updates function signatures and template input events in openai.js and index.html.template to support the new custom endpoint and custom model parameters
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| scalene/scalene-gui/optimizations.js | Adds retrieval of customEndpoint and customModel values and passes them to sendPromptToOpenAI |
| scalene/scalene-gui/openai.js | Updates functions tryApi, isValidApiKey, checkApiKey, and sendPromptToOpenAI to accept customEndpoint and customModel parameters |
| scalene/scalene-gui/index.html.template | Adds new input fields for custom OpenAI compatibility API URL and language model override |
Comments suppressed due to low confidence (1)
scalene/scalene-gui/optimizations.js:201
- The variable 'customEndpoint' is assigned without being declared, which may result in an unintended global variable. Please declare it (e.g., using 'let customEndpoint = ...') to ensure proper scoping.
customEndpoint = document.getElementById("openai-compatibility-api-url").value;
|
Hi @sanderland - should this still be a draft? |
|
@emeryberger in the issue I described where I got stuck (mainly webpack). If there is no capacity to help on that part, just close this. |
|
How are you testing? With |
|
It's a while back! I think the python script ended up producing a web page, but this page included compressed scripts which very persistently were the old versions. |
WIP, not working yet