Spaces:
Sleeping
Sleeping
T1ckbase commited on
Commit ·
e5fe435
1
Parent(s): e240261
test
Browse files
main.ts
CHANGED
|
@@ -35,17 +35,20 @@ app.post('/v1/chat/completions', async (c) => {
|
|
| 35 |
|
| 36 |
const clonedRequest = await c.req.raw.clone();
|
| 37 |
const body = await clonedRequest.json();
|
| 38 |
-
body.max_tokens = 33554432;
|
| 39 |
console.log(body);
|
|
|
|
| 40 |
|
| 41 |
const headers = new Headers(c.req.raw.headers);
|
|
|
|
| 42 |
headers.delete('Authorization');
|
| 43 |
headers.get('x-use-cache') || headers.set('x-use-cache', 'false');
|
|
|
|
| 44 |
|
| 45 |
return await fetch(targetUrl, {
|
| 46 |
method: 'POST',
|
| 47 |
headers: headers,
|
| 48 |
-
body:
|
| 49 |
});
|
| 50 |
});
|
| 51 |
|
|
|
|
| 35 |
|
| 36 |
const clonedRequest = await c.req.raw.clone();
|
| 37 |
const body = await clonedRequest.json();
|
| 38 |
+
// body.max_tokens = 33554432;
|
| 39 |
console.log(body);
|
| 40 |
+
console.log(targetUrl);
|
| 41 |
|
| 42 |
const headers = new Headers(c.req.raw.headers);
|
| 43 |
+
// headers.delete('Host');
|
| 44 |
headers.delete('Authorization');
|
| 45 |
headers.get('x-use-cache') || headers.set('x-use-cache', 'false');
|
| 46 |
+
console.log('headers:', Object.fromEntries(headers));
|
| 47 |
|
| 48 |
return await fetch(targetUrl, {
|
| 49 |
method: 'POST',
|
| 50 |
headers: headers,
|
| 51 |
+
body: c.req.raw.body,
|
| 52 |
});
|
| 53 |
});
|
| 54 |
|