# Python authoring API

> Generated signatures for Python flow and inference builders.

[Read in the browser](https://aqvenstudio.com/reference/authoring-api/)

<!-- Generated by tools/generate_reference.py. Do not edit this file by hand. -->

Import these helpers from `aqven.spec`. [How to write a step in Python](/engine/code-node/) shows complete files and when to use them.

## In

`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'`

## Out

`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'`

## inference_spec

`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'`

## llm

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

## code

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

## tool

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

## flow

`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'`

## describe_annotation

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

## Inference

`class Inference` · `aqven.spec.builder`

## Flow

`class Flow` · `aqven.spec.builder`

| Field | Type |
| --- | --- |
| `spec` | `<class 'aqven.spec.flow.FlowSpec'>` |
| `nodes` | `collections.abc.Mapping[aqven.spec.names.NodeId, NodeSpec]` |

## BuiltNode

`class BuiltNode` · `aqven.spec.builder`

## BuilderError

`class BuilderError` · `aqven.spec.builder`
