feat: add view_image tool and optimize web fetch tools

Add image viewing capability for vision-enabled models with ViewImageMiddleware and view_image_tool. Limit web_fetch tool output to 4096 characters to prevent excessive content. Update model config to support vision capability flag.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
hetao
2026-01-29 13:44:04 +08:00
parent d77e7c32b2
commit 7414947cc6
12 changed files with 390 additions and 13 deletions
+1 -1
View File
@@ -70,4 +70,4 @@ def web_fetch_tool(url: str) -> str:
except Exception as e:
return f"Error: {str(e)}"
return f"# {title}\n\n{markdown_content}"
return f"# {title}\n\n{markdown_content[:4096]}"