@@ -220,7 +220,8 @@ def generate_analysis(self):
220220 self .chat_question .data = orjson .dumps (data .get ('data' )).decode ()
221221 analysis_msg : List [Union [BaseMessage , dict [str , Any ]]] = []
222222
223- self .chat_question .terminologies = get_terminology_template (self .session , self .chat_question .question , self .current_user .oid )
223+ self .chat_question .terminologies = get_terminology_template (self .session , self .chat_question .question ,
224+ self .current_user .oid )
224225
225226 analysis_msg .append (SystemMessage (content = self .chat_question .analysis_sys_question ()))
226227 analysis_msg .append (HumanMessage (content = self .chat_question .analysis_user_question ()))
@@ -498,6 +499,10 @@ def select_datasource(self):
498499 answer = orjson .dumps ({'content' : full_text }).decode (),
499500 datasource = _datasource ,
500501 engine_type = _engine_type )
502+
503+ self .chat_question .terminologies = get_terminology_template (self .session , self .chat_question .question ,
504+ self .ds .oid if isinstance (self .ds ,
505+ CoreDatasource ) else 1 )
501506 self .init_messages ()
502507
503508 if _error :
@@ -894,7 +899,10 @@ def run_task_cache(self, in_chat: bool = True):
894899
895900 def run_task (self , in_chat : bool = True ):
896901 try :
897- self .chat_question .terminologies = get_terminology_template (self .session , self .chat_question .question , self .current_user .oid )
902+ if self .ds :
903+ self .chat_question .terminologies = get_terminology_template (self .session , self .chat_question .question ,
904+ self .ds .oid if isinstance (self .ds ,
905+ CoreDatasource ) else 1 )
898906 self .init_messages ()
899907
900908 # return id
0 commit comments