File tree Expand file tree Collapse file tree
pipeline/process_stage/method/agent_sub_stages Expand file tree Collapse file tree Original file line number Diff line number Diff line change 103103 "fallback_chat_models" : [],
104104 "default_image_caption_provider_id" : "" ,
105105 "image_caption_prompt" : "Please describe the image using Chinese." ,
106+ "image_caption_wait_for_context_order" : True ,
106107 "provider_pool" : ["*" ], # "*" 表示使用所有可用的提供者
107108 "wake_prefix" : "" ,
108109 "web_search" : False ,
@@ -2979,6 +2980,11 @@ class ChatProviderTemplate(TypedDict):
29792980 "_special" : "select_provider" ,
29802981 "hint" : "留空代表不使用,可用于非多模态模型" ,
29812982 },
2983+ "provider_settings.image_caption_wait_for_context_order" : {
2984+ "description" : "图片转述时等待上下文顺序" ,
2985+ "type" : "bool" ,
2986+ "hint" : "开启后,同一会话中图片转述完成前,后续消息将等待,以保证上下文顺序正确;关闭后,后续消息立即响应,但上下文中图片描述可能在后续消息之后。" ,
2987+ },
29822988 "provider_stt_settings.enable" : {
29832989 "description" : "启用语音转文本" ,
29842990 "type" : "bool" ,
Original file line number Diff line number Diff line change @@ -188,9 +188,12 @@ async def process(
188188 await call_event_hook (event , EventType .OnWaitingLLMRequestEvent )
189189
190190 if not event .get_extra ("provider_request" ):
191- await pre_caption_images (
192- event , self .ctx .plugin_manager .context
193- )
191+ plugin_context = self .ctx .plugin_manager .context
192+ cfg = plugin_context .get_config (
193+ umo = event .unified_msg_origin
194+ ).get ("provider_settings" , {})
195+ if cfg .get ("image_caption_wait_for_context_order" , True ):
196+ await pre_caption_images (event , plugin_context )
194197
195198 async with session_lock_manager .acquire_lock (event .unified_msg_origin ):
196199 logger .debug ("acquired session lock for llm request" )
You can’t perform that action at this time.
0 commit comments