把 "Accept": "text/event-stream"去掉,也无法禁用流式输出,我应该怎么操作呢?我的代码如下“” import requests import json url = "{baseurl}/api/v1/chat/completions" api_key = "xxxxxxxxx" headers = { "Authorization": api_key, "content-type": "application/json", # "Accept": "text/event-stream" } data = { "prompt": [ { "type": "text", "content": "周杰伦的主要作品有哪些?" } ], "session_id": 19, "thinking_enabled": True, "user_no": "123456", } response = requests.post(url, headers=headers, json=data) print(response.text) “”
Activity
thundax-lyp commentedon Dec 9, 2025
无法在客户端禁止。不建议禁止,这是一个长时间的应答,不用流式输出容易导致请求超时。
Lockjava commentedon Dec 9, 2025
我们确实需要非流式输出的场景,能在服务端禁止吗?或者说如何禁止呢?
thinkhejie commentedon Jan 29, 2026
服务端是不是默认启用了SSE ? 哪里可以关掉吗 ? 我也有诉求,服务端不要返回中间过程。举个例子,现在的API返回的是:
你
你好
你好! 世界。
其实,我只需要【你好! 世界。】前面两句不需要的。