What is supported
Any Python 3.11 or 3.12 code. A function is what Onecortex calls when the object is not a framework it recognises, so it is also how you deploy an agent on a framework not listed here, such as AutoGen or Pydantic AI: wrap its run call.A complete agent
agent.yml
requirements.txt
agent.py
A complete A Python function example
echo: The quickstart’s agent: one tool call of its own, then a reply, with no dependencies.The prompt and the reply
The function receives the prompt. What it may be:
Declare a second positional parameter to receive the session ID:
def agent(prompt, session_id). Declare a parameter named request to receive the whole request: {"prompt", "sessionId", "params", "surface", "messages"}.
Events it reports
See Streaming and events.
The caller’s fields
Inrequest["params"], for a function that declares request:
Report tool calls and steps
Yield event dicts alongside your text, and they reach every caller as real events:v is filled in for you, and Onecortex adds the closing done. A dict that is not a valid event ends the run with Your agent yielded an event Onecortex cannot read: and the field that is wrong.
Known limits
- A dict with a
typekey is always read as an event. Yield a string, or JSON text, to send data that has atypefield.
Troubleshooting
More on Troubleshooting and Errors.