-
Notifications
You must be signed in to change notification settings - Fork 99
agent.input() and /ws endpoint do not support file passing #110
Copy link
Copy link
Open
Description
Problem
The agent.input() method and WebSocket /ws endpoint do not currently support passing files as input.
Context
When hosting agents via agent.host() or using co ai, users can only send text prompts through:
agent.input(prompt)- Python APIPOST /input- HTTP endpoint/ws- WebSocket endpoint
There is no way to pass files (images, documents, data files) to the agent.
Expected Behavior
Users should be able to pass files to agents for processing:
- Vision tasks: Send images for analysis
- Document processing: Upload PDFs, text files
- Data analysis: Pass CSV, JSON files
- Multi-modal inputs: Combine text prompt + file(s)
Current Workaround
Users must:
- Save files to disk first
- Use file path in prompt
- Agent reads via
read_filetool
This doesn't work for remote/hosted agents where client and server have different filesystems.
Suggested Solution
Extend the input protocol to support file attachments:
Python API:
agent.input(
"Analyze this image",
files=[{"path": "screenshot.png", "data": base64_data}]
)HTTP endpoint:
POST /input
Content-Type: multipart/form-data
prompt=Analyze+this+image
[email protected]WebSocket:
{
"type": "input",
"prompt": "Analyze this image",
"files": [{
"name": "screenshot.png",
"data": "base64...",
"mime_type": "image/png"
}]
}Impact
- Cannot use vision models with hosted agents
- Cannot process user-uploaded files in remote sessions
- Limits usefulness of agent hosting feature
Related Components
connectonion/core/agent.py-Agent.input()methodconnectonion/network/host.py- HTTP/WebSocket endpointsconnectonion/cli/co_ai/- co ai relay connections
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels