Open davidfant opened 1 month ago
Hey @davidfant can you add the stack trace? Are you sure this is not a client error? I've run the code snippet in my local without any exceptions
Hey! Can you please make sure that you are using the latest version of the gateway.
Having the same problem with @portkey-ai/gateway@1.5.7
and the node SDK "portkey-ai": "^1.3.2"
on the node client.
APIConnectionError: Connection error.
at OpenAI.makeRequest (file:///tmp/ttaa/node_modules/openai/core.mjs:297:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async main (file:///tmp/ttaa/index.mjs:15:26) {
status: undefined,
headers: undefined,
request_id: undefined,
error: undefined,
code: undefined,
param: undefined,
type: undefined,
cause: FetchError: request to http://127.0.0.1:8787/v1/chat/completions failed, reason: Parse Error: Content-Length can't be present with Transfer-Encoding
at ClientRequest.<anonymous> (/tmp/ttaa/node_modules/node-fetch/lib/index.js:1501:11)
at ClientRequest.emit (node:events:513:28)
at Socket.socketOnData (node:_http_client:551:9)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
type: 'system',
errno: 'HPE_UNEXPECTED_CONTENT_LENGTH',
code: 'HPE_UNEXPECTED_CONTENT_LENGTH'
}
}
Hey! We have identified the cause for this. Will be pushing a patch soon
I wonder if you have an ETA? We've parked our integration with Portkey pending on this fix.
What Happened?
I'm running the gateway locally using
npx @portkey-ai/gateway
and using the NodeJS SDK I got weird connection errorsThe following CURL request works:
But in node with either fetch, node-fetch or axios I'm always getting the error
"Content-Length can't be present with Transfer-Encoding"
from PortkeyThis works as expected when running using Docker
What Should Have Happened?
The Node SDK should work
Relevant Code Snippet
No response
Your Twitter/LinkedIn
https://twitter.com/da_fant