ifunctionstrategy¶
Function Strategy Interface
IFunctionStrategy (Protocol)
dataclass
¶
Function Strategy Interface.
Source code in oteapi/interfaces/ifunctionstrategy.py
@dataclass # type: ignore[misc]
class IFunctionStrategy(Protocol):
"""Function Strategy Interface."""
function_config: "FunctionConfig"
def get(self, session: "Optional[Dict[str, Any]]" = None) -> "SessionUpdate":
"""Execute the strategy.
Parameters:
session: A session-specific dictionary context.
Returns:
An update model of key/value-pairs to be stored in the
session-specific context from services.
"""
def initialize(self, session: "Optional[Dict[str, Any]]" = None) -> "SessionUpdate":
"""Initialize data class.
This method will be called through the `/initialize` endpoint of the OTE-API
Services.
Parameters:
session: A session-specific dictionary context.
Returns:
An update model of key/value-pairs to be stored in the
session-specific context from services.
"""
get(self, session=None)
¶
Execute the strategy.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session |
Optional[Dict[str, Any]] |
A session-specific dictionary context. |
None |
Returns:
Type | Description |
---|---|
SessionUpdate |
An update model of key/value-pairs to be stored in the session-specific context from services. |
Source code in oteapi/interfaces/ifunctionstrategy.py
def get(self, session: "Optional[Dict[str, Any]]" = None) -> "SessionUpdate":
"""Execute the strategy.
Parameters:
session: A session-specific dictionary context.
Returns:
An update model of key/value-pairs to be stored in the
session-specific context from services.
"""
initialize(self, session=None)
¶
Initialize data class.
This method will be called through the /initialize
endpoint of the OTE-API
Services.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session |
Optional[Dict[str, Any]] |
A session-specific dictionary context. |
None |
Returns:
Type | Description |
---|---|
SessionUpdate |
An update model of key/value-pairs to be stored in the session-specific context from services. |
Source code in oteapi/interfaces/ifunctionstrategy.py
def initialize(self, session: "Optional[Dict[str, Any]]" = None) -> "SessionUpdate":
"""Initialize data class.
This method will be called through the `/initialize` endpoint of the OTE-API
Services.
Parameters:
session: A session-specific dictionary context.
Returns:
An update model of key/value-pairs to be stored in the
session-specific context from services.
"""