SimpleComponent: a lightweight named-span component.
SimpleComponent accepts arbitrary keyword arguments (strings, [CBlock](../../core/base#class-cblock)s, or
[Component](../../core/base#class-component)s) and renders them as a JSON object keyed by the argument names. It is
the go-to component type for ad-hoc prompts that do not require a dedicated
[Component](../../core/base#class-component) subclass or a Jinja2 template.
Classes
CLASS SimpleComponent
A Component that is make up of named spans.
Methods:
FUNC parts
FUNC make_simple_string
<|key|>value</|key|> tagged strings.
Args:
kwargs: Mapping of span names to their[CBlock](../../core/base#class-cblock)or[Component](../../core/base#class-component)values.
- Newline-joined tagged representation of all keyword arguments.
FUNC make_json_string
[CBlock](../../core/base#class-cblock) and
[ModelOutputThunk](../../core/base#class-modeloutputthunk) values use their .value attribute, while
[Component](../../core/base#class-component) values use format_for_llm().
Args:
kwargs: Mapping of span names to[CBlock](../../core/base#class-cblock),[Component](../../core/base#class-component), or[ModelOutputThunk](../../core/base#class-modeloutputthunk)values.
- JSON-encoded representation of the keyword arguments.
FUNC format_for_llm
make_json_string using the stored keyword arguments.
Returns:
- JSON-encoded string of all named spans in this component.