ax() API Structured generation APIs. python api api/ax packages/python/axir-api.json api ax() API

ax() API

Structured generation APIs for typed programs.

Most Used

ax

Create an AxGen program from a string or parsed signature.

FieldValue
Kindfunction
Ax conceptax
API sectionAxGen
Formax(signature, options=None)
ReturnsAxGen

Important Options

  • functions
  • examples
  • demos
  • modelConfig
  • maxRetries
  • streaming assertions
  • field processors

Examples

Python
qa = ax("question:string -> answer:string")

Full reference

AxGen

Structured generation program with forward, streaming, optimization, trace, usage, and tool-call behavior.

FieldValue
Kindtype
Ax conceptAxGen
API sectionAxGen
FormAxGen(signature, options=None)
Returnsprogram object

Important Options

  • signature
  • functions
  • examples
  • demos
  • memory
  • prompt template

Full reference

fn

Build a typed function tool. Rust uses tool because fn is reserved.

FieldValue
Kindfunction
Ax conceptfn
API sectionTools
Formfn(name).description(...).arg(...).handler(...).build()
Returnstool builder or Tool

Important Options

  • name
  • description
  • args
  • returns
  • handler

Examples

Python
search = fn("search").description("Search docs").arg("query", f.string()).build()

Full reference

Advanced / internals / full reference

Tool

Callable tool descriptor with JSON-schema-compatible parameters and a host handler.

FieldValue
Kindtype
Ax conceptTool
API sectionTools
FormTool(name, description, parameters, handler)
Returnstool descriptor

Important Options

  • parameters
  • returns
  • handler

Full reference

Full Reference

Open the full Python reference. This page highlights the ax symbols most relevant to everyday use.

Docs