File upload enables agents to process and understand various file types including documents, images, code files, and data formats. By providing files alongside text queries, agents can analyze visual content, extract information from documents, review code, and work with structured data.
This multimodal capability allows agents to go beyond text-only interactions, enabling them to understand and respond to questions about file contents, extract structured data, and combine visual or document context with natural language queries.
Supported File Types
Agents can process a wide variety of file formats:
Supported file types can change depending on the model. Check your model provider’s documentation for specific file type support and limitations.
Non-Streaming
Upload and process files using the files parameter with run() or arun(). Files can be local paths or URLs:
Streaming
Stream responses when processing files using stream() or astream():