From b112cb320c4e6e222f657ccd960bffdf77384d4c Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Wed, 28 May 2025 12:54:30 +0800 Subject: [PATCH] fix: bad ability name in preproc check --- pkg/pipeline/preproc/preproc.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/pipeline/preproc/preproc.py b/pkg/pipeline/preproc/preproc.py index c71fad78..65463385 100644 --- a/pkg/pipeline/preproc/preproc.py +++ b/pkg/pipeline/preproc/preproc.py @@ -34,7 +34,6 @@ class PreProcessor(stage.PipelineStage): session = await self.ap.sess_mgr.get_session(query) - # 非 local-agent 时,llm_model 为 None llm_model = ( await self.ap.model_mgr.get_model_by_uuid(query.pipeline_config['ai']['local-agent']['model']) @@ -59,7 +58,7 @@ class PreProcessor(stage.PipelineStage): if selected_runner == 'local-agent': query.use_funcs = ( - conversation.use_funcs if query.use_llm_model.model_entity.abilities.__contains__('tool_call') else None + conversation.use_funcs if query.use_llm_model.model_entity.abilities.__contains__('func_call') else None ) query.variables = { @@ -82,7 +81,7 @@ class PreProcessor(stage.PipelineStage): content_list = [] plain_text = '' - qoute_msg = query.pipeline_config["trigger"].get("misc",'').get("combine-quote-message") + qoute_msg = query.pipeline_config['trigger'].get('misc', '').get('combine-quote-message') for me in query.message_chain: if isinstance(me, platform_message.Plain): @@ -100,13 +99,11 @@ class PreProcessor(stage.PipelineStage): content_list.append(llm_entities.ContentElement.from_text(msg.text)) elif isinstance(msg, platform_message.Image): if selected_runner != 'local-agent' or query.use_llm_model.model_entity.abilities.__contains__( - 'vision' + 'vision' ): if msg.base64 is not None: content_list.append(llm_entities.ContentElement.from_image_base64(msg.base64)) - - query.variables['user_message_text'] = plain_text query.user_message = llm_entities.Message(role='user', content=content_list)