WeKnora/internal/agent/tools
ochan.kwon b291381cc2 feat: auto-describe MCP tool result images via VLM
When an MCP tool returns image content items, the agent engine now
automatically generates text descriptions using the configured VLM
model and appends them to the tool result message. This makes image
content accessible to LLMs that receive tool results as text.

Images are not passed directly to the LLM because Chat Completions API
does not reliably support images in tool role messages across providers
(tested: gpt-5.4 silently ignores them, Qwen3.5 processes them).

Changes:
- Add Images field to ToolResult for preserving base64 data URIs
- Add extractContentAndImages() with MIME whitelist, size/count limits
- Add ImageDescriberFunc injection to AgentEngine (no vlm package dep)
- Add describeImages() with graceful error handling and ctx cancellation
- Add VLM model injection in CreateAgentEngine (same pattern as
  SetAppConfig/SetSkillsManager)
- Redact image base64 from Data map to prevent log/SSE exposure
2026-03-25 21:38:15 +08:00
..
data_analysis.go feat: use language-neutral English prompts for multilingual LLM responses 2026-03-06 21:08:12 +08:00
data_schema.go feat: add organization management features 2026-02-09 11:40:25 +08:00
database_query.go feat: use language-neutral English prompts for multilingual LLM responses 2026-03-06 21:08:12 +08:00
definitions.go feat: implement final_answer tool and enhance agent duration tracking 2026-03-09 11:46:56 +08:00
final_answer.go feat: implement final_answer tool and enhance agent duration tracking 2026-03-09 11:46:56 +08:00
get_document_info.go refactor(agent): streamline document info retrieval and enhance chunk search logic 2026-03-19 18:20:09 +08:00
grep_chunks.go refactor(agent): streamline document info retrieval and enhance chunk search logic 2026-03-19 18:20:09 +08:00
knowledge_search.go feat: enhance knowledge search by resolving embedding model keys 2026-03-13 20:54:25 +08:00
list_knowledge_chunks.go feat: use language-neutral English prompts for multilingual LLM responses 2026-03-06 21:08:12 +08:00
mcp_tool.go feat: auto-describe MCP tool result images via VLM 2026-03-25 21:38:15 +08:00
mcp_tool_image_test.go feat: auto-describe MCP tool result images via VLM 2026-03-25 21:38:15 +08:00
query_knowledge_graph.go feat: use language-neutral English prompts for multilingual LLM responses 2026-03-06 21:08:12 +08:00
registry.go feat: enhance MCP tool name and description handling for security 2026-02-06 19:55:29 +08:00
sequentialthinking.go feat: implement final_answer tool and enhance agent duration tracking 2026-03-09 11:46:56 +08:00
skill_execute.go feat: optimize security and deployment of agent skills 2026-02-04 20:08:49 +08:00
skill_read.go feat: support agent skills 2026-02-04 20:08:49 +08:00
todo_write.go feat: use language-neutral English prompts for multilingual LLM responses 2026-03-06 21:08:12 +08:00
tool.go feat: use language-neutral English prompts for multilingual LLM responses 2026-03-06 21:08:12 +08:00
web_fetch.go feat: use language-neutral English prompts for multilingual LLM responses 2026-03-06 21:08:12 +08:00
web_search.go feat: Add DataSchema tool for retrieving schema information from CSV and Excel files 2025-12-29 20:03:51 +08:00