Spaces:
Running
Running
Update index.html
Browse files- index.html +5 -5
index.html
CHANGED
|
@@ -129,8 +129,8 @@
|
|
| 129 |
</template>
|
| 130 |
|
| 131 |
<script>
|
| 132 |
-
const BASE='
|
| 133 |
-
const ENDPOINT='/
|
| 134 |
const MODELS=['Gemini','OpenAi','Meta','Alibaba'];
|
| 135 |
const LOGOS={
|
| 136 |
Gemini:'https://cdn.simpleicons.org/google/ffffff',
|
|
@@ -244,7 +244,7 @@
|
|
| 244 |
setStatus('Cleaning prompt...', 'info');
|
| 245 |
setBtn?.setAttribute('disabled','true'); setBtn && (setBtn.textContent='Cleaning...');
|
| 246 |
try{
|
| 247 |
-
const url=BASE+'/set_prompt?text='+encodeURIComponent(q);
|
| 248 |
const res=await fetch(url,{method:'GET', headers:{'Accept':'application/json','ngrok-skip-browser-warning':'1'}});
|
| 249 |
if(!res.ok) throw new Error('HTTP '+res.status);
|
| 250 |
const ct=res.headers.get('content-type')||'';
|
|
@@ -262,7 +262,7 @@
|
|
| 262 |
async function query(){
|
| 263 |
const q=promptEl.value.trim(); if(!q){setStatus('Enter a message.', 'error');return}
|
| 264 |
clearStatus(); bumpUsage(); const targets=['All',...MODELS];
|
| 265 |
-
addMessage(targets,{role:'user', name:'You', text:q}); promptEl.value=''; sendBtn.disabled=true;
|
| 266 |
try{
|
| 267 |
const url=BASE+ENDPOINT+'?text='+encodeURIComponent(q);
|
| 268 |
const res=await fetch(url,{method:'GET', headers:{'Accept':'application/json','ngrok-skip-browser-warning':'1'}});
|
|
@@ -280,7 +280,7 @@
|
|
| 280 |
}
|
| 281 |
for(const key of keys){ const text=String(data[key]||''); addMessage(['All', key], {role:'assistant', name:key, text}); }
|
| 282 |
}catch(e){ setStatus('Request failed. Check server/CORS. '+(e.message||e),'error'); }
|
| 283 |
-
finally{ sendBtn.disabled=false;
|
| 284 |
}
|
| 285 |
|
| 286 |
// Tabs (mobile)
|
|
|
|
| 129 |
</template>
|
| 130 |
|
| 131 |
<script>
|
| 132 |
+
const BASE='';
|
| 133 |
+
const ENDPOINT='/api/multimodel';
|
| 134 |
const MODELS=['Gemini','OpenAi','Meta','Alibaba'];
|
| 135 |
const LOGOS={
|
| 136 |
Gemini:'https://cdn.simpleicons.org/google/ffffff',
|
|
|
|
| 244 |
setStatus('Cleaning prompt...', 'info');
|
| 245 |
setBtn?.setAttribute('disabled','true'); setBtn && (setBtn.textContent='Cleaning...');
|
| 246 |
try{
|
| 247 |
+
const url=BASE+'/api/set_prompt?text='+encodeURIComponent(q);
|
| 248 |
const res=await fetch(url,{method:'GET', headers:{'Accept':'application/json','ngrok-skip-browser-warning':'1'}});
|
| 249 |
if(!res.ok) throw new Error('HTTP '+res.status);
|
| 250 |
const ct=res.headers.get('content-type')||'';
|
|
|
|
| 262 |
async function query(){
|
| 263 |
const q=promptEl.value.trim(); if(!q){setStatus('Enter a message.', 'error');return}
|
| 264 |
clearStatus(); bumpUsage(); const targets=['All',...MODELS];
|
| 265 |
+
addMessage(targets,{role:'user', name:'You', text:q}); promptEl.value=''; sendBtn.disabled=true;
|
| 266 |
try{
|
| 267 |
const url=BASE+ENDPOINT+'?text='+encodeURIComponent(q);
|
| 268 |
const res=await fetch(url,{method:'GET', headers:{'Accept':'application/json','ngrok-skip-browser-warning':'1'}});
|
|
|
|
| 280 |
}
|
| 281 |
for(const key of keys){ const text=String(data[key]||''); addMessage(['All', key], {role:'assistant', name:key, text}); }
|
| 282 |
}catch(e){ setStatus('Request failed. Check server/CORS. '+(e.message||e),'error'); }
|
| 283 |
+
finally{ sendBtn.disabled=false; }
|
| 284 |
}
|
| 285 |
|
| 286 |
// Tabs (mobile)
|