to_chat, which converts a [Context](../core/base#class-context) and a [Component](../core/base#class-component) action into
the list of role/content dicts expected by apply_chat_template; and
to_tool_calls, which parses a raw model output string into validated
[ModelToolCall](../core/base#class-modeltoolcall) objects. These helpers are consumed internally by all
[FormatterBackend](backend#class-formatterbackend) subclasses.
Functions
FUNC get_value
obj: Dict or objectkey: Key or attribute name
- Value if found, None otherwise
FUNC to_chat
action: The next component or CBlock to generate output for.ctx: The current conversation context.formatter: The chat formatter used to convert context and action to messages.system_prompt: Optional system prompt to prepend; overrides any system message in the context.
- List of role/content dicts suitable for
apply_chat_template.
FUNC to_tool_calls
tools: Mapping of tool name to the correspondingAbstractMelleaToolobject.decoded_result: Raw model output string that may contain tool call markup.
- Dict mapping tool name to validated
[ModelToolCall](../core/base#class-modeltoolcall), orNoneif no tool calls were found.