ProxymanApp / Proxyman

Modern. Native. Delightful Web Debugging Proxy for macOS, iOS, and Android ⚡️
https://proxyman.io
5.35k stars 177 forks source link

After setting interception in the script, event stream will wait until all data is returned before executing onResponse #1849

Open lastIndexOf opened 7 months ago

lastIndexOf commented 7 months ago

How to intercept only the Request?

I want to intercept the request of GPT and modify the request body. However, I found that after modifying it in this way, the event stream of the response must wait until it is completely received before onResponse is triggered. The corresponding app will also respond only then, instead of displaying data piece by piece. How should I solve this problem?

NghiaTranUIT commented 7 months ago

Yes, it's a known issue because Proxyman doesn't support streaming data yet. When the connection is completed, Proxyman will show the data.

You can use response_format={ "type": "json_object" } to tell the OpenAI to respond to a JSON instead of streaming data.

Ref: https://community.openai.com/t/how-do-i-use-the-new-json-mode/475890

lastIndexOf commented 7 months ago

Yes, it's a known issue because Proxyman doesn't support streaming data yet. When the connection is completed, Proxyman will show the data.是的,这是一个已知问题,因为 Proxyman 尚不支持流数据。连接完成后,Proxyman 将显示数据。

You can use response_format={ "type": "json_object" } to tell the OpenAI to respond to a JSON instead of streaming data.您可以使用 response_format={ "type": "json_object" } 告诉 OpenAI 响应 JSON 而不是流数据。

Ref: community.openai.com/t/how-do-i-use-the-new-json-mode/475890参考:community.openai.com/t/how-do-i-use-the-new-json-mode/475890

Is there a supported plan?