@ax-llm/ax 19.0.40 → 19.0.41

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
@@ -15,6 +15,7 @@ interface ResponseValidation {
15
15
  }
16
16
  interface AxAPI {
17
17
  name?: string;
18
+ url?: string | URL;
18
19
  headers?: Record<string, string>;
19
20
  put?: boolean;
20
21
  localCall?: <TRequest, TResponse>(data: TRequest, stream?: boolean) => Promise<TResponse | ReadableStream<TResponse>>;
@@ -169,6 +170,7 @@ type AxAIInputModelList<TModel, TEmbedModel, TModelKey> = (AxAIModelListBase<TMo
169
170
  stream?: AxAIServiceOptions['stream'];
170
171
  debug?: AxAIServiceOptions['debug'];
171
172
  useExpensiveModel?: AxAIServiceOptions['useExpensiveModel'];
173
+ noBeta?: AxAIServiceOptions['noBeta'];
172
174
  } & ({
173
175
  model: TModel;
174
176
  } | {
@@ -904,6 +906,13 @@ type AxAIServiceOptions = {
904
906
  * higher-capability tier when available.
905
907
  */
906
908
  useExpensiveModel?: 'yes';
909
+ /**
910
+ * Provider-specific hint to prefer stable API paths over beta ones when available.
911
+ *
912
+ * Currently used by Google Gemini on Vertex AI to force requests onto `v1`
913
+ * instead of `v1beta1`.
914
+ */
915
+ noBeta?: boolean;
907
916
  /** Internal: Current step index for multi-step operations. */
908
917
  stepIndex?: number;
909
918
  /**
@@ -996,7 +1005,7 @@ interface AxAIServiceImpl<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TCha
996
1005
  createChatReq(req: Readonly<AxInternalChatRequest<TModel>>, config?: Readonly<AxAIServiceOptions>): Promise<[AxAPI, TChatRequest]> | [AxAPI, TChatRequest];
997
1006
  createChatResp(resp: Readonly<TChatResponse>): AxChatResponse;
998
1007
  createChatStreamResp?(resp: Readonly<TChatResponseDelta>, state: object): AxChatResponse;
999
- createEmbedReq?(req: Readonly<AxInternalEmbedRequest<TEmbedModel>>): Promise<[AxAPI, TEmbedRequest]> | [AxAPI, TEmbedRequest];
1008
+ createEmbedReq?(req: Readonly<AxInternalEmbedRequest<TEmbedModel>>, config?: Readonly<AxAIServiceOptions>): Promise<[AxAPI, TEmbedRequest]> | [AxAPI, TEmbedRequest];
1000
1009
  createEmbedResp?(resp: Readonly<TEmbedResponse>): AxEmbedResponse;
1001
1010
  getModelConfig(): AxModelConfig;
1002
1011
  getTokenUsage(): AxTokenUsage | undefined;
@@ -1026,7 +1035,7 @@ interface AxAIServiceImpl<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TCha
1026
1035
  /**
1027
1036
  * Optional: Build a context cache TTL update operation.
1028
1037
  */
1029
- buildCacheUpdateTTLOp?(cacheName: string, ttlSeconds: number): AxContextCacheOperation;
1038
+ buildCacheUpdateTTLOp?(cacheName: string, ttlSeconds: number, model?: TModel, noBeta?: AxAIServiceOptions['noBeta']): AxContextCacheOperation;
1030
1039
  /**
1031
1040
  * Optional: Build a context cache deletion operation.
1032
1041
  */
@@ -3825,6 +3834,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
3825
3834
  private retry?;
3826
3835
  private customLabels?;
3827
3836
  private contextCache?;
3837
+ private noBeta?;
3828
3838
  private modelInfo;
3829
3839
  private modelUsage?;
3830
3840
  private embedModelUsage?;
package/index.d.ts CHANGED
@@ -15,6 +15,7 @@ interface ResponseValidation {
15
15
  }
16
16
  interface AxAPI {
17
17
  name?: string;
18
+ url?: string | URL;
18
19
  headers?: Record<string, string>;
19
20
  put?: boolean;
20
21
  localCall?: <TRequest, TResponse>(data: TRequest, stream?: boolean) => Promise<TResponse | ReadableStream<TResponse>>;
@@ -169,6 +170,7 @@ type AxAIInputModelList<TModel, TEmbedModel, TModelKey> = (AxAIModelListBase<TMo
169
170
  stream?: AxAIServiceOptions['stream'];
170
171
  debug?: AxAIServiceOptions['debug'];
171
172
  useExpensiveModel?: AxAIServiceOptions['useExpensiveModel'];
173
+ noBeta?: AxAIServiceOptions['noBeta'];
172
174
  } & ({
173
175
  model: TModel;
174
176
  } | {
@@ -904,6 +906,13 @@ type AxAIServiceOptions = {
904
906
  * higher-capability tier when available.
905
907
  */
906
908
  useExpensiveModel?: 'yes';
909
+ /**
910
+ * Provider-specific hint to prefer stable API paths over beta ones when available.
911
+ *
912
+ * Currently used by Google Gemini on Vertex AI to force requests onto `v1`
913
+ * instead of `v1beta1`.
914
+ */
915
+ noBeta?: boolean;
907
916
  /** Internal: Current step index for multi-step operations. */
908
917
  stepIndex?: number;
909
918
  /**
@@ -996,7 +1005,7 @@ interface AxAIServiceImpl<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TCha
996
1005
  createChatReq(req: Readonly<AxInternalChatRequest<TModel>>, config?: Readonly<AxAIServiceOptions>): Promise<[AxAPI, TChatRequest]> | [AxAPI, TChatRequest];
997
1006
  createChatResp(resp: Readonly<TChatResponse>): AxChatResponse;
998
1007
  createChatStreamResp?(resp: Readonly<TChatResponseDelta>, state: object): AxChatResponse;
999
- createEmbedReq?(req: Readonly<AxInternalEmbedRequest<TEmbedModel>>): Promise<[AxAPI, TEmbedRequest]> | [AxAPI, TEmbedRequest];
1008
+ createEmbedReq?(req: Readonly<AxInternalEmbedRequest<TEmbedModel>>, config?: Readonly<AxAIServiceOptions>): Promise<[AxAPI, TEmbedRequest]> | [AxAPI, TEmbedRequest];
1000
1009
  createEmbedResp?(resp: Readonly<TEmbedResponse>): AxEmbedResponse;
1001
1010
  getModelConfig(): AxModelConfig;
1002
1011
  getTokenUsage(): AxTokenUsage | undefined;
@@ -1026,7 +1035,7 @@ interface AxAIServiceImpl<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TCha
1026
1035
  /**
1027
1036
  * Optional: Build a context cache TTL update operation.
1028
1037
  */
1029
- buildCacheUpdateTTLOp?(cacheName: string, ttlSeconds: number): AxContextCacheOperation;
1038
+ buildCacheUpdateTTLOp?(cacheName: string, ttlSeconds: number, model?: TModel, noBeta?: AxAIServiceOptions['noBeta']): AxContextCacheOperation;
1030
1039
  /**
1031
1040
  * Optional: Build a context cache deletion operation.
1032
1041
  */
@@ -3825,6 +3834,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
3825
3834
  private retry?;
3826
3835
  private customLabels?;
3827
3836
  private contextCache?;
3837
+ private noBeta?;
3828
3838
  private modelInfo;
3829
3839
  private modelUsage?;
3830
3840
  private embedModelUsage?;