The core agent primitive — runs one turn, handles tool calls, and returns the updated item list.
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 API.
callModel() is the central primitive in the OpenDunes Agent SDK. It sends messages to the model, handles streaming, dispatches any tool calls the model makes, collects tool results, and returns the complete updated item list ready for the next turn. You call it in a loop; the SDK handles everything inside each turn.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model slug (provider/model). See Models. |
messages | Message[] | Yes (first turn) | New user input for this turn. Prior-turn history goes in inputItems. |
inputItems | Item[] | Multi-turn | Item list returned by the previous callModel() call. |
tools | Tool[] | No | Tools available to the model this turn. |
stopConditions | StopCondition[] | No | Conditions that end the loop. See Stop Conditions. |
dynamicParams | (items: Item[]) => Params | No | Function that returns updated parameters based on item history. See Dynamic Parameters. |
stream | boolean | No | Stream the response. Default false. |
maxTokens | number | No | Token limit for this turn. |
temperature | number | No | Sampling temperature (0–2). |
callModel() returns a TurnResult: