@ax-llm/ax 21.0.10 → 21.0.11

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.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Histogram, Counter, Gauge, Meter, Context, Tracer, Span } from '@opentelemetry/api';
1
+ import { Histogram, Counter, Gauge, Context, Tracer, Span, Meter } from '@opentelemetry/api';
2
2
 
3
3
  type AxMemoryMessageValue = Omit<AxChatRequest['chatPrompt'][number], 'role'> | Omit<AxChatResponseResult, 'index'>;
4
4
  type AxMemoryData = {
@@ -1224,9 +1224,27 @@ declare class AxProgram<IN = any, OUT = any> implements AxUsable, AxTunable<IN,
1224
1224
  protected applyLocalOptimizedComponents(updates: Readonly<Record<string, string>>): void;
1225
1225
  }
1226
1226
 
1227
- type AxGenerateResult<OUT> = OUT & {
1228
- thought?: string;
1229
- };
1227
+ type AxFieldProcessorProcess = (value: AxFieldValue, context?: Readonly<{
1228
+ values?: AxGenOut;
1229
+ sessionId?: string;
1230
+ done?: boolean;
1231
+ }>) => unknown | Promise<unknown>;
1232
+ type AxStreamingFieldProcessorProcess = (value: string, context?: Readonly<{
1233
+ values?: AxGenOut;
1234
+ sessionId?: string;
1235
+ done?: boolean;
1236
+ }>) => unknown | Promise<unknown>;
1237
+ interface AxFieldProcessor {
1238
+ field: Readonly<AxField>;
1239
+ /**
1240
+ * Process the field value and return a new value (or undefined if no update is needed).
1241
+ * The returned value may be merged back into memory.
1242
+ * @param value - The current field value.
1243
+ * @param context - Additional context (e.g. memory and session id).
1244
+ */
1245
+ process: AxFieldProcessorProcess | AxStreamingFieldProcessorProcess;
1246
+ }
1247
+
1230
1248
  interface AxResponseHandlerArgs<T> {
1231
1249
  ai: Readonly<AxAIService>;
1232
1250
  model?: string;
@@ -1243,6 +1261,10 @@ interface AxResponseHandlerArgs<T> {
1243
1261
  debugPromptMetrics?: Readonly<AxPromptMetrics>;
1244
1262
  onFunctionCall?: (call: Readonly<AxFunctionCallTrace>) => void | Promise<void>;
1245
1263
  }
1264
+
1265
+ type AxGenerateResult<OUT> = OUT & {
1266
+ thought?: string;
1267
+ };
1246
1268
  interface AxStreamingEvent<T> {
1247
1269
  event: 'delta' | 'done' | 'error';
1248
1270
  data: {
@@ -9620,27 +9642,6 @@ declare class AxTestPrompt<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut =
9620
9642
  run(metricFn: AxMetricFn): Promise<void>;
9621
9643
  }
9622
9644
 
9623
- type AxFieldProcessorProcess = (value: AxFieldValue, context?: Readonly<{
9624
- values?: AxGenOut;
9625
- sessionId?: string;
9626
- done?: boolean;
9627
- }>) => unknown | Promise<unknown>;
9628
- type AxStreamingFieldProcessorProcess = (value: string, context?: Readonly<{
9629
- values?: AxGenOut;
9630
- sessionId?: string;
9631
- done?: boolean;
9632
- }>) => unknown | Promise<unknown>;
9633
- interface AxFieldProcessor {
9634
- field: Readonly<AxField>;
9635
- /**
9636
- * Process the field value and return a new value (or undefined if no update is needed).
9637
- * The returned value may be merged back into memory.
9638
- * @param value - The current field value.
9639
- * @param context - Additional context (e.g. memory and session id).
9640
- */
9641
- process: AxFieldProcessorProcess | AxStreamingFieldProcessorProcess;
9642
- }
9643
-
9644
9645
  type AxFunctionResultFormatter = (result: unknown) => string;
9645
9646
  declare const axGlobals: {
9646
9647
  signatureStrict: boolean;
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Histogram, Counter, Gauge, Meter, Context, Tracer, Span } from '@opentelemetry/api';
1
+ import { Histogram, Counter, Gauge, Context, Tracer, Span, Meter } from '@opentelemetry/api';
2
2
 
3
3
  type AxMemoryMessageValue = Omit<AxChatRequest['chatPrompt'][number], 'role'> | Omit<AxChatResponseResult, 'index'>;
4
4
  type AxMemoryData = {
@@ -1224,9 +1224,27 @@ declare class AxProgram<IN = any, OUT = any> implements AxUsable, AxTunable<IN,
1224
1224
  protected applyLocalOptimizedComponents(updates: Readonly<Record<string, string>>): void;
1225
1225
  }
1226
1226
 
1227
- type AxGenerateResult<OUT> = OUT & {
1228
- thought?: string;
1229
- };
1227
+ type AxFieldProcessorProcess = (value: AxFieldValue, context?: Readonly<{
1228
+ values?: AxGenOut;
1229
+ sessionId?: string;
1230
+ done?: boolean;
1231
+ }>) => unknown | Promise<unknown>;
1232
+ type AxStreamingFieldProcessorProcess = (value: string, context?: Readonly<{
1233
+ values?: AxGenOut;
1234
+ sessionId?: string;
1235
+ done?: boolean;
1236
+ }>) => unknown | Promise<unknown>;
1237
+ interface AxFieldProcessor {
1238
+ field: Readonly<AxField>;
1239
+ /**
1240
+ * Process the field value and return a new value (or undefined if no update is needed).
1241
+ * The returned value may be merged back into memory.
1242
+ * @param value - The current field value.
1243
+ * @param context - Additional context (e.g. memory and session id).
1244
+ */
1245
+ process: AxFieldProcessorProcess | AxStreamingFieldProcessorProcess;
1246
+ }
1247
+
1230
1248
  interface AxResponseHandlerArgs<T> {
1231
1249
  ai: Readonly<AxAIService>;
1232
1250
  model?: string;
@@ -1243,6 +1261,10 @@ interface AxResponseHandlerArgs<T> {
1243
1261
  debugPromptMetrics?: Readonly<AxPromptMetrics>;
1244
1262
  onFunctionCall?: (call: Readonly<AxFunctionCallTrace>) => void | Promise<void>;
1245
1263
  }
1264
+
1265
+ type AxGenerateResult<OUT> = OUT & {
1266
+ thought?: string;
1267
+ };
1246
1268
  interface AxStreamingEvent<T> {
1247
1269
  event: 'delta' | 'done' | 'error';
1248
1270
  data: {
@@ -9620,27 +9642,6 @@ declare class AxTestPrompt<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut =
9620
9642
  run(metricFn: AxMetricFn): Promise<void>;
9621
9643
  }
9622
9644
 
9623
- type AxFieldProcessorProcess = (value: AxFieldValue, context?: Readonly<{
9624
- values?: AxGenOut;
9625
- sessionId?: string;
9626
- done?: boolean;
9627
- }>) => unknown | Promise<unknown>;
9628
- type AxStreamingFieldProcessorProcess = (value: string, context?: Readonly<{
9629
- values?: AxGenOut;
9630
- sessionId?: string;
9631
- done?: boolean;
9632
- }>) => unknown | Promise<unknown>;
9633
- interface AxFieldProcessor {
9634
- field: Readonly<AxField>;
9635
- /**
9636
- * Process the field value and return a new value (or undefined if no update is needed).
9637
- * The returned value may be merged back into memory.
9638
- * @param value - The current field value.
9639
- * @param context - Additional context (e.g. memory and session id).
9640
- */
9641
- process: AxFieldProcessorProcess | AxStreamingFieldProcessorProcess;
9642
- }
9643
-
9644
9645
  type AxFunctionResultFormatter = (result: unknown) => string;
9645
9646
  declare const axGlobals: {
9646
9647
  signatureStrict: boolean;