Lade till setEndpointAndLlm() till frontendApi()

This commit is contained in:
Joakim Persson
2024-08-05 16:59:58 +02:00
parent 8ac365862a
commit dc209b3595
+7
View File
@@ -53,6 +53,12 @@ const frontendApi = {
// Append the message element to the chatbox immediately
chatbox.appendChild(messageElement);
},
// Set the endpoint and LLM variables
setEndpointAndLlm: function(endpoint, llm) {
window.endpoint = endpoint;
window.llm = llm;
console.log(`Selected Endpoint: ${endpoint}, LLM: ${llm}`);
},
};
// Wait for the event listener to set apiEndpoint and useModel
@@ -82,3 +88,4 @@ document.addEventListener('keydown', function(event) {
document.addEventListener('keyup', function() {
sendButton.style.backgroundColor = ''; // Restore the original style when any key is released
});