@@ -65,9 +65,12 @@ def event_content(response,
6565 try :
6666 for chunk in response :
6767 all_text += chunk .content
68- yield manage .get_base_to_response ().to_stream_chunk_response (chat_id , str (chat_record_id ), chunk .content ,
68+ yield manage .get_base_to_response ().to_stream_chunk_response (chat_id , str (chat_record_id ), 'ai-chat-node' ,
69+ [], chunk .content ,
6970 False ,
70- 0 , 0 )
71+ 0 , 0 , {'node_is_end' : False ,
72+ 'view_type' : 'many_view' ,
73+ 'node_type' : 'ai-chat-node' })
7174 # 获取token
7275 if is_ai_chat :
7376 try :
@@ -82,8 +85,11 @@ def event_content(response,
8285 write_context (step , manage , request_token , response_token , all_text )
8386 post_response_handler .handler (chat_id , chat_record_id , paragraph_list , problem_text ,
8487 all_text , manage , step , padding_problem_text , client_id )
85- yield manage .get_base_to_response ().to_stream_chunk_response (chat_id , str (chat_record_id ), '' , True ,
86- request_token , response_token )
88+ yield manage .get_base_to_response ().to_stream_chunk_response (chat_id , str (chat_record_id ), 'ai-chat-node' ,
89+ [], '' , True ,
90+ request_token , response_token ,
91+ {'node_is_end' : True , 'view_type' : 'many_view' ,
92+ 'node_type' : 'ai-chat-node' })
8793 add_access_num (client_id , client_type )
8894 except Exception as e :
8995 logging .getLogger ("max_kb_error" ).error (f'{ str (e )} :{ traceback .format_exc ()} ' )
@@ -92,7 +98,11 @@ def event_content(response,
9298 post_response_handler .handler (chat_id , chat_record_id , paragraph_list , problem_text ,
9399 all_text , manage , step , padding_problem_text , client_id )
94100 add_access_num (client_id , client_type )
95- yield manage .get_base_to_response ().to_stream_chunk_response (chat_id , str (chat_record_id ), all_text , True , 0 , 0 )
101+ yield manage .get_base_to_response ().to_stream_chunk_response (chat_id , str (chat_record_id ), all_text ,
102+ 'ai-chat-node' ,
103+ [], True , 0 , 0 ,
104+ {'node_is_end' : True , 'view_type' : 'many_view' ,
105+ 'node_type' : 'ai-chat-node' })
96106
97107
98108class BaseChatStep (IChatStep ):
0 commit comments