yera.models.context.base

Module containing the base class for all model contexts.

Symbols

class BaseModelContext — The abstract base class for all model context classes.

BaseModelContext

Inherits: ABC
Subclasses: LLMContext

The abstract base class for all model context classes.

Implementations must implement a method that gets the current value in a context var. This is used to manage a stack of model contexts.

Methods

__enter__ — Enter the model context and make it the active one.
__exit__ — Exit the model context and return to the previous context value.

BaseModelContext.__enter__

__enter__() → None

Enter the model context and make it the active one.

BaseModelContext.__exit__

__exit__(
    exc_type: type[BaseException] | None,
    exc_val: BaseException | None,
    exc_tb: TracebackType | None,
)

Exit the model context and return to the previous context value.