aiq.runtime.runner#

Attributes#

Classes#

UserManagerBase

AIQRunnerState

Create a collection of name/value pairs.

AIQRunner

The AIQRunner class is used to run a workflow. It handles converting input and output data types and running the

Module Contents#

logger#
class UserManagerBase#
class AIQRunnerState(*args, **kwds)#

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

    >>> Color.RED
    <Color.RED: 1>
    
  • value lookup:

    >>> Color(1)
    <Color.RED: 1>
    
  • name lookup:

    >>> Color['RED']
    <Color.RED: 1>
    

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

UNINITIALIZED = 0#
INITIALIZED = 1#
RUNNING = 2#
COMPLETED = 3#
FAILED = 4#
_T#
class AIQRunner(
input_message: Any,
entry_fn: aiq.builder.function.Function,
context_state: aiq.builder.context.AIQContextState,
)#

The AIQRunner class is used to run a workflow. It handles converting input and output data types and running the workflow with the specified concurrency.

Parameters#

input_messagetyping.Any

The input message to the workflow

entry_fnFunction

The entry function to the workflow

context_stateAIQContextState

The context state to use

_entry_fn#
_context_state#
_context#
_state#
_input_message_token = None#
_input_message#
_span_manager#
property context: aiq.builder.context.AIQContext#
convert(value: Any, to_type: type[_T]) _T#
async result() Any#
async result(to_type: type[_T]) _T
async result_stream(to_type: type | None = None)#