Spaces:
Running
Running
Update script2.js
Browse files- script2.js +8 -2
script2.js
CHANGED
@@ -68,11 +68,14 @@ const processPrefetchQueue = async () => {
|
|
68 |
const abortController = new AbortController();
|
69 |
pendingPrefetchRequests.set(cacheKey, abortController);
|
70 |
|
|
|
|
|
71 |
const url = '/stream_text';
|
72 |
const requestBody = {
|
73 |
query: query,
|
74 |
history: JSON.stringify(conversationHistory),
|
75 |
-
model: modelSelectionDropdown.value
|
|
|
76 |
};
|
77 |
|
78 |
try {
|
@@ -249,11 +252,14 @@ const sendQueryToAI = async (query) => {
|
|
249 |
|
250 |
requestAbortController = new AbortController();
|
251 |
|
|
|
|
|
252 |
const url = '/stream_text';
|
253 |
const requestBody = {
|
254 |
query: query,
|
255 |
history: JSON.stringify(conversationHistory),
|
256 |
-
model: modelSelectionDropdown.value
|
|
|
257 |
};
|
258 |
|
259 |
try {
|
|
|
68 |
const abortController = new AbortController();
|
69 |
pendingPrefetchRequests.set(cacheKey, abortController);
|
70 |
|
71 |
+
const userSambanovaKey = document.getElementById('apiKey').value.trim() !== '' ? document.getElementById('apiKey').value : 'none';
|
72 |
+
|
73 |
const url = '/stream_text';
|
74 |
const requestBody = {
|
75 |
query: query,
|
76 |
history: JSON.stringify(conversationHistory),
|
77 |
+
model: modelSelectionDropdown.value,
|
78 |
+
api_key: userSambanovaKey
|
79 |
};
|
80 |
|
81 |
try {
|
|
|
252 |
|
253 |
requestAbortController = new AbortController();
|
254 |
|
255 |
+
const userSambanovaKey = document.getElementById('apiKey').value.trim() !== '' ? document.getElementById('apiKey').value : 'none';
|
256 |
+
|
257 |
const url = '/stream_text';
|
258 |
const requestBody = {
|
259 |
query: query,
|
260 |
history: JSON.stringify(conversationHistory),
|
261 |
+
model: modelSelectionDropdown.value,
|
262 |
+
api_key: userSambanovaKey
|
263 |
};
|
264 |
|
265 |
try {
|