Public examples live under src/examples/<language>/<group>/ and are generated
from each file's ax-example metadata header. Every public example calls a real
provider API and may require environment variables from the repo .env.
The public catalog currently requires beginner, intermediate, and advanced
examples for each language in generation, short-agents, long-agents,
flows, optimization, and audio. The long-agents group holds the
flagship DSPy+RLM+Peek agents (large context, native tools at scale, and skills
- memory) in all six languages. Add
story: <number>to a header only when the example should appear in the website Advanced Start path.
List the current catalog:
npm run example -- list
npm run example -- list --jsonRun an example from the repo root:
npm run example -- typescript src/examples/typescript/generation/axgen-openai.ts
npm run example -- python src/examples/python/generation/axgen-openai.py
npm run example -- java src/examples/java/generation/BasicGenerationExample.java
npm run example -- cpp src/examples/cpp/generation/basic_generation.cpp
npm run example -- go src/examples/go/generation/basic_generation.go
npm run example -- rust src/examples/rust/generation/basic_generation.rsInternal generated package fixtures remain under packages/<language>/examples
for AxIR verification, but they are not part of the public examples catalog.
| Example | Purpose |
|---|---|
| typesafe.ts | Boolean/class signatures, criteria, and provider-level trueThreshold |
| typesafe-native.ts | Native Noul/Choice/Score, structured criteria, probabilities, and model discovery |
| typesafe-hybrid.ts | Typesafe decisions followed by a generative summary |
| value-descriptions.ts | One described signature through Typesafe and OpenAI |
Run from the repo root with npm run tsx followed by the example path. The
first two require TYPESAFE_API_KEY or TYPESAFE_APIKEY in .env; the last two
also require OPENAI_API_KEY or OPENAI_APIKEY. See the
Typesafe/Jev skill for supported outputs,
native-only scoring, and question design.
Typesafe/Jev examples are available in every language’s generation directory:
signature decisions with trueThreshold, native rich criteria and Score, and an
explicit two-program hybrid reply. Set TYPESAFE_APIKEY; hybrid examples also need
OPENAI_API_KEY or OPENAI_APIKEY. Run them with npm run example -- <language> <path>.