@ax-llm/ax 11.0.41 → 11.0.42

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
@@ -87,6 +87,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
87
87
  private rt?;
88
88
  private fetch?;
89
89
  private tracer?;
90
+ private timeout?;
90
91
  private models?;
91
92
  private modelInfo;
92
93
  private modelUsage?;
@@ -330,11 +331,13 @@ type AxAIServiceOptions = {
330
331
  rateLimiter?: AxRateLimiterFunction;
331
332
  fetch?: typeof fetch;
332
333
  tracer?: Tracer;
334
+ timeout?: number;
333
335
  };
334
336
  type AxAIServiceActionOptions<TModel = unknown, TEmbedModel = unknown> = {
335
337
  ai?: Readonly<AxAIService<TModel, TEmbedModel>>;
336
338
  sessionId?: string;
337
339
  traceId?: string;
340
+ timeout?: number;
338
341
  rateLimiter?: AxRateLimiterFunction;
339
342
  debug?: boolean;
340
343
  debugHideSystemPrompt?: boolean;
package/index.d.ts CHANGED
@@ -87,6 +87,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
87
87
  private rt?;
88
88
  private fetch?;
89
89
  private tracer?;
90
+ private timeout?;
90
91
  private models?;
91
92
  private modelInfo;
92
93
  private modelUsage?;
@@ -330,11 +331,13 @@ type AxAIServiceOptions = {
330
331
  rateLimiter?: AxRateLimiterFunction;
331
332
  fetch?: typeof fetch;
332
333
  tracer?: Tracer;
334
+ timeout?: number;
333
335
  };
334
336
  type AxAIServiceActionOptions<TModel = unknown, TEmbedModel = unknown> = {
335
337
  ai?: Readonly<AxAIService<TModel, TEmbedModel>>;
336
338
  sessionId?: string;
337
339
  traceId?: string;
340
+ timeout?: number;
338
341
  rateLimiter?: AxRateLimiterFunction;
339
342
  debug?: boolean;
340
343
  debugHideSystemPrompt?: boolean;
package/index.js CHANGED
@@ -749,6 +749,7 @@ var AxBaseAI = class {
749
749
  rt;
750
750
  fetch;
751
751
  tracer;
752
+ timeout;
752
753
  models;
753
754
  modelInfo;
754
755
  modelUsage;
@@ -807,6 +808,7 @@ var AxBaseAI = class {
807
808
  this.debug = options.debug ?? false;
808
809
  this.rt = options.rateLimiter;
809
810
  this.fetch = options.fetch;
811
+ this.timeout = options.timeout;
810
812
  this.tracer = options.tracer;
811
813
  }
812
814
  getOptions() {
@@ -990,6 +992,7 @@ var AxBaseAI = class {
990
992
  url: this.apiURL,
991
993
  headers: await this.buildHeaders(apiConfig.headers),
992
994
  stream: modelConfig.stream,
995
+ timeout: this.timeout,
993
996
  debug,
994
997
  fetch: this.fetch,
995
998
  span
@@ -1119,6 +1122,7 @@ var AxBaseAI = class {
1119
1122
  headers: await this.buildHeaders(apiConfig.headers),
1120
1123
  debug,
1121
1124
  fetch: this.fetch,
1125
+ timeout: this.timeout,
1122
1126
  span
1123
1127
  },
1124
1128
  reqValue
@@ -5797,7 +5801,7 @@ function* streamValues(sig, content, values, xstate) {
5797
5801
  const v = value.slice(s);
5798
5802
  if (v && v.length > 0) {
5799
5803
  yield { [key]: v };
5800
- xstate.streamedIndex[key] = s + 1;
5804
+ xstate.streamedIndex[key] = s + v.length;
5801
5805
  }
5802
5806
  continue;
5803
5807
  }