For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
max.pipelines.context.BaseContextType
BaseContextType
max.pipelines.context.BaseContextType = ~BaseContextType
Type variable for generic programming with BaseContext implementations.
This TypeVar is bound to BaseContext, meaning it can represent any type that
implements the BaseContext protocol. It enables type-safe generic functions
and classes that work with any BaseContext subtype while preserving the
specific type information through the type system.
from max.pipelines.context.context import BaseContextType
def process_context(context: BaseContextType) -> BaseContextType:
# Function that accepts any BaseContext implementation
# and returns the same type
return context