🚀 Try Zilliz Cloud, the fully managed Milvus, for free—experience 10x faster performance! Try Now>>

Milvus
Zilliz
  • Home
  • AI Reference
  • How do you include a document (such as a PDF) or image for DeepResearch to analyze as part of its research?

How do you include a document (such as a PDF) or image for DeepResearch to analyze as part of its research?

To include a document or image for DeepResearch to analyze, you typically use an API endpoint or a developer-focused interface designed to accept file uploads. For example, if the platform provides a REST API, you would send a POST request with the file attached as part of the request body. The exact method depends on the platform’s documentation, but most services support multipart/form-data encoding for uploading files. Authentication is usually handled via API keys or OAuth tokens in the request headers. Supported file formats might include PDFs for documents and PNG/JPEG for images, though this varies by platform. For instance, a developer could use a tool like cURL to test file uploads:

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -F "file=@document.pdf" https://api.deepresearch.com/analyze 

This sends the file to the service, which returns an identifier for tracking the analysis.

Before uploading, you may need to preprocess files to meet platform requirements. For documents like PDFs, ensure text is extractable (not scanned images of text). If a PDF contains images, some services might require OCR (optical character recognition) preprocessing to convert images to machine-readable text. For image files, check resolution and size limits—large files might need resizing. For example, a developer could use a library like PyMuPDF (for PDF text extraction) or Pillow (for image resizing) in Python to prepare files. If the service requires metadata (e.g., tags or context), this might be included as JSON fields alongside the file in the upload request.

After uploading, the file is processed, and the analysis results are accessed via API calls or webhooks. For instance, you might send a GET request using the file identifier returned during upload:

curl -H "Authorization: Bearer YOUR_API_KEY" https://api.deepresearch.com/results/FILE_ID 

If the platform supports batch processing, multiple files can be uploaded and analyzed together. Some services also allow attaching additional parameters, such as specifying analysis modes (e.g., sentiment detection in text or object recognition in images). Error handling is critical: check for HTTP status codes (e.g., 413 for oversized files) and retry failed uploads. Documentation often provides code samples in languages like Python, JavaScript, or Go to streamline integration.

Like the article? Spread the word