Skip to main content
Version: 0.8.0

mellea.stdlib.context.simple

Stateless single-turn context (no history is forwarded to the model).

Classes​

CLASS SimpleContext ​

A SimpleContext is a context in which each interaction is a separate and independent turn. The history of all previous turns is NOT saved..

Methods:

FUNC add ​

add(self, c: Span) -> Self

Add a new component or CBlock to the context and return the updated context.

Args:

  • c: The component, content block, or model output to record.

Returns:

  • A new context of the same concrete subtype containing only the
  • added entry; prior history is not retained. Returning Self (not the
  • hard-coded SimpleContext) keeps a subclass statically its own type.

FUNC view_for_generation ​

view_for_generation(self) -> list[Span] | None

Return an empty list, since SimpleContext does not pass history to the model.

Each call to the model is treated as a stateless, independent exchange. No prior turns are forwarded.

Returns:

  • list[Span] | None: Always an empty list.