Skip to content

Commit

Permalink
fix: 文件上传相关的一些日志改为中文
Browse files Browse the repository at this point in the history
  • Loading branch information
zgqgit committed Jun 18, 2024
1 parent bf98b65 commit 16c21a0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/backend/bisheng/chat/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ async def handle_websocket(
if context.get('status') == 'init':
erro_resp.intermediate_steps = f'LLM 技能执行错误. error={str(e)}'
elif context.get('has_file'):
erro_resp.intermediate_steps = f'File is parsed fail. error={str(e)}'
erro_resp.intermediate_steps = f'文件解析失败. error={str(e)}'
else:
erro_resp.intermediate_steps = f'Input data is parsed fail. error={str(e)}'
context['status'] = 'init'
Expand Down Expand Up @@ -469,7 +469,7 @@ async def preper_payload(self, payload, graph_data, langchain_obj_key, client_id
self.set_cache(langchain_obj_key, None) # rebuild object
has_file = any(['InputFile' in nd.get('id', '') for nd in node_data])
if has_file:
step_resp.intermediate_steps = 'File upload complete and begin to parse'
step_resp.intermediate_steps = '文件上传完成,开始解析'
await self.send_json(client_id, chat_id, start_resp)
await self.send_json(client_id, chat_id, step_resp, add=False)
await self.send_json(client_id, chat_id, start_resp)
Expand All @@ -485,7 +485,7 @@ async def preper_action(self, client_id, chat_id, langchain_obj_key, payload,
over = False
if isinstance(langchain_obj, Report):
action = 'report'
step_resp.intermediate_steps = 'File parsing complete, generate begin'
step_resp.intermediate_steps = '文件解析完成,开始生成报告'
await self.send_json(client_id, chat_id, step_resp)
elif 'action' in payload:
action = 'autogen'
Expand All @@ -510,13 +510,13 @@ async def preper_action(self, client_id, chat_id, langchain_obj_key, payload,
user_id=step_resp.user_id)
self.chat_history.add_message(client_id, chat_id, file)
step_resp.message = ''
step_resp.intermediate_steps = 'File parsing complete'
step_resp.intermediate_steps = '文件解析完成'
await self.send_json(client_id, chat_id, step_resp)
start_resp.type = 'close'
await self.send_json(client_id, chat_id, start_resp)
over = True
else:
step_resp.intermediate_steps = 'File parsing complete. Analysis starting'
step_resp.intermediate_steps = '文件解析完成,开始执行'
await self.send_json(client_id, chat_id, step_resp, add=False)
await asyncio.sleep(-1) # 快速的跳过
return action, over
Expand Down

0 comments on commit 16c21a0

Please sign in to comment.