yera.models.context_factory.base
Module containing the base class for all module factories.
Symbols
BaseModelContextFactory
Inherits:
ABC, Generic[C, N]Subclasses:
LLMContextFactoryThe base model context factory class.
Model context factories build model contexts based on the information in a model config object and a provider connection config object.
Inheritors must implement call which will return a model context of some model type. This will also allow keyword arguments that override the model's inference and other parameters.
Methods
BaseModelContextFactory.__init__
__init__(
config: C,
connection: N,
)Initialize a factory from model and provider connection configuration.
Parameters
config
type: C
Model configuration supplied to each context the factory builds.
connection
type: N
Provider connection used by the model interface.
BaseModelContextFactory.__call__
__call__(
**kwargs,
) → BaseModelContextBuild a model context with optional inference overrides.
Parameters
**kwargs
type: str | int | float | bool
Per-context inference overrides.
Returns
type: BaseModelContext
A context configured for this factory's model and connection.