You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.6 KiB
1.6 KiB
| name | description |
|---|---|
| fetch-raw-file | Lấy URL download file PDF/XLSX/DOCX gốc theo file_id. Dùng khi user muốn xem hoặc tải file nguồn để kiểm tra nội dung. |
Fetch Raw File URL
Khi nào dùng
- "Cho tôi xem file gốc của tài liệu X"
- "Tôi muốn download PDF này"
- "Link tải file gốc?"
- "Mở file để tôi check lại"
Workflow
- Cần
file_id(integer). Cách lấy:- Từ kết quả
describe_entity(mỗi file cóid). - Từ payload của
search_procurement_docs(chứa file metadata).
- Từ kết quả
- Gọi
fetch_raw_file_url(file_id=<id>). - Xử lý lỗi:
public_base_url not configured→ "Server chưa config public URL, liên hệ admin."file_not_found→ "Không tìm thấy file_id<id>, vui lòng kiểm tra lại."
- Nếu OK: trả URL dạng clickable link kèm
filenamevàcontent_typeđể user biết file gì trước khi click.
Ví dụ
Agent:
→ fetch_raw_file_url(file_id=42)
← {url: "http://100.123.9.15:8000/files/42/raw", filename: "tender.pdf", content_type: "application/pdf"}
Reply: "📄 tender.pdf — PDF, click để download."
Anti-patterns
- ❌ Đừng tự bịa URL — phải gọi tool để lấy URL đúng (URL phụ thuộc cấu hình
PUBLIC_BASE_URLcủa server, không cố định). - ❌ Đừng giấu URL — luôn show để user click được.
- ❌ Đừng gọi tool này nếu user chỉ hỏi nội dung — dùng
search_procurement_docsthay vì. - ❌ Đừng đoán
file_id— phải có từdescribe_entityhoặc search results trước.