Skip to main content

Classes

CLASS ChatContext

Initializes a chat context with unbounded window_size and is_chat=True by default.
Methods:

FUNC add

add(self, c: Component | CBlock) -> ChatContext
Add a new component/cblock to the context. Returns the new context.

FUNC view_for_generation

view_for_generation(self) -> list[Component | CBlock] | None
Returns the context in a linearized form. Uses the window_size set during initialization.

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: Component | CBlock) -> SimpleContext
Add a new component/cblock to the context. Returns the new context.

FUNC view_for_generation

view_for_generation(self) -> list[Component | CBlock] | None
Returns an empty list.