mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-11-11 08:12:25 +00:00
The document_query tool logs its message as its own `document_query` type with an `icon://manage_search Querying: <document>` headline when queries are supplied and `Reading: <document>` without them, naming the first document and appending `+ N more` for multi-document queries. A plugin message handler renders it as a DOC badge with blue and blue-violet accents across modes, each clearly bluer than the a2a chat family so document queries read like the other dedicated tool surfaces. Agent-facing failure messages render from plugin prompt files, and the Q&A answer streams into the tool log while the model writes it; helpers built without the streaming callback still answer without streaming. Regression tests cover the log entry, headline words, and empty-query reading mode. Validation: pytest tests/test_document_query_tool_ui.py tests/test_document_query_fallback.py
1.8 KiB
1.8 KiB
Document Query Plugin DOX
Purpose
- Own document loading, parsing, indexing, and Q&A over local and remote documents.
Ownership
tools/document_query.pyowns the agent-facing query tool.- The tool logs its message as type
document_querywith anicon://manage_search Querying: <document>headline when queries are supplied andReading: <document>without them, naming the first file and appending+ N morefor multiple documents;extensions/webui/get_message_handler/owns theDOCbadge presentation andextensions/webui/get_process_step_types/registers the type. - Agent-facing error messages render from
prompts/fw.document_query.*.md, and the Q&A answer streams into the tool log while the model writes it. helpers/owns fetching, parser routing, indexing, and query orchestration.prompts/owns document-query tool and optimization prompts.hooks.py,default_config.yaml,plugin.yaml,skills/,extensions/, andwebui/own dependency bootstrap, settings, metadata, skill guidance, hooks, and UI.
Local Contracts
- Respect configured size, timeout, retry, parser concurrency, and OCR limits.
- Fetch local and remote resources safely and avoid leaking document contents beyond intended prompt/tool use.
- Keep optional dependency installation targeted to the framework runtime.
Work Guidance
- Coordinate parser changes with timeout handling and fallback behavior.
- Keep prompt and skill guidance clear that image files, screenshots, scans, charts, photos, and diagrams should go to vision tools first when available;
document_queryimage OCR is a text-focused fallback when vision is unavailable or cannot read the needed text.
Verification
- Smoke-test representative PDF, text/HTML, image/OCR, and remote-document queries after parser changes.
Child DOX Index
No child DOX files.