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

ax() API

Structured generation APIs for typed programs.

Most Used

axllm.NewAx

Create an AxGen program from a string or parsed signature.

FieldValue
Kindfunction
Ax conceptax
API sectionAxGen
Formaxllm.NewAx(signature, options)
ReturnsAxGen

Important Options

  • functions
  • examples
  • demos
  • sample count
  • result picker
  • modelConfig
  • maxRetries
  • streaming assertions
  • field processors
  • control
  • asyncMode

Examples

Go
qa := axllm.NewAx("question:string -> answer:string", nil)

Full reference

axllm.AxGen

Structured generation program with indexed multi-sampling, winner selection, forward, streaming, optimization, trace, usage, and tool-call behavior.

FieldValue
Kindtype
Ax conceptAxGen
API sectionAxGen
Formaxllm.NewGen(signature, options)
Returnsprogram object

Important Options

  • signature
  • functions
  • examples
  • demos
  • sample count
  • result picker
  • memory
  • prompt template

Full reference

axllm.Fn

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

FieldValue
Kindfunction
Ax conceptfn
API sectionTools
Formaxllm.Fn(name).Description(...).Arg(...).Handler(...)
ReturnsTool

Important Options

  • name
  • description
  • args
  • returns
  • handler
  • execution: blocking or background
  • cancellation-aware handler

Examples

Go
search := axllm.Fn("search").Description("Search docs")

Full reference

Advanced / internals / full reference

axllm.RunControl

Create a controller for scoped steering, reasoning updates, cancellation, and queued/applied lifecycle events. Pass it through forward options.

FieldValue
Kindfunction
Ax conceptrun_control
API sectionAxGen
Formaxllm.RunControl()
ReturnsAxRunControl

Examples

Go
control := axllm.RunControl()

Full reference

axllm.AxRunControl

Run control shared by active and future descendant programs. Cancellation reports unresolved work and does not undo external effects.

FieldValue
Kindtype
Ax conceptAxRunControl
API sectionAxGen
Formaxllm.AxRunControl
Returnsrun controller

Important Options

  • steer
  • thinking token budget
  • target path
  • abort
  • event listener

Full reference

axllm.Tool

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

FieldValue
Kindtype
Ax conceptTool
API sectionTools
Formaxllm.Tool
Returnstool descriptor

Important Options

  • parameters
  • returns
  • handler

Full reference

Full Reference

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

Docs