Skip to content

Python authoring API

Generated signatures for Python flow and inference builders.

Import these helpers from aqven.spec. How to write a step in Python shows complete files and when to use them.

def In(*, description: 'str', max_length: 'int | None' = None, max_items: 'int | None' = None, minimum: 'float | None' = None, maximum: 'float | None' = None, pattern: 'str | None' = None) -> 'Any'

def Out(*, description: 'str', max_length: 'int | None' = None, max_items: 'int | None' = None, minimum: 'float | None' = None, maximum: 'float | None' = None, pattern: 'str | None' = None) -> 'Any'

def inference_spec(model: 'type[Inference]', *, description: 'str', prompt: 'str | None' = None, variants: 'Mapping[str, VariantSlot] | None' = None, allowed_sets: 'Sequence[AllowedSetSpec]' = (), examples: 'Sequence[ExampleSpec]' = (), checks: 'Sequence[CheckSpec]' = ()) -> 'InferenceSpec'

def llm(node_id: 'str', *, inference: 'str', agent: 'str', bind: 'Mapping[str, str]', description: 'str') -> 'LlmNode'

def code(node_id: 'str', fn: 'Callable[..., BaseModel]', *, bind: 'Mapping[str, str]', description: 'str') -> 'CodeNode'

def tool(node_id: 'str', *, tool: 'str', bind: 'Mapping[str, str]', description: 'str') -> 'ToolNode'

def flow(*, description: 'str', input: 'type[BaseModel]', output: 'type[BaseModel]', returns: 'Mapping[str, str]', nodes: 'Sequence[BuiltNode[NodeBase]]', context: 'Sequence[RunContextKey]' = (), limits: 'Limits | None' = None) -> 'Flow'

def describe_annotation(annotation: 'object') -> 'tuple[TypeRef, Mapping[str, JsonValue]]'

class Inference · aqven.spec.builder

class Flow · aqven.spec.builder

FieldType
spec<class 'aqven.spec.flow.FlowSpec'>
nodescollections.abc.Mapping[aqven.spec.names.NodeId, NodeSpec]

class BuiltNode · aqven.spec.builder

class BuilderError · aqven.spec.builder