解决retrieve接口返回content-type不正确的问题
This commit is contained in:
parent
f36bad3a1d
commit
2c7d706777
|
|
@ -46,9 +46,12 @@ def retrive_stream():
|
|||
knowledge_id = data.get('knowledge_id', '')
|
||||
prompt_template = data.get('prompt_template', '')
|
||||
|
||||
response = zhipu_service.retrive_sse(message, knowledge_id, None)
|
||||
print(f'response: {response}')
|
||||
return response
|
||||
def event_stream():
|
||||
for chunk in zhipu_service.retrive_sse(message, knowledge_id, None):
|
||||
if chunk:
|
||||
yield chunk
|
||||
|
||||
return Response(event_stream(), content_type='text/event-stream')
|
||||
|
||||
|
||||
@zhipu_controller.route('/zhipu/analysis/stream', methods=['POST'])
|
||||
|
|
|
|||
Loading…
Reference in New Issue