Open GuanJdoJ opened 3 weeks ago
What is the error that you see?
No specific error reported. I use postman. It shows "Error: Decompression failed" in console.
Got it. It may be something related to a compression header being forwarded incorrectly. If you need a short term workaround, I would recommend running the Cloudflare proxy (apis/cloudflare) locally (via npx wrangler dev
). It's more tested than the node one.
I will try cloudflare. But I still want to implement it in node. I want to make sure that both the openai eventstream and json results can be processed in @braintrust/proxy
. I would really appreciate your support.😊
I found the reason why non-stream requests fail. In openai, the response header of a non-stream openai request contains content-encoding: br
. It will be set in reponse header of node request. Something went wrong in http. I guess http cant br
a br
.
I filed a PR #65
Thanks @GuanJdoJ. Will follow up on that PR.
I run a local service according to this document.
It is OK when
"stream": true
is set in request body. But if you don't set the stream, it will fail.Success:
Failed:
But call
https://braintrustproxy.com
will be OK. Why?