feat: optimize vision tools and image handling

- Add model-aware vision tool loading based on supports_vision flag
- Move view_image_tool from config to builtin tools for dynamic inclusion
- Add timeout to image search to prevent hanging requests
- Optimize image search results format using thumbnails
- Add image validation for reference images in generation
- Improve error handling with detailed messages

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
hetao
2026-01-29 14:57:26 +08:00
parent 2c6dbbe065
commit 314ea41781
5 changed files with 59 additions and 19 deletions

View File

@@ -69,7 +69,7 @@ models:
# api_key: $MOONSHOT_API_KEY
# max_tokens: 32768
# supports_thinking: true
# supports_vision: false # Check your specific model's capabilities
# supports_vision: true # Check your specific model's capabilities
# when_thinking_enabled:
# extra_body:
# thinking:
@@ -112,11 +112,6 @@ tools:
use: src.community.image_search.tools:image_search_tool
max_results: 5
# View image tool (display local images to user)
- name: view_image
group: file:read
use: src.tools.builtins:view_image_tool
# File operations tools
- name: ls
group: file:read