Context
ContextProvider
¶
A class that provides a context store.
Source code in src/refiners/fluxion/context.py
create
staticmethod
¶
create(contexts: Contexts) -> ContextProvider
Create a ContextProvider from a dict of contexts.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
contexts
|
Contexts
|
The contexts. |
required |
Returns:
Type | Description |
---|---|
ContextProvider
|
A ContextProvider with the contexts. |
Source code in src/refiners/fluxion/context.py
get_context
¶
set_context
¶
set_context(key: str, value: Context) -> None
Store a value in the context.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The key of the context. |
required |
value
|
Context
|
The context. |
required |
update_contexts
¶
Update or set the contexts with new contexts.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
new_contexts
|
Contexts
|
The new contexts. |
required |