Spaces:
Running
Running
Update index.html
Browse files- index.html +7 -5
index.html
CHANGED
@@ -351,13 +351,15 @@
|
|
351 |
});
|
352 |
if(prefix.trim()) messages.push({ role:"assistant", content:prefix.trim() });
|
353 |
|
|
|
|
|
|
|
|
|
|
|
|
|
354 |
let startTime = Date.now();
|
355 |
let result = await fetch(`${serverOrigin.trim().replace(/\/$/, "")}/v1/chat/completions`, {
|
356 |
-
headers
|
357 |
-
"content-type": "application/json",
|
358 |
-
"Authorization": `Bearer ${apiKeyEl.value}`,
|
359 |
-
"anthropic-dangerous-direct-browser-access": "true",
|
360 |
-
},
|
361 |
body: JSON.stringify({
|
362 |
model: modelName.trim(),
|
363 |
stream: false,
|
|
|
351 |
});
|
352 |
if(prefix.trim()) messages.push({ role:"assistant", content:prefix.trim() });
|
353 |
|
354 |
+
let headers = {
|
355 |
+
"content-type": "application/json",
|
356 |
+
"Authorization": `Bearer ${apiKeyEl.value}`,
|
357 |
+
};
|
358 |
+
if(serverOrigin.trim().includes("api.anthropic.com/")) headers["anthropic-dangerous-direct-browser-access"] = "true";
|
359 |
+
|
360 |
let startTime = Date.now();
|
361 |
let result = await fetch(`${serverOrigin.trim().replace(/\/$/, "")}/v1/chat/completions`, {
|
362 |
+
headers,
|
|
|
|
|
|
|
|
|
363 |
body: JSON.stringify({
|
364 |
model: modelName.trim(),
|
365 |
stream: false,
|