- Reference
- Python API
Reference
Python API
Every public name of the avalanche package, by what it is for.
import avalanche as ava
Each group links to the page that explains it.
Workflows
See Workflows.
| Name | What it is |
|---|---|
ava.workflow(fn=None, *, cron, webhook, input, key, output, emits, context, agent_defaults, classifier_defaults) | Declares a workflow |
ava.Workflow | A built workflow. .run(...), .test(...), .key(input) |
ava.input | The run input, or one field: ava.input.field |
a >> b, a & b | Then, and side by side |
ava.Webhook(path=None) | A webhook with a chosen path |
ava.RunHandle | A started run: .result(), .done(), .cancel(), .exception() |
ava.LocalExecutor(max_workers=None) | Runs steps on this machine; the default |
Python steps
See Python steps.
| Name | What it is |
|---|---|
ava.step(fn=None, *, num_returns=1, slug=None, retries=7, on_uncertain="retry", emits=(), integrations=()) | A step |
ava.source(...), ava.dest(...) | The same, named for bringing data in and sending it out |
ava.transform | Another name for ava.step |
ava.BaseInput, ava.BaseContext | Base classes for a run’s input and caller context |
ava.RunContext | run_id, workflow_name, node_slug, metadata, step_key |
ava.Logger() | A logger for the step, used as a parameter default |
ava.File, ava.Workspace | A file and a folder. See Inputs and files. |
Agent steps
See Agent steps.
| Name | What it is |
|---|---|
ava.agent_step(signature, *, runtime=None, tools=(), skills=(), integrations=(), evaluations=None, retries=7, on_uncertain="retry") | An agent step with a function body |
ava.agent.step(signature, inputs=None, slug=None, ...) | An agent step declared inside a workflow |
ava.agent.step.map(signature, *items, ...) | One agent per item |
ava.Signature, ava.InputField, ava.OutputField | The agent’s contract |
ava.Agent | The injected agent. await agent(**inputs) |
ava.agent.AgentResult | .outputs, .trace |
ava.agent.AgentTrace | .header, .turns |
ava.agent.Skill | A skill. Skill.from_dir(path) |
ava.agent.AgentDefaults | The typed form of agent_defaults |
ava.agent.AgentStepError, AgentStepCallError, AgentStepExecutionError, AgentOutputError | Agent step errors |
Runtimes
See Runtimes.
| Name | What it is |
|---|---|
ava.runtimes.PredictRLM(lm, sub_lm, max_iterations=30, max_llm_calls=50, skills, allowed_domains, ...) | The default runtime |
ava.runtimes.ClaudeAgent(model, max_turns, builtin_tools, permission_mode, system_prompt_append, system_prompt_preset, max_budget_usd, narrate=True) | Claude |
ava.runtimes.OpenAIAgent(model, max_turns, builtin_tools, system_prompt_append, narrate=True, tracing=False) | OpenAI |
ava.runtimes.predict_rlm.skills.pdf, .docx, .spreadsheet | PredictRLM’s document skills |
Evaluations
See Evaluations.
| Name | What it is |
|---|---|
ava.Evaluations(metrics, composites, classifier, model, timeout) | The evaluations of one agent step |
ava.Metric(*, state, question) | One question about the step’s output |
ava.EvalContext | What a metric sees: inputs, output, trace |
Classifier steps
See Classifier steps.
| Name | What it is |
|---|---|
ava.classifier_step(*, questions=None, input_model=None, classifier=None, model=None, timeout=None, slug=None, retries=7, on_uncertain="retry") | A classifier step |
ava.Classifier | The injected classifier. await classifier(state=..., questions=None) |
ava.ClassificationResult | .choices, .nouls, .scores, .answers, .model, .usage |
ava.classifiers.TypeSafe(), OpenAIDecisions(), GeminiDecision() | The providers |
ava.ClassifierStepError, ava.ClassifierStepExecutionError | Classifier step errors |
State machines
See State machines.
| Name | What it is |
|---|---|
ava.machine(*, input, key, cron=None, webhook=None) | Declares a state machine |
ava.state(work, *, initial=False, final=False, defer=()) | A state |
state.on(name, *, payload=None) >> target | A transition on an event |
state.after(delay) >> target | A transition on a timer |
ava.event(name, output), ava.Event | An event returned by a step; the base class of decision outcomes |
ava.Machine | A built machine. .send(...), .key(input), .test(input) |
Orchestration
See Control flow, Retries, Waits and Approvals.
| Name | What it is |
|---|---|
step.map(*items, max_items=None, fail_fast=True, **shared) | Run a step once per item |
ava.DEFAULT_MAX_ITEMS, ava.HARD_CAP | 8 and 64 |
ava.MapItemsFailed, ava.MapItemFailure | Raised when map items fail |
ava.skip(reason=None), ava.StepSkipped | End a step as skipped |
ava.call(target, input=None, *, timeout=None, when=True) | Run another workflow and wait for its result |
ava.start_run(target, input=None, *, when=True), ava.RunStart | Start another workflow without waiting |
ava.NonRetryableError | Fail a step without retrying |
ava.OutcomeUnknownError | Report that an action may or may not have happened |
ava.Rerun(run_id, start, mode="autorun") | Describes a rerun from given steps |
ava.sleep(duration=None, *, until=None, slug=None) | Wait for time |
ava.wait_for_event(model, *, key, timeout, slug=None) | Wait for an event |
ava.decision(outcome, *, prompt, timeout, show=None, on_timeout=None, assignees=None, approvers=None, slug=None) | Wait for a person |
ava.decision.map(outcome, items, *, prompt, timeout, ...) | One decision per item |
Integrations
See Integrations.
| Name | What it is |
|---|---|
ava.Connector | Base class for your own API |
ava.tool | Marks a connector method as a tool |
ava.ApiKey(header, prefix=""), ava.OAuth2(*, authorize_url, token_url, scopes=(), ...) | How a connector signs in |
ava.Client | The HTTP client behind self.client |
ava.MCP(name, *, url=None, command=None, allow=None, ...) | An MCP server |
For platform builders
Names used to run Avalanche inside another system. Most projects never touch them.
| Name | What it is |
|---|---|
ava.Executor, ava.get_default_executor | The executor interface |
ava.ExecutionServices, ExecutionServicesSpec, ExecutionTaskSpec, ExecutionServiceReceipt, EXECUTION_SERVICES_V1 | Hooks around each step’s execution |
ava.ReferenceBinder, LocalReferenceBinder, rebind_arguments, file_reference_context | How file references are resolved |
ava.MachineHost, MachineInstance, MachineEventReceipt | The host side of state machines |
ava.PROTOCOL_VERSION, ava.ProtocolVersion | The SDK’s protocol version |
ava.Json | Marks a model field as JSON |
