-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Contact Information
No response
MaxKB Version
v1.10.3
Problem Description
1、请求/chat/completions对话接口时发现,如果在Request Header中添加 Accept:text/event-stream,Response返回
{"code": 500, "message": "无法满足accept http头的请求。", "data": null}
2、不手动添加的情况,Response返回正常的text/event-stream流
Steps to Reproduce
new Request.Builder().url(url).header("Accept", "text/event-stream").post( RequestBody.create(objectMapper.writeValueAsString(obj), MediaType.parse("application/json; charset=utf-8"))).build()
返回失败
new Request.Builder().url(url).post( RequestBody.create(objectMapper.writeValueAsString(obj), MediaType.parse("application/json; charset=utf-8"))).build()
返回正常
基于OkhttpClient
Response response = HttpUtils.getHttpClient().newCall(request).execute(); response.body().string()
The expected correct result
如果接口本身支持SSE的话,希望支持Request包含Accept:text/event-stream,如OkHttp SSE框架,默认会添加Accept:text/event-stream
Related log output
Additional Information
No response