mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-08 04:23:35 +00:00
feat(agent):Fix agent bug (#1953)
Co-authored-by: aries_ckt <916701291@qq.com>
This commit is contained in:
@@ -548,6 +548,17 @@ async def chat_completions(
|
||||
headers=headers,
|
||||
media_type="text/plain",
|
||||
)
|
||||
except Exception as e:
|
||||
logger.exception(f"Chat Exception!{dialogue}", e)
|
||||
|
||||
async def error_text(err_msg):
|
||||
yield f"data:{err_msg}\n\n"
|
||||
|
||||
return StreamingResponse(
|
||||
error_text(str(e)),
|
||||
headers=headers,
|
||||
media_type="text/plain",
|
||||
)
|
||||
finally:
|
||||
# write to recent usage app.
|
||||
if dialogue.user_name is not None and dialogue.app_code is not None:
|
||||
|
Reference in New Issue
Block a user