Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion astrbot/core/tools/computer_tools/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _decode_escaped_text(value: str) -> str:
@dataclass
class FileReadTool(FunctionTool):
name: str = "astrbot_file_read_tool"
description: str = "read file content."
description: str = "read file content. Supports text, image (OCR), and PDF (text extraction) files."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The updated description is a good improvement for discoverability, but it can be more accurate:

  1. DOCX Support: The implementation in read_file_tool_result (via _parse_local_supported_document in astrbot/core/computer/file_read_utils.py) also supports .docx files using MarkitdownParser, which should be mentioned.
  2. Image Handling: The tool returns the image as ImageContent rather than performing OCR itself. While the LLM might perform OCR on the returned image, saying "image (OCR)" might be slightly misleading about the tool's direct output.
  3. Runtime Limitation: Note that PDF and DOCX text extraction is currently only implemented for the local runtime. In sandbox mode, these files are detected as binary and the tool returns an error.

Consider updating the description to include DOCX and clarify the capabilities.

Suggested change
description: str = "read file content. Supports text, image (OCR), and PDF (text extraction) files."
description: str = "read file content. Supports text, images, and documents (PDF, DOCX text extraction)."

parameters: dict = field(
default_factory=lambda: {
"type": "object",
Expand Down
Loading