@adaline/gateway 0.13.0 → 0.14.0

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/dist/index.d.mts CHANGED
@@ -51,12 +51,12 @@ declare class HttpRequestError extends GatewayBaseError {
51
51
  interface HttpClientConfig {
52
52
  timeoutInMilliseconds?: number;
53
53
  axiosInstance?: AxiosInstance;
54
- proxyUrl?: URL | undefined;
55
54
  }
56
55
  declare class IsomorphicHttpClient implements HttpClient {
57
56
  private defaultTimeout?;
58
57
  private client;
59
- private proxyUrl?;
58
+ private httpProxyAgent?;
59
+ private httpsProxyAgent?;
60
60
  constructor(config: HttpClientConfig);
61
61
  isNodeEnvironment: () => boolean;
62
62
  private makeRequest;
@@ -394,6 +394,12 @@ declare const CompleteChatHandlerRequest: z.ZodObject<{
394
394
  metadataForCallbacks?: any;
395
395
  }>>;
396
396
  model: z.ZodType<ChatModelV1<{
397
+ name: string;
398
+ description: string;
399
+ roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
400
+ modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
401
+ maxInputTokens: number;
402
+ maxOutputTokens: number;
397
403
  config: {
398
404
  def: Record<string, {
399
405
  type: "multi-string";
@@ -432,13 +438,13 @@ declare const CompleteChatHandlerRequest: z.ZodObject<{
432
438
  }>;
433
439
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
434
440
  };
441
+ }>, z.ZodTypeDef, ChatModelV1<{
435
442
  name: string;
436
443
  description: string;
437
444
  roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
438
445
  modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
439
446
  maxInputTokens: number;
440
447
  maxOutputTokens: number;
441
- }>, z.ZodTypeDef, ChatModelV1<{
442
448
  config: {
443
449
  def: Record<string, {
444
450
  type: "multi-string";
@@ -477,12 +483,6 @@ declare const CompleteChatHandlerRequest: z.ZodObject<{
477
483
  }>;
478
484
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
479
485
  };
480
- name: string;
481
- description: string;
482
- roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
483
- modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
484
- maxInputTokens: number;
485
- maxOutputTokens: number;
486
486
  }>>;
487
487
  config: z.ZodRecord<z.ZodString, z.ZodAny>;
488
488
  messages: z.ZodArray<z.ZodObject<{
@@ -728,6 +728,12 @@ declare const CompleteChatHandlerRequest: z.ZodObject<{
728
728
  }, "strip", z.ZodTypeAny, {
729
729
  config: Record<string, any>;
730
730
  model: ChatModelV1<{
731
+ name: string;
732
+ description: string;
733
+ roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
734
+ modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
735
+ maxInputTokens: number;
736
+ maxOutputTokens: number;
731
737
  config: {
732
738
  def: Record<string, {
733
739
  type: "multi-string";
@@ -766,12 +772,6 @@ declare const CompleteChatHandlerRequest: z.ZodObject<{
766
772
  }>;
767
773
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
768
774
  };
769
- name: string;
770
- description: string;
771
- roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
772
- modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
773
- maxInputTokens: number;
774
- maxOutputTokens: number;
775
775
  }>;
776
776
  messages: {
777
777
  role: "system" | "user" | "assistant" | "tool";
@@ -938,6 +938,12 @@ declare const CompleteChatHandlerRequest: z.ZodObject<{
938
938
  }, {
939
939
  config: Record<string, any>;
940
940
  model: ChatModelV1<{
941
+ name: string;
942
+ description: string;
943
+ roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
944
+ modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
945
+ maxInputTokens: number;
946
+ maxOutputTokens: number;
941
947
  config: {
942
948
  def: Record<string, {
943
949
  type: "multi-string";
@@ -976,12 +982,6 @@ declare const CompleteChatHandlerRequest: z.ZodObject<{
976
982
  }>;
977
983
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
978
984
  };
979
- name: string;
980
- description: string;
981
- roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
982
- modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
983
- maxInputTokens: number;
984
- maxOutputTokens: number;
985
985
  }>;
986
986
  messages: {
987
987
  role: "system" | "user" | "assistant" | "tool";
@@ -2691,6 +2691,12 @@ declare function handleGetEmbeddings(request: GetEmbeddingsHandlerRequestType, c
2691
2691
 
2692
2692
  declare const StreamChatHandlerRequest: z.ZodObject<{
2693
2693
  model: z.ZodType<ChatModelV1<{
2694
+ name: string;
2695
+ description: string;
2696
+ roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
2697
+ modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
2698
+ maxInputTokens: number;
2699
+ maxOutputTokens: number;
2694
2700
  config: {
2695
2701
  def: Record<string, {
2696
2702
  type: "multi-string";
@@ -2729,13 +2735,13 @@ declare const StreamChatHandlerRequest: z.ZodObject<{
2729
2735
  }>;
2730
2736
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
2731
2737
  };
2738
+ }>, z.ZodTypeDef, ChatModelV1<{
2732
2739
  name: string;
2733
2740
  description: string;
2734
2741
  roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
2735
2742
  modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
2736
2743
  maxInputTokens: number;
2737
2744
  maxOutputTokens: number;
2738
- }>, z.ZodTypeDef, ChatModelV1<{
2739
2745
  config: {
2740
2746
  def: Record<string, {
2741
2747
  type: "multi-string";
@@ -2774,12 +2780,6 @@ declare const StreamChatHandlerRequest: z.ZodObject<{
2774
2780
  }>;
2775
2781
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
2776
2782
  };
2777
- name: string;
2778
- description: string;
2779
- roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
2780
- modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
2781
- maxInputTokens: number;
2782
- maxOutputTokens: number;
2783
2783
  }>>;
2784
2784
  config: z.ZodRecord<z.ZodString, z.ZodAny>;
2785
2785
  messages: z.ZodArray<z.ZodObject<{
@@ -3024,6 +3024,12 @@ declare const StreamChatHandlerRequest: z.ZodObject<{
3024
3024
  }, "strip", z.ZodTypeAny, {
3025
3025
  config: Record<string, any>;
3026
3026
  model: ChatModelV1<{
3027
+ name: string;
3028
+ description: string;
3029
+ roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
3030
+ modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
3031
+ maxInputTokens: number;
3032
+ maxOutputTokens: number;
3027
3033
  config: {
3028
3034
  def: Record<string, {
3029
3035
  type: "multi-string";
@@ -3062,12 +3068,6 @@ declare const StreamChatHandlerRequest: z.ZodObject<{
3062
3068
  }>;
3063
3069
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
3064
3070
  };
3065
- name: string;
3066
- description: string;
3067
- roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
3068
- modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
3069
- maxInputTokens: number;
3070
- maxOutputTokens: number;
3071
3071
  }>;
3072
3072
  messages: {
3073
3073
  role: "system" | "user" | "assistant" | "tool";
@@ -3122,6 +3122,12 @@ declare const StreamChatHandlerRequest: z.ZodObject<{
3122
3122
  }, {
3123
3123
  config: Record<string, any>;
3124
3124
  model: ChatModelV1<{
3125
+ name: string;
3126
+ description: string;
3127
+ roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
3128
+ modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
3129
+ maxInputTokens: number;
3130
+ maxOutputTokens: number;
3125
3131
  config: {
3126
3132
  def: Record<string, {
3127
3133
  type: "multi-string";
@@ -3160,12 +3166,6 @@ declare const StreamChatHandlerRequest: z.ZodObject<{
3160
3166
  }>;
3161
3167
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
3162
3168
  };
3163
- name: string;
3164
- description: string;
3165
- roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
3166
- modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
3167
- maxInputTokens: number;
3168
- maxOutputTokens: number;
3169
3169
  }>;
3170
3170
  messages: {
3171
3171
  role: "system" | "user" | "assistant" | "tool";
@@ -3976,7 +3976,6 @@ declare const GatewayOptions: z.ZodObject<{
3976
3976
  }>>;
3977
3977
  dangerouslyAllowBrowser: z.ZodOptional<z.ZodBoolean>;
3978
3978
  httpClient: z.ZodOptional<z.ZodType<HttpClient, z.ZodTypeDef, HttpClient>>;
3979
- proxyUrl: z.ZodOptional<z.ZodString>;
3980
3979
  completeChatCache: z.ZodOptional<z.ZodType<Cache<{
3981
3980
  request: {
3982
3981
  config: Record<string, any>;
@@ -4292,7 +4291,6 @@ declare const GatewayOptions: z.ZodObject<{
4292
4291
  } | undefined;
4293
4292
  dangerouslyAllowBrowser?: boolean | undefined;
4294
4293
  httpClient?: HttpClient | undefined;
4295
- proxyUrl?: string | undefined;
4296
4294
  completeChatCache?: Cache<{
4297
4295
  request: {
4298
4296
  config: Record<string, any>;
@@ -4459,7 +4457,6 @@ declare const GatewayOptions: z.ZodObject<{
4459
4457
  } | undefined;
4460
4458
  dangerouslyAllowBrowser?: boolean | undefined;
4461
4459
  httpClient?: HttpClient | undefined;
4462
- proxyUrl?: string | undefined;
4463
4460
  completeChatCache?: Cache<{
4464
4461
  request: {
4465
4462
  config: Record<string, any>;
@@ -4618,6 +4615,12 @@ declare const GatewayOptions: z.ZodObject<{
4618
4615
  type GatewayOptionsType = z.infer<typeof GatewayOptions>;
4619
4616
  declare const GatewayCompleteChatRequest: z.ZodObject<{
4620
4617
  model: z.ZodType<ChatModelV1<{
4618
+ name: string;
4619
+ description: string;
4620
+ roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
4621
+ modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
4622
+ maxInputTokens: number;
4623
+ maxOutputTokens: number;
4621
4624
  config: {
4622
4625
  def: Record<string, {
4623
4626
  type: "multi-string";
@@ -4656,13 +4659,13 @@ declare const GatewayCompleteChatRequest: z.ZodObject<{
4656
4659
  }>;
4657
4660
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
4658
4661
  };
4662
+ }>, z.ZodTypeDef, ChatModelV1<{
4659
4663
  name: string;
4660
4664
  description: string;
4661
4665
  roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
4662
4666
  modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
4663
4667
  maxInputTokens: number;
4664
4668
  maxOutputTokens: number;
4665
- }>, z.ZodTypeDef, ChatModelV1<{
4666
4669
  config: {
4667
4670
  def: Record<string, {
4668
4671
  type: "multi-string";
@@ -4701,12 +4704,6 @@ declare const GatewayCompleteChatRequest: z.ZodObject<{
4701
4704
  }>;
4702
4705
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
4703
4706
  };
4704
- name: string;
4705
- description: string;
4706
- roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
4707
- modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
4708
- maxInputTokens: number;
4709
- maxOutputTokens: number;
4710
4707
  }>>;
4711
4708
  config: z.ZodRecord<z.ZodString, z.ZodAny>;
4712
4709
  messages: z.ZodArray<z.ZodObject<{
@@ -4961,6 +4958,12 @@ declare const GatewayCompleteChatRequest: z.ZodObject<{
4961
4958
  }, "strip", z.ZodTypeAny, {
4962
4959
  config: Record<string, any>;
4963
4960
  model: ChatModelV1<{
4961
+ name: string;
4962
+ description: string;
4963
+ roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
4964
+ modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
4965
+ maxInputTokens: number;
4966
+ maxOutputTokens: number;
4964
4967
  config: {
4965
4968
  def: Record<string, {
4966
4969
  type: "multi-string";
@@ -4999,12 +5002,6 @@ declare const GatewayCompleteChatRequest: z.ZodObject<{
4999
5002
  }>;
5000
5003
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
5001
5004
  };
5002
- name: string;
5003
- description: string;
5004
- roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
5005
- modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
5006
- maxInputTokens: number;
5007
- maxOutputTokens: number;
5008
5005
  }>;
5009
5006
  messages: {
5010
5007
  role: "system" | "user" | "assistant" | "tool";
@@ -5061,6 +5058,12 @@ declare const GatewayCompleteChatRequest: z.ZodObject<{
5061
5058
  }, {
5062
5059
  config: Record<string, any>;
5063
5060
  model: ChatModelV1<{
5061
+ name: string;
5062
+ description: string;
5063
+ roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
5064
+ modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
5065
+ maxInputTokens: number;
5066
+ maxOutputTokens: number;
5064
5067
  config: {
5065
5068
  def: Record<string, {
5066
5069
  type: "multi-string";
@@ -5099,12 +5102,6 @@ declare const GatewayCompleteChatRequest: z.ZodObject<{
5099
5102
  }>;
5100
5103
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
5101
5104
  };
5102
- name: string;
5103
- description: string;
5104
- roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
5105
- modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
5106
- maxInputTokens: number;
5107
- maxOutputTokens: number;
5108
5105
  }>;
5109
5106
  messages: {
5110
5107
  role: "system" | "user" | "assistant" | "tool";
@@ -5162,6 +5159,12 @@ declare const GatewayCompleteChatRequest: z.ZodObject<{
5162
5159
  type GatewayCompleteChatRequestType = z.infer<typeof GatewayCompleteChatRequest>;
5163
5160
  declare const GatewayStreamChatRequest: z.ZodObject<{
5164
5161
  model: z.ZodType<ChatModelV1<{
5162
+ name: string;
5163
+ description: string;
5164
+ roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
5165
+ modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
5166
+ maxInputTokens: number;
5167
+ maxOutputTokens: number;
5165
5168
  config: {
5166
5169
  def: Record<string, {
5167
5170
  type: "multi-string";
@@ -5200,13 +5203,13 @@ declare const GatewayStreamChatRequest: z.ZodObject<{
5200
5203
  }>;
5201
5204
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
5202
5205
  };
5206
+ }>, z.ZodTypeDef, ChatModelV1<{
5203
5207
  name: string;
5204
5208
  description: string;
5205
5209
  roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
5206
5210
  modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
5207
5211
  maxInputTokens: number;
5208
5212
  maxOutputTokens: number;
5209
- }>, z.ZodTypeDef, ChatModelV1<{
5210
5213
  config: {
5211
5214
  def: Record<string, {
5212
5215
  type: "multi-string";
@@ -5245,12 +5248,6 @@ declare const GatewayStreamChatRequest: z.ZodObject<{
5245
5248
  }>;
5246
5249
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
5247
5250
  };
5248
- name: string;
5249
- description: string;
5250
- roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
5251
- modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
5252
- maxInputTokens: number;
5253
- maxOutputTokens: number;
5254
5251
  }>>;
5255
5252
  config: z.ZodRecord<z.ZodString, z.ZodAny>;
5256
5253
  messages: z.ZodArray<z.ZodObject<{
@@ -5502,6 +5499,12 @@ declare const GatewayStreamChatRequest: z.ZodObject<{
5502
5499
  }, "strip", z.ZodTypeAny, {
5503
5500
  config: Record<string, any>;
5504
5501
  model: ChatModelV1<{
5502
+ name: string;
5503
+ description: string;
5504
+ roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
5505
+ modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
5506
+ maxInputTokens: number;
5507
+ maxOutputTokens: number;
5505
5508
  config: {
5506
5509
  def: Record<string, {
5507
5510
  type: "multi-string";
@@ -5540,12 +5543,6 @@ declare const GatewayStreamChatRequest: z.ZodObject<{
5540
5543
  }>;
5541
5544
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
5542
5545
  };
5543
- name: string;
5544
- description: string;
5545
- roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
5546
- modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
5547
- maxInputTokens: number;
5548
- maxOutputTokens: number;
5549
5546
  }>;
5550
5547
  messages: {
5551
5548
  role: "system" | "user" | "assistant" | "tool";
@@ -5601,6 +5598,12 @@ declare const GatewayStreamChatRequest: z.ZodObject<{
5601
5598
  }, {
5602
5599
  config: Record<string, any>;
5603
5600
  model: ChatModelV1<{
5601
+ name: string;
5602
+ description: string;
5603
+ roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
5604
+ modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
5605
+ maxInputTokens: number;
5606
+ maxOutputTokens: number;
5604
5607
  config: {
5605
5608
  def: Record<string, {
5606
5609
  type: "multi-string";
@@ -5639,12 +5642,6 @@ declare const GatewayStreamChatRequest: z.ZodObject<{
5639
5642
  }>;
5640
5643
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
5641
5644
  };
5642
- name: string;
5643
- description: string;
5644
- roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
5645
- modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
5646
- maxInputTokens: number;
5647
- maxOutputTokens: number;
5648
5645
  }>;
5649
5646
  messages: {
5650
5647
  role: "system" | "user" | "assistant" | "tool";