createBackend

fun createBackend(apiKey: String, tools: List<AgentTool> = BuiltinTools, approver: ToolApprover = ToolApprover.AlwaysApprove, headers: Map<String, String> = emptyMap(), instructions: String = "", agUiEventLog: AgUiEventLog? = null): ChatBackend(source)

The backend for this profile.

Parameters

tools

on-device tools: run by on-device loops, advertised to AG-UI servers as frontend tools, and executed for AI SDK servers that hand a call to the client.

instructions

extra guidance (e.g. dev.ai.elements.core.agent.Capability instructions): appended to the system prompt of on-device loops and sent to AG-UI servers as context.

agUiEventLog

where an AG-UI backend keeps its event log, for replays (AgUiEventLog).