Skip to main content

Functions

FUNC to_chat

to_chat(action: Component | CBlock, ctx: Context, formatter: ChatFormatter, system_prompt: str | None) -> list[Chat]
Converts a context and an action into a series of dicts to be passed to apply_chat_template . This function is used by local inference backends.

FUNC to_tool_calls

to_tool_calls(tools: dict[str, Callable], decoded_result: str) -> dict[str, ModelToolCall] | None
Parse a tool call string.