Agent.run(attachment=...) or input_variables={...}. You do not need to call a separate public upload_file() method.
Attachments are useful for document analysis, data extraction, and workflows where the agent needs to process file content.
Method Signature
Parameters
A file-like object opened in binary read mode, or a
File object returned by a lower-level upload flow.Return Value
Agent.run() returns an AgentResponse. For text responses, read response.text. For structured output, read response.structured_output.