Skip to content
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

lm-studio offline hook #72

Merged
merged 3 commits into from
Dec 25, 2024
Merged

lm-studio offline hook #72

merged 3 commits into from
Dec 25, 2024

Conversation

appatalks
Copy link
Owner

Using lm-studio for offline model hooks
This pull request adds support for a local OpenAI-like endpoint called lm-studio to the existing application. The most important changes include the addition of a new JavaScript function to handle requests to this endpoint, updates to the options and button handling logic to include the new model, and modifications to the HTML to support the new option.

New Functionality:

  • core/js/lm-studio.js: Added a new function lmsSend to handle sending data to the local OpenAI-like endpoint and processing the response.

Updates to Options Handling:

  • core/js/options.js: Updated the autoSelect, updateButton, and sendData functions to include the new lm-studio model option. [1] [2] [3]

HTML Modifications:

  • index.html: Included the new lm-studio.js script and added lm-studio as an option in the model selection dropdown. [1] [2]

openAIMessages = JSON.parse(storedOpenAIMessages);
}

const sQuestion = document.getElementById("txtMsg").innerHTML.replace(/<br>/g, "\n").replace(/<[^>]+>/g, "").trim();

Check failure

Code scanning / CodeQL

Incomplete multi-character sanitization High

This string may still contain
<script
, which may cause an HTML element injection vulnerability.
@appatalks appatalks merged commit 0099b83 into main Dec 25, 2024
3 of 4 checks passed
@appatalks appatalks deleted the appatalks-lm-studio branch December 25, 2024 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant