@ax-llm/ax 17.0.7 → 17.0.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ax-llm/ax",
3
- "version": "17.0.7",
3
+ "version": "17.0.9",
4
4
  "type": "module",
5
5
  "description": "The best library to work with LLMs",
6
6
  "repository": {
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ax-agent
3
3
  description: This skill helps with building AxAgent-based agents using @ax-llm/ax. Use when the user asks about agent(), AxAgent, child agents, tool functions, smart model routing, RLM mode, stopping agents, or composing multi-agent hierarchies.
4
- version: "17.0.7"
4
+ version: "17.0.9"
5
5
  ---
6
6
 
7
7
  # AxAgent Guide (@ax-llm/ax)
@@ -347,9 +347,11 @@ When you pass a long document to an LLM, you face:
347
347
 
348
348
  ### How It Works
349
349
 
350
- 1. **Context extraction** — Fields listed in `contextFields` are removed from the LLM prompt and loaded into a code interpreter session as variables.
351
- 2. **Code interpreter** — The LLM gets a `codeInterpreter` tool to execute code in a persistent REPL. Variables and state persist across calls.
352
- 3. **Sub-LM queries** Inside the code interpreter, `llmQuery(query, context?)` calls a sub-LM for semantic analysis. `llmQuery([...])` runs multiple queries in parallel.
350
+ 1. **Context extraction** — Fields listed in `contextFields` are removed from the LLM prompt and loaded into a runtime session as variables.
351
+ 2. **Execution mode**
352
+ - `mode: 'inline'` (default): the LLM emits helper output fields (`<language>Code`, `llmQuery`, `resultReady`) that are processed via field processors.
353
+ - `mode: 'function'`: the LLM uses the `codeInterpreter` tool.
354
+ 3. **Sub-LM queries** — Runtime calls use `llmQuery(...)` for semantic analysis.
353
355
  4. **Final answer** — When done, the LLM provides its final answer with the required output fields.
354
356
 
355
357
  The LLM writes code to inspect, filter, and iterate over the document. If useful, it can chunk data manually in code before calling `llmQuery`.
@@ -367,6 +369,8 @@ const analyzer = agent(
367
369
  description: 'Analyzes long documents using code interpreter and sub-LM queries',
368
370
  maxSteps: 15,
369
371
  rlm: {
372
+ mode: 'inline', // 'inline' (default) | 'function'
373
+ language: 'javascript', // Used for inline helper field naming (default: 'javascript')
370
374
  contextFields: ['context'], // Fields to load into runtime session
371
375
  runtime: new AxJSRuntime(), // Code runtime implementation
372
376
  maxLlmCalls: 30, // Cap on sub-LM calls (default: 50)
@@ -452,7 +456,14 @@ Structured fields are loaded as native JavaScript objects in the interpreter, pr
452
456
 
453
457
  ### The REPL Loop
454
458
 
455
- In RLM mode, the agent gets a `codeInterpreter` tool. The LLM's typical workflow:
459
+ In `mode: 'function'`, the agent gets a `codeInterpreter` tool.
460
+
461
+ In `mode: 'inline'`, the model emits helper output fields:
462
+ - `<language>Code` (for example `javascriptCode`) for runtime code execution
463
+ - `llmQuery` (`string[]`) for batched sub-LM queries
464
+ - `resultReady` (`boolean`) to signal completion
465
+
466
+ The LLM's typical workflow:
456
467
 
457
468
  1. Peek at context structure (typeof, length, slice)
458
469
  2. Filter/select relevant slices (chunk manually only when needed)
@@ -529,6 +540,8 @@ RLM mode does not support true streaming. When using `streamingForward`, RLM run
529
540
 
530
541
  ```typescript
531
542
  interface AxRLMConfig {
543
+ mode?: 'function' | 'inline'; // RLM execution mode (default: 'inline')
544
+ language?: string; // Inline helper field prefix (default: 'javascript')
532
545
  contextFields: string[]; // Input fields holding long context
533
546
  runtime?: AxCodeRuntime; // Preferred runtime key
534
547
  interpreter?: AxCodeRuntime; // Legacy alias (deprecated)
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: "17.0.7"
4
+ version: "17.0.9"
5
5
  ---
6
6
 
7
7
  # Ax Library (@ax-llm/ax) Usage Guide