Supported message roles and content types for callModel() inputs.
Not yet available. The Agent SDK is tracked to be built — today, use the Client SDKs against the live chat completions API. The docs below describe the intended design.
Messages passed to callModel() follow the OpenAI chat format. Each message has a role and content. Content can be a plain string or an array of typed parts for multimodal inputs.
| Role | Use |
|---|---|
system | Sets the model's persona, task context, and constraints. Appears once at the top of the message list. |
user | Input from the human (or from your orchestration layer). |
assistant | A previous model response. Include these to give the model context for multi-turn flows. |
tool | A tool result returned to the model after a tool call. Managed automatically by the SDK; you rarely construct these by hand. |
The simplest form — a plain string:
For vision-capable models, content can be an array of typed parts:
The SDK passes image parts through as-is to the underlying model. Only models with vision capability support image inputs — check the model catalog or filter by capability=vision.
Place the system message first. Pass it once — it does not need to repeat in subsequent turns when using inputItems.
When callModel() executes a tool, it appends a tool_call item and a tool_result item to the item list. These are translated to tool role messages when the SDK sends the next model request — you don't need to construct them yourself.
The maximum total content size per call depends on the model's context window. Check GET /api/models/{slug} for context_window. The SDK does not automatically truncate — if the input exceeds the context window, the request fails with an upstream_error from the provider.