T1ckbase commited on
Commit
5e11386
·
1 Parent(s): d07388b

c.req.json()

Browse files
Files changed (1) hide show
  1. main.ts +6 -2
main.ts CHANGED
@@ -40,9 +40,13 @@ app.post('/v1/chat/completions', async (c) => {
40
  headers.get('x-use-cache') || headers.set('x-use-cache', 'false');
41
  console.log('headers:', Object.fromEntries(headers));
42
 
43
- const clonedRequest = await c.req.raw.clone();
44
- const body = await clonedRequest.json();
 
 
 
45
  body.max_tokens = 33554432;
 
46
  console.log('body:', body);
47
 
48
  return await fetch(targetUrl, {
 
40
  headers.get('x-use-cache') || headers.set('x-use-cache', 'false');
41
  console.log('headers:', Object.fromEntries(headers));
42
 
43
+ // const clonedRequest = await c.req.raw.clone();
44
+ // const body = await clonedRequest.json();
45
+ // body.max_tokens = 33554432;
46
+
47
+ const body = await c.req.json();
48
  body.max_tokens = 33554432;
49
+
50
  console.log('body:', body);
51
 
52
  return await fetch(targetUrl, {