@ax-llm/ax 21.0.2 → 21.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +216 -216
- package/index.cjs.map +1 -1
- package/index.d.cts +96 -10
- package/index.d.ts +96 -10
- package/index.global.js +246 -246
- package/index.global.js.map +1 -1
- package/index.js +210 -210
- package/index.js.map +1 -1
- package/package.json +2 -3
- package/skills/ax-agent-optimize.md +1 -1
- package/skills/ax-agent.md +1 -1
- package/skills/ax-ai.md +1 -1
- package/skills/ax-audio.md +1 -1
- package/skills/ax-flow.md +1 -1
- package/skills/ax-gen.md +2 -2
- package/skills/ax-gepa.md +1 -1
- package/skills/ax-learn.md +1 -1
- package/skills/ax-llm.md +1 -1
- package/skills/ax-signature.md +7 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ax-llm/ax",
|
|
3
|
-
"version": "21.0.
|
|
3
|
+
"version": "21.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The best library to work with LLMs",
|
|
6
6
|
"repository": {
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
"keywords": [],
|
|
15
15
|
"types": "./index.d.ts",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@opentelemetry/api": "^1.9.0"
|
|
18
|
-
"dayjs": "^1.11.13"
|
|
17
|
+
"@opentelemetry/api": "^1.9.0"
|
|
19
18
|
},
|
|
20
19
|
"peerDependencies": {
|
|
21
20
|
"zod": "^3.24.0 || ^4.0.0"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-agent-optimize
|
|
3
3
|
description: This skill helps an LLM generate correct AxAgent tuning and evaluation code using @ax-llm/ax. Use when the user asks about agent.optimize(...), judgeOptions, eval datasets, optimization targets, saved optimizedProgram artifacts, or recursive optimization guidance.
|
|
4
|
-
version: "21.0.
|
|
4
|
+
version: "21.0.3"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxAgent Optimize Codegen Rules (@ax-llm/ax)
|
package/skills/ax-agent.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-agent
|
|
3
3
|
description: This skill helps an LLM generate correct AxAgent code using @ax-llm/ax. Use when the user asks about agent(), child agents, namespaced functions, discovery mode, shared fields, llmQuery(...), RLM code execution, recursionOptions, or agent runtime behavior. For tuning and eval with agent.optimize(...), use ax-agent-optimize.
|
|
4
|
-
version: "21.0.
|
|
4
|
+
version: "21.0.3"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxAgent Codegen Rules (@ax-llm/ax)
|
package/skills/ax-ai.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-ai
|
|
3
3
|
description: This skill helps an LLM generate correct AI provider setup and configuration code using @ax-llm/ax. Use when the user asks about ai(), providers, models, presets, embeddings, extended thinking, context caching, or mentions OpenAI/Anthropic/Google/Azure/Groq/DeepSeek/Mistral/Cohere/Together/Ollama/HuggingFace/Reka/OpenRouter with @ax-llm/ax.
|
|
4
|
-
version: "21.0.
|
|
4
|
+
version: "21.0.3"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AI Provider Codegen Rules (@ax-llm/ax)
|
package/skills/ax-audio.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-audio
|
|
3
3
|
description: This skill helps an LLM generate correct conversational audio I/O code with @ax-llm/ax. Use when the user asks about .chat() audio input, audio output, OpenAI gpt-audio or realtime models, Gemini Live native audio, Grok Voice Agent models, voices, formats, transcripts, or how audio fits with signatures and structured outputs.
|
|
4
|
-
version: "21.0.
|
|
4
|
+
version: "21.0.3"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Audio I/O Codegen Rules (@ax-llm/ax)
|
package/skills/ax-flow.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-flow
|
|
3
3
|
description: This skill helps an LLM generate correct AxFlow workflow code using @ax-llm/ax. Use when the user asks about flow(), AxFlow, workflow orchestration, parallel execution, DAG workflows, conditional routing, map/reduce patterns, or multi-node AI pipelines.
|
|
4
|
-
version: "21.0.
|
|
4
|
+
version: "21.0.3"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxFlow Codegen Rules (@ax-llm/ax)
|
package/skills/ax-gen.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-gen
|
|
3
3
|
description: This skill helps an LLM generate correct AxGen code using @ax-llm/ax. Use when the user asks about ax(), AxGen, generators, forward(), streamingForward(), assertions, field processors, step hooks, self-tuning, or structured outputs.
|
|
4
|
-
version: "21.0.
|
|
4
|
+
version: "21.0.3"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxGen Codegen Rules (@ax-llm/ax)
|
|
@@ -393,7 +393,7 @@ gen.getChatLog(): readonly AxChatLogEntry[]
|
|
|
393
393
|
|
|
394
394
|
### getUsage()
|
|
395
395
|
|
|
396
|
-
Returns token usage aggregated by `(ai, model)` across all steps. Reset with `resetUsage()`.
|
|
396
|
+
Returns token usage aggregated by `(ai, model)` across all steps. When a provider reports prompt-cache usage, `promptTokens` is the uncached input portion and `cacheReadTokens` / `cacheCreationTokens` carry the cache counters. Reset with `resetUsage()`.
|
|
397
397
|
|
|
398
398
|
```typescript
|
|
399
399
|
const usage = gen.getUsage(); // AxProgramUsage[]
|
package/skills/ax-gepa.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-gepa
|
|
3
3
|
description: This skill helps an LLM generate correct AxGEPA optimization code using @ax-llm/ax. Use when the user asks about AxGEPA, GEPA, Pareto optimization, multi-objective prompt tuning, reflective prompt evolution, validationExamples, maxMetricCalls, or optimizing a generator, flow, or agent tree.
|
|
4
|
-
version: "21.0.
|
|
4
|
+
version: "21.0.3"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxGEPA Codegen Rules (@ax-llm/ax)
|
package/skills/ax-learn.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-learn
|
|
3
3
|
description: This skill helps an LLM generate correct AxLearn code using @ax-llm/ax. Use when the user asks about self-improving agents, trace-backed learning, feedback-aware updates, or AxLearn modes.
|
|
4
|
-
version: "21.0.
|
|
4
|
+
version: "21.0.3"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AxLearn Codegen Rules (@ax-llm/ax)
|
package/skills/ax-llm.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-llm
|
|
3
3
|
description: This skill helps with using the @ax-llm/ax TypeScript library for building LLM applications. Use when the user asks about ax(), ai(), f(), s(), agent(), flow(), AxGen, AxAgent, AxFlow, signatures, streaming, or mentions @ax-llm/ax.
|
|
4
|
-
version: "21.0.
|
|
4
|
+
version: "21.0.3"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Ax Library (@ax-llm/ax) Quick Reference
|
package/skills/ax-signature.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ax-signature
|
|
3
3
|
description: This skill helps an LLM generate correct DSPy signature code using @ax-llm/ax. Use when the user asks about signatures, s(), f(), field types, string syntax, fluent builder API, validation constraints, or type-safe inputs/outputs.
|
|
4
|
-
version: "21.0.
|
|
4
|
+
version: "21.0.3"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Ax Signature Reference
|
|
@@ -22,6 +22,8 @@ version: "21.0.2"
|
|
|
22
22
|
| JSON | `:json` | `any` | `metadata:json` |
|
|
23
23
|
| Date | `:date` | `Date` | `birthDate:date` |
|
|
24
24
|
| DateTime | `:datetime` | `Date` | `timestamp:datetime` |
|
|
25
|
+
| DateRange | `:dateRange` | `{ start: Date; end: Date }` | `travelDates:dateRange` |
|
|
26
|
+
| DateTimeRange | `:datetimeRange` | `{ start: Date; end: Date }` | `meetingWindow:datetimeRange` |
|
|
25
27
|
| Image | `:image` | `{mimeType, data}` | `photo:image` (input only) |
|
|
26
28
|
| Audio | `:audio` | `{format?, data}` | `recording:audio` (input only) |
|
|
27
29
|
| File | `:file` | `{mimeType, data}` | `document:file` (input only) |
|
|
@@ -29,6 +31,8 @@ version: "21.0.2"
|
|
|
29
31
|
| Code | `:code` | `string` | `pythonScript:code` |
|
|
30
32
|
| Class | `:class "a, b, c"` | `"a" \| "b" \| "c"` | `mood:class "happy, sad"` |
|
|
31
33
|
|
|
34
|
+
Date, datetime, and range fields are AI-friendly but strict. They accept ISO-style values, trim minor whitespace/casing issues, and parse ranges as `{ "start": "...", "end": "..." }`, `[start, end]`, `start/end`, or natural delimiters like `start to end`; invalid values and reversed ranges should fail validation rather than being silently autocorrected.
|
|
35
|
+
|
|
32
36
|
## Arrays, Optional, and Internal Fields
|
|
33
37
|
|
|
34
38
|
```typescript
|
|
@@ -177,7 +181,7 @@ const sig = s('base:string -> result:string')
|
|
|
177
181
|
Type creators:
|
|
178
182
|
- `f.string(desc)`, `f.number(desc)`, `f.boolean(desc)`, `f.json(desc)`
|
|
179
183
|
- `f.image(desc)`, `f.audio(desc)`, `f.file(desc)`, `f.url(desc)`
|
|
180
|
-
- `f.email(desc)`, `f.date(desc)`, `f.datetime(desc)`
|
|
184
|
+
- `f.email(desc)`, `f.date(desc)`, `f.datetime(desc)`, `f.dateRange(desc)`, `f.datetimeRange(desc)`
|
|
181
185
|
- `f.class(['a','b','c'], desc)`, `f.code(desc)`
|
|
182
186
|
- `f.object({ field: f.string() }, desc)`
|
|
183
187
|
|
|
@@ -283,7 +287,7 @@ Bad: `text`, `data`, `input`, `output`, `a`, `x`, `val` (too generic), `1field`
|
|
|
283
287
|
- `.internal()` / `{ internal: true }` is output-only (for chain-of-thought reasoning).
|
|
284
288
|
- `.cache()` / `{ cache: true }` is input-only (for prompt caching).
|
|
285
289
|
- Validation errors trigger auto-retry with correction feedback.
|
|
286
|
-
- `f.email()`, `f.url()`, `f.date()`, `f.datetime()` are shorthand for `f.string().email()` etc.
|
|
290
|
+
- `f.email()`, `f.url()`, `f.date()`, `f.datetime()` are shorthand for `f.string().email()` etc.; `f.dateRange()` and `f.datetimeRange()` return `{ start: Date; end: Date }`.
|
|
287
291
|
- `z.enum()` maps to ax's `class` type — only valid on **output** fields.
|
|
288
292
|
- For multimodal inputs (images, audio, files) use `f.image()` / `f.audio()` / `f.file()` — zod has no equivalent.
|
|
289
293
|
|