myagent-ai 1.16.19 → 1.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -701,9 +701,15 @@ class MainAgent(BaseAgent):
701
701
  )
702
702
  break
703
703
 
704
- # [v1.16.13] 特殊处理模型不支持图片输入 — 去掉图片用纯文本重试
705
- _vision_keywords = ["doesn't support image", "does not support image", "model_incompatible", "image input", "not support vision", "unsupported multimodal", "image capability"]
706
- if any(kw in _llm_error.lower() for kw in _vision_keywords) and context.metadata.get("user_images"):
704
+ # [v1.16.13→17.0] 特殊处理模型不支持图片输入 — 去掉图片用纯文本重试
705
+ # 支持中英文错误关键词匹配(ModelScope 等国产 API 可能返回中文错误)
706
+ _vision_keywords = [
707
+ "doesn't support image", "does not support image", "model_incompatible",
708
+ "image input", "not support vision", "unsupported multimodal", "image capability",
709
+ "不支持图片", "不支持图像", "图片输入", "图像输入", "不支持多模态",
710
+ "视觉", "image_url", "multimodal", "vision",
711
+ ]
712
+ if any(kw.lower() in _llm_error.lower() for kw in _vision_keywords) and context.metadata.get("user_images"):
707
713
  logger.warning(f"[{task_id}] 模型不支持图片输入,去掉图片用纯文本重试")
708
714
  context.metadata["user_images"] = []
709
715
  # 用纯文本消息替换最后一条多模态消息
package/config.py CHANGED
@@ -316,8 +316,21 @@ class ConfigManager:
316
316
  elif isinstance(value, list) and key == "models_library":
317
317
  models = []
318
318
  for item in value:
319
+ # [v1.17.0] 兼容 "input" → "input_modes" 字段映射
320
+ # 用户配置中常使用 "input": ["text", "image"],内部字段名是 "input_modes"
321
+ normalized = dict(item)
322
+ if "input" in normalized and "input_modes" not in normalized:
323
+ normalized["input_modes"] = normalized.pop("input")
324
+ if "baseUrl" in normalized and "base_url" not in normalized:
325
+ normalized["base_url"] = normalized.pop("baseUrl")
326
+ if "apiKey" in normalized and "api_key" not in normalized:
327
+ normalized["api_key"] = normalized.pop("apiKey")
328
+ if "reasoning" in normalized:
329
+ # 确保 reasoning 是 bool 类型
330
+ v = normalized["reasoning"]
331
+ normalized["reasoning"] = bool(v) if not isinstance(v, bool) else v
319
332
  me = ModelEntry(**{
320
- k: v for k, v in item.items() if k in ModelEntry.__dataclass_fields__
333
+ k: v for k, v in normalized.items() if k in ModelEntry.__dataclass_fields__
321
334
  })
322
335
  models.append(me)
323
336
  setattr(target, key, models)
@@ -110,6 +110,10 @@ DEPENDENCIES: List[DepInfo] = [
110
110
  note="鼠标/键盘控制 (~500KB)"),
111
111
  DepInfo("pygetwindow", "pygetwindow", "0.0.9", "gui", "windows_macos",
112
112
  note="窗口管理 (仅 Windows/macOS)"),
113
+
114
+ # ── 远程桌面 (VNC) [v1.17.0] ──
115
+ # VNC 依赖通过 apt 安装 (xvfb, x11vnc),websockify 通过 pip 安装
116
+ # 实际检测和安装在 VNCManager.ensure_dependencies() 中完成
113
117
  ]
114
118
 
115
119