2026-01-16 21:48:00 +08:00
|
|
|
from langchain.tools import tool
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@tool("present_files", parse_docstring=True)
|
|
|
|
|
def present_file_tool(filepaths: list[str]) -> str:
|
|
|
|
|
"""Make files visible to the user for viewing and rendering in the client interface.
|
|
|
|
|
|
|
|
|
|
When to use the present_files tool:
|
|
|
|
|
|
|
|
|
|
- Making any file available for the user to view, download, or interact with
|
|
|
|
|
- Presenting multiple related files at once
|
2026-01-16 22:10:08 +08:00
|
|
|
- After creating files that should be presented to the user
|
2026-01-16 21:48:00 +08:00
|
|
|
|
|
|
|
|
When NOT to use the present_files tool:
|
|
|
|
|
- When you only need to read file contents for your own processing
|
|
|
|
|
- For temporary or intermediate files not meant for user viewing
|
|
|
|
|
|
2026-01-16 22:10:08 +08:00
|
|
|
Notes:
|
|
|
|
|
- You should call this tool after creating files and moving them to the `/mnt/user-data/outputs` directory.
|
|
|
|
|
- Use non-parallel tool calling to present files in a single step.
|
|
|
|
|
|
2026-01-16 21:48:00 +08:00
|
|
|
Args:
|
|
|
|
|
filepaths: List of absolute file paths to present to the user. **Only** files in `/mnt/user-data/outputs` can be presented.
|
|
|
|
|
"""
|
|
|
|
|
return "OK"
|