sarvam-ai-sdk 0.0.1 → 0.0.2

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/README.md CHANGED
@@ -5,18 +5,18 @@ contains language model support for the Sarvam chat completion, Text-to-Speech a
5
5
 
6
6
  ## Setup
7
7
 
8
- The **[Sarvam](http://sarvam.ai)** provider is available in the `@ai-sdk/sarvam` module. You can install it with
8
+ The **[Sarvam](http://sarvam.ai)** provider is available in the `sarvam-ai-sdk` module. You can install it with
9
9
 
10
10
  ```bash
11
- npm i @ai-sdk/sarvam
11
+ npm i sarvam-ai-sdk
12
12
  ```
13
13
 
14
14
  ## Provider Instance
15
15
 
16
- You can import the default provider instance `sarvam` from `@ai-sdk/sarvam`:
16
+ You can import the default provider instance `sarvam` from `sarvam-ai-sdk`:
17
17
 
18
18
  ```ts
19
- import { sarvam } from '@ai-sdk/sarvam';
19
+ import { sarvam } from 'sarvam-ai-sdk';
20
20
  ```
21
21
 
22
22
  Create `.env` file with API key from **[Sarvam Dashboard](https://dashboard.sarvam.ai/)**
@@ -27,7 +27,7 @@ SARVAM_API_KEY="your_api_key"
27
27
  ## Example
28
28
 
29
29
  ```ts
30
- import { sarvam } from '@ai-sdk/sarvam';
30
+ import { sarvam } from 'sarvam-ai-sdk';
31
31
  import { generateText } from 'ai';
32
32
 
33
33
  const { text } = await generateText({
@@ -41,7 +41,7 @@ console.log(text); // പാചകം തുടരൂ, സുഹൃത്തു
41
41
  ## Text-to-Speech
42
42
 
43
43
  ```ts
44
- import { sarvam } from "@ai-sdk/sarvam";
44
+ import { sarvam } from "sarvam-ai-sdk";
45
45
  import { experimental_generateSpeech as generateSpeech } from "ai";
46
46
  import { writeFile } from "fs/promises";
47
47
 
@@ -57,7 +57,7 @@ await writeFile("./src/transcript-test.wav", audioBuffer);
57
57
  ## Speech-to-Text
58
58
 
59
59
  ```ts
60
- import { sarvam } from "@ai-sdk/sarvam";
60
+ import { sarvam } from "sarvam-ai-sdk";
61
61
  import { experimental_transcribe as transcribe } from "ai";
62
62
  import { readFile } from "fs/promises";
63
63
 
@@ -69,6 +69,40 @@ const { text } = await transcribe({
69
69
  console.log(text); // പാചകം തുടരും സുഹൃത്തുക്കളെ
70
70
  ```
71
71
 
72
+ ## Tool Calling
73
+
74
+ > [!WARNING]
75
+ > Latest `sarvam-m` model isn't trained on native tool calling feature (aka JSON mode). So we simulate this with prompt engineering technique.
76
+
77
+ ```ts
78
+ import { z } from "zod";
79
+ import { generateText, tool } from "ai";
80
+ import { sarvam } from "sarvam-ai-sdk";
81
+
82
+
83
+ const result = await generateText({
84
+ model: sarvam("sarvam-m", {
85
+ simulateToolCalling: true, // ⚠️ important
86
+ }),
87
+ tools: {
88
+ weather: tool({
89
+ description: "Get the weather in a location",
90
+ parameters: z.object({
91
+ location: z.string().describe("The location to get the weather for"),
92
+ }),
93
+ execute: async ({ location }) => ({
94
+ location,
95
+ temperature: 72 + Math.floor(Math.random() * 21) - 10,
96
+ }),
97
+ }),
98
+ },
99
+ system: "Your are a helpful AI",
100
+ prompt: "കൊച്ചിയിലെ കാലാവസ്ഥ എന്താണ്?",
101
+ });
102
+
103
+ console.log(result.toolResults);
104
+ ```
105
+
72
106
  ## Documentation
73
107
 
74
108
  Please check out the **[Sarvam provider documentation](https://ai-sdk.dev/providers/ai-sdk-providers/sarvam)** and **[Sarvam API documentation](https://docs.sarvam.ai)** for more information.
package/dist/index.cjs CHANGED
@@ -55,22 +55,25 @@ __export(index_exports, {
55
55
  module.exports = __toCommonJS(index_exports);
56
56
 
57
57
  // src/sarvam-provider.ts
58
- var import_provider_utils6 = require("@ai-sdk/provider-utils");
58
+ var import_provider_utils7 = require("@ai-sdk/provider-utils");
59
59
 
60
60
  // src/sarvam-chat-language-model.ts
61
61
  var import_provider3 = require("@ai-sdk/provider");
62
- var import_provider_utils3 = require("@ai-sdk/provider-utils");
62
+ var import_provider_utils4 = require("@ai-sdk/provider-utils");
63
63
  var import_zod2 = require("zod");
64
64
 
65
65
  // src/convert-to-sarvam-chat-messages.ts
66
66
  var import_provider = require("@ai-sdk/provider");
67
67
  var import_provider_utils = require("@ai-sdk/provider-utils");
68
- function convertToSarvamChatMessages(prompt) {
68
+ function convertToSarvamChatMessages(prompt, fakeToolSystemPrompt) {
69
69
  const messages = [];
70
70
  for (const { role, content } of prompt) {
71
71
  switch (role) {
72
72
  case "system": {
73
- messages.push({ role: "system", content });
73
+ const contentData = fakeToolSystemPrompt ? `${content}
74
+
75
+ ${fakeToolSystemPrompt}` : content;
76
+ messages.push({ role: "system", content: contentData });
74
77
  break;
75
78
  }
76
79
  case "user": {
@@ -165,6 +168,23 @@ function getResponseMetadata({
165
168
  };
166
169
  }
167
170
 
171
+ // src/map-sarvam-finish-reason.ts
172
+ function mapSarvamFinishReason(finishReason) {
173
+ switch (finishReason) {
174
+ case "stop":
175
+ return "stop";
176
+ case "length":
177
+ return "length";
178
+ case "content_filter":
179
+ return "content-filter";
180
+ case "function_call":
181
+ case "tool_calls":
182
+ return "tool-calls";
183
+ default:
184
+ return "unknown";
185
+ }
186
+ }
187
+
168
188
  // src/sarvam-error.ts
169
189
  var import_zod = require("zod");
170
190
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
@@ -181,6 +201,8 @@ var sarvamFailedResponseHandler = (0, import_provider_utils2.createJsonErrorResp
181
201
 
182
202
  // src/sarvam-prepare-tools.ts
183
203
  var import_provider2 = require("@ai-sdk/provider");
204
+ var import_provider_utils3 = require("@ai-sdk/provider-utils");
205
+ var import_json_schema_to_typescript = require("json-schema-to-typescript");
184
206
  function prepareTools({
185
207
  mode
186
208
  }) {
@@ -234,24 +256,69 @@ function prepareTools({
234
256
  }
235
257
  }
236
258
  }
237
-
238
- // src/map-sarvam-finish-reason.ts
239
- function mapSarvamFinishReason(finishReason) {
240
- switch (finishReason) {
241
- case "stop":
242
- return "stop";
243
- case "length":
244
- return "length";
245
- case "content_filter":
246
- return "content-filter";
247
- case "function_call":
248
- case "tool_calls":
249
- return "tool-calls";
250
- default:
251
- return "unknown";
259
+ var simulateToolCalling = async (tools) => {
260
+ const context = [];
261
+ const names = [];
262
+ for (const tool of tools) {
263
+ names.push(tool.function.name);
264
+ const tsType = await (0, import_json_schema_to_typescript.compile)(
265
+ tool.function.parameters,
266
+ tool.function.name,
267
+ {
268
+ bannerComment: "",
269
+ format: false,
270
+ declareExternallyReferenced: true,
271
+ enableConstEnums: true,
272
+ unreachableDefinitions: false,
273
+ strictIndexSignatures: false
274
+ }
275
+ );
276
+ const toolContext = tsType.replace(
277
+ /export interface (\w+) \{/,
278
+ (_, name) => `type ${tool.function.name} = {`
279
+ ).replace(/\/\*\*\s*\n\s*\*\s*(.*?)\s*\n\s*\*\//, "// $1");
280
+ context.push(`// ${tool.function.description}
281
+ ${toolContext}`);
252
282
  }
283
+ const text = `These are the available tool you can execute.
284
+
285
+ ${context.join("\n")}
286
+
287
+ type YourToolChoices = {
288
+ 'toolName': '${names.join("' | '")}',
289
+ 'toolData': ${names.join(" | ")}
253
290
  }
254
291
 
292
+ Respond normally.
293
+ If user request to execute any tool, respond with pure JSON format
294
+ Make sure to translate toolData to English.
295
+
296
+ eg:
297
+ const myChoice: YourToolChoices = {
298
+ "toolName": <name>,
299
+ "toolData": <data>
300
+ }`;
301
+ return text;
302
+ };
303
+ var extractToolCallData = (text) => {
304
+ const jsonRegex = /\{(?:[^{}]*|\{[^{}]*\})*\}/g;
305
+ const jsonMatches = text.match(jsonRegex);
306
+ if (jsonMatches && jsonMatches[0]) {
307
+ try {
308
+ const toolFunction = JSON.parse(jsonMatches[0]);
309
+ if (!("toolName" in toolFunction)) return;
310
+ if (!("toolData" in toolFunction)) return;
311
+ return {
312
+ args: JSON.stringify(toolFunction.toolData),
313
+ toolCallId: (0, import_provider_utils3.generateId)(),
314
+ toolCallType: "function",
315
+ toolName: toolFunction.toolName
316
+ };
317
+ } catch (error) {
318
+ }
319
+ }
320
+ };
321
+
255
322
  // src/sarvam-chat-language-model.ts
256
323
  var SarvamChatLanguageModel = class {
257
324
  constructor(modelId, settings, config) {
@@ -268,7 +335,7 @@ var SarvamChatLanguageModel = class {
268
335
  get supportsImageUrls() {
269
336
  return !this.settings.downloadImages;
270
337
  }
271
- getArgs({
338
+ async getArgs({
272
339
  mode,
273
340
  prompt,
274
341
  maxTokens,
@@ -298,14 +365,14 @@ var SarvamChatLanguageModel = class {
298
365
  details: "JSON response format schema is not supported"
299
366
  });
300
367
  }
301
- const sarvamOptions = (0, import_provider_utils3.parseProviderOptions)({
368
+ const sarvamOptions = (0, import_provider_utils4.parseProviderOptions)({
302
369
  provider: "sarvam",
303
370
  providerOptions: providerMetadata,
304
371
  schema: import_zod2.z.object({
305
372
  reasoningFormat: import_zod2.z.enum(["parsed", "raw", "hidden"]).nullish()
306
373
  })
307
374
  });
308
- const baseArgs = {
375
+ const baseArgs = (prompt2, fakeToolSystemPrompt) => ({
309
376
  // model id:
310
377
  model: this.modelId,
311
378
  // model specific settings:
@@ -327,15 +394,16 @@ var SarvamChatLanguageModel = class {
327
394
  // provider options:
328
395
  reasoning_format: sarvamOptions == null ? void 0 : sarvamOptions.reasoningFormat,
329
396
  // messages:
330
- messages: convertToSarvamChatMessages(prompt)
331
- };
397
+ messages: convertToSarvamChatMessages(prompt2, fakeToolSystemPrompt)
398
+ });
332
399
  switch (type) {
333
400
  case "regular": {
334
401
  const { tools, tool_choice, toolWarnings } = prepareTools({
335
402
  mode
336
403
  });
404
+ const fakeSystemPrompt = tools && this.settings.simulateToolCalling ? await simulateToolCalling(tools) : void 0;
337
405
  return {
338
- args: __spreadProps(__spreadValues({}, baseArgs), {
406
+ args: __spreadProps(__spreadValues({}, baseArgs(prompt, fakeSystemPrompt)), {
339
407
  tools,
340
408
  tool_choice
341
409
  }),
@@ -344,7 +412,7 @@ var SarvamChatLanguageModel = class {
344
412
  }
345
413
  case "object-json": {
346
414
  return {
347
- args: __spreadProps(__spreadValues({}, baseArgs), {
415
+ args: __spreadProps(__spreadValues({}, baseArgs(prompt)), {
348
416
  response_format: (
349
417
  // json object response format is not supported for streaming:
350
418
  stream === false ? { type: "json_object" } : void 0
@@ -355,7 +423,7 @@ var SarvamChatLanguageModel = class {
355
423
  }
356
424
  case "object-tool": {
357
425
  return {
358
- args: __spreadProps(__spreadValues({}, baseArgs), {
426
+ args: __spreadProps(__spreadValues({}, baseArgs(prompt)), {
359
427
  tool_choice: {
360
428
  type: "function",
361
429
  function: { name: mode.tool.name }
@@ -382,21 +450,23 @@ var SarvamChatLanguageModel = class {
382
450
  }
383
451
  async doGenerate(options) {
384
452
  var _b, _c, _d, _e, _f, _g, _h;
385
- const { args, warnings } = this.getArgs(__spreadProps(__spreadValues({}, options), { stream: false }));
453
+ const { args, warnings } = await this.getArgs(__spreadProps(__spreadValues({}, options), {
454
+ stream: false
455
+ }));
386
456
  const body = JSON.stringify(args);
387
457
  const {
388
458
  responseHeaders,
389
459
  value: response,
390
460
  rawValue: rawResponse
391
- } = await (0, import_provider_utils3.postJsonToApi)({
461
+ } = await (0, import_provider_utils4.postJsonToApi)({
392
462
  url: this.config.url({
393
463
  path: "/chat/completions",
394
464
  modelId: this.modelId
395
465
  }),
396
- headers: (0, import_provider_utils3.combineHeaders)(this.config.headers(), options.headers),
466
+ headers: (0, import_provider_utils4.combineHeaders)(this.config.headers(), options.headers),
397
467
  body: args,
398
468
  failedResponseHandler: sarvamFailedResponseHandler,
399
- successfulResponseHandler: (0, import_provider_utils3.createJsonResponseHandler)(
469
+ successfulResponseHandler: (0, import_provider_utils4.createJsonResponseHandler)(
400
470
  sarvamChatResponseSchema
401
471
  ),
402
472
  abortSignal: options.abortSignal,
@@ -404,18 +474,29 @@ var SarvamChatLanguageModel = class {
404
474
  });
405
475
  const _a = args, { messages: rawPrompt } = _a, rawSettings = __objRest(_a, ["messages"]);
406
476
  const choice = response.choices[0];
477
+ let text = (_b = choice.message.content) != null ? _b : void 0;
478
+ let toolCalls = (_c = choice.message.tool_calls) == null ? void 0 : _c.map((toolCall) => {
479
+ var _a2;
480
+ return {
481
+ toolCallType: "function",
482
+ toolCallId: (_a2 = toolCall.id) != null ? _a2 : (0, import_provider_utils4.generateId)(),
483
+ toolName: toolCall.function.name,
484
+ args: toolCall.function.arguments
485
+ };
486
+ });
487
+ if (this.settings.simulateToolCalling) {
488
+ if (text && text.length !== 0 && (!toolCalls || (toolCalls == null ? void 0 : toolCalls.length) === 0)) {
489
+ const newTools = extractToolCallData(text);
490
+ if (newTools) {
491
+ toolCalls = [newTools];
492
+ text = void 0;
493
+ }
494
+ }
495
+ }
407
496
  return {
408
- text: (_b = choice.message.content) != null ? _b : void 0,
409
- reasoning: (_c = choice.message.reasoning) != null ? _c : void 0,
410
- toolCalls: (_d = choice.message.tool_calls) == null ? void 0 : _d.map((toolCall) => {
411
- var _a2;
412
- return {
413
- toolCallType: "function",
414
- toolCallId: (_a2 = toolCall.id) != null ? _a2 : (0, import_provider_utils3.generateId)(),
415
- toolName: toolCall.function.name,
416
- args: toolCall.function.arguments
417
- };
418
- }),
497
+ text,
498
+ toolCalls,
499
+ reasoning: (_d = choice.message.reasoning) != null ? _d : void 0,
419
500
  finishReason: mapSarvamFinishReason(choice.finish_reason),
420
501
  usage: {
421
502
  promptTokens: (_f = (_e = response.usage) == null ? void 0 : _e.prompt_tokens) != null ? _f : NaN,
@@ -429,19 +510,21 @@ var SarvamChatLanguageModel = class {
429
510
  };
430
511
  }
431
512
  async doStream(options) {
432
- const { args, warnings } = this.getArgs(__spreadProps(__spreadValues({}, options), { stream: true }));
513
+ const { args, warnings } = await this.getArgs(__spreadProps(__spreadValues({}, options), { stream: true }));
433
514
  const body = JSON.stringify(__spreadProps(__spreadValues({}, args), { stream: true }));
434
- const { responseHeaders, value: response } = await (0, import_provider_utils3.postJsonToApi)({
515
+ const { responseHeaders, value: response } = await (0, import_provider_utils4.postJsonToApi)({
435
516
  url: this.config.url({
436
517
  path: "/chat/completions",
437
518
  modelId: this.modelId
438
519
  }),
439
- headers: (0, import_provider_utils3.combineHeaders)(this.config.headers(), options.headers),
520
+ headers: (0, import_provider_utils4.combineHeaders)(this.config.headers(), options.headers),
440
521
  body: __spreadProps(__spreadValues({}, args), {
441
522
  stream: true
442
523
  }),
443
524
  failedResponseHandler: sarvamFailedResponseHandler,
444
- successfulResponseHandler: (0, import_provider_utils3.createEventSourceResponseHandler)(sarvamChatChunkSchema),
525
+ successfulResponseHandler: (0, import_provider_utils4.createEventSourceResponseHandler)(
526
+ sarvamChatChunkSchema
527
+ ),
445
528
  abortSignal: options.abortSignal,
446
529
  fetch: this.config.fetch
447
530
  });
@@ -490,9 +573,7 @@ var SarvamChatLanguageModel = class {
490
573
  }
491
574
  const choice = value.choices[0];
492
575
  if ((choice == null ? void 0 : choice.finish_reason) != null) {
493
- finishReason = mapSarvamFinishReason(
494
- choice.finish_reason
495
- );
576
+ finishReason = mapSarvamFinishReason(choice.finish_reason);
496
577
  }
497
578
  if ((choice == null ? void 0 : choice.delta) == null) {
498
579
  return;
@@ -552,13 +633,11 @@ var SarvamChatLanguageModel = class {
552
633
  argsTextDelta: toolCall2.function.arguments
553
634
  });
554
635
  }
555
- if ((0, import_provider_utils3.isParsableJson)(
556
- toolCall2.function.arguments
557
- )) {
636
+ if ((0, import_provider_utils4.isParsableJson)(toolCall2.function.arguments)) {
558
637
  controller.enqueue({
559
638
  type: "tool-call",
560
639
  toolCallType: "function",
561
- toolCallId: (_h = toolCall2.id) != null ? _h : (0, import_provider_utils3.generateId)(),
640
+ toolCallId: (_h = toolCall2.id) != null ? _h : (0, import_provider_utils4.generateId)(),
562
641
  toolName: toolCall2.function.name,
563
642
  args: toolCall2.function.arguments
564
643
  });
@@ -581,11 +660,11 @@ var SarvamChatLanguageModel = class {
581
660
  toolName: toolCall.function.name,
582
661
  argsTextDelta: (_l = toolCallDelta.function.arguments) != null ? _l : ""
583
662
  });
584
- if (((_m = toolCall.function) == null ? void 0 : _m.name) != null && ((_n = toolCall.function) == null ? void 0 : _n.arguments) != null && (0, import_provider_utils3.isParsableJson)(toolCall.function.arguments)) {
663
+ if (((_m = toolCall.function) == null ? void 0 : _m.name) != null && ((_n = toolCall.function) == null ? void 0 : _n.arguments) != null && (0, import_provider_utils4.isParsableJson)(toolCall.function.arguments)) {
585
664
  controller.enqueue({
586
665
  type: "tool-call",
587
666
  toolCallType: "function",
588
- toolCallId: (_o = toolCall.id) != null ? _o : (0, import_provider_utils3.generateId)(),
667
+ toolCallId: (_o = toolCall.id) != null ? _o : (0, import_provider_utils4.generateId)(),
589
668
  toolName: toolCall.function.name,
590
669
  args: toolCall.function.arguments
591
670
  });
@@ -680,7 +759,7 @@ var sarvamChatChunkSchema = import_zod2.z.union([
680
759
  ]);
681
760
 
682
761
  // src/sarvam-transcription-model.ts
683
- var import_provider_utils4 = require("@ai-sdk/provider-utils");
762
+ var import_provider_utils5 = require("@ai-sdk/provider-utils");
684
763
  var import_zod4 = require("zod");
685
764
 
686
765
  // src/sarvam-transcription-settings.ts
@@ -722,7 +801,7 @@ var SarvamTranscriptionModel = class {
722
801
  throw new Error(
723
802
  "Language code unknown is not supported for model saarika:v1"
724
803
  );
725
- const sarvamOptions = (0, import_provider_utils4.parseProviderOptions)({
804
+ const sarvamOptions = (0, import_provider_utils5.parseProviderOptions)({
726
805
  provider: "sarvam",
727
806
  providerOptions: {
728
807
  sarvam: __spreadValues(__spreadValues({}, providerOptions == null ? void 0 : providerOptions.sarvam), this.config.transcription)
@@ -763,15 +842,15 @@ var SarvamTranscriptionModel = class {
763
842
  value: response,
764
843
  responseHeaders,
765
844
  rawValue: rawResponse
766
- } = await (0, import_provider_utils4.postFormDataToApi)({
845
+ } = await (0, import_provider_utils5.postFormDataToApi)({
767
846
  url: this.config.url({
768
847
  path: "/speech-to-text",
769
848
  modelId: this.modelId
770
849
  }),
771
- headers: (0, import_provider_utils4.combineHeaders)(this.config.headers(), options.headers),
850
+ headers: (0, import_provider_utils5.combineHeaders)(this.config.headers(), options.headers),
772
851
  formData,
773
852
  failedResponseHandler: sarvamFailedResponseHandler,
774
- successfulResponseHandler: (0, import_provider_utils4.createJsonResponseHandler)(
853
+ successfulResponseHandler: (0, import_provider_utils5.createJsonResponseHandler)(
775
854
  sarvamTranscriptionResponseSchema
776
855
  ),
777
856
  abortSignal: options.abortSignal,
@@ -818,7 +897,7 @@ var sarvamTranscriptionResponseSchema = import_zod4.z.object({
818
897
  });
819
898
 
820
899
  // src/sarvam-speech-model.ts
821
- var import_provider_utils5 = require("@ai-sdk/provider-utils");
900
+ var import_provider_utils6 = require("@ai-sdk/provider-utils");
822
901
 
823
902
  // src/sarvam-speech-settings.ts
824
903
  var import_zod5 = require("zod");
@@ -878,7 +957,7 @@ var SarvamSpeechModel = class {
878
957
  providerOptions
879
958
  }) {
880
959
  const warnings = [];
881
- const sarvamOptions = (0, import_provider_utils5.parseProviderOptions)({
960
+ const sarvamOptions = (0, import_provider_utils6.parseProviderOptions)({
882
961
  provider: "sarvam",
883
962
  providerOptions: {
884
963
  sarvam: __spreadValues(__spreadValues({}, providerOptions == null ? void 0 : providerOptions.sarvam), this.config.speech)
@@ -942,15 +1021,15 @@ var SarvamSpeechModel = class {
942
1021
  value,
943
1022
  responseHeaders,
944
1023
  rawValue: rawResponse
945
- } = await (0, import_provider_utils5.postJsonToApi)({
1024
+ } = await (0, import_provider_utils6.postJsonToApi)({
946
1025
  url: this.config.url({
947
1026
  path: "/text-to-speech",
948
1027
  modelId: this.modelId
949
1028
  }),
950
- headers: (0, import_provider_utils5.combineHeaders)(this.config.headers(), options.headers),
1029
+ headers: (0, import_provider_utils6.combineHeaders)(this.config.headers(), options.headers),
951
1030
  body: requestBody,
952
1031
  failedResponseHandler: sarvamFailedResponseHandler,
953
- successfulResponseHandler: (0, import_provider_utils5.createJsonResponseHandler)(
1032
+ successfulResponseHandler: (0, import_provider_utils6.createJsonResponseHandler)(
954
1033
  import_zod6.z.object({
955
1034
  request_id: import_zod6.z.string(),
956
1035
  audios: import_zod6.z.array(import_zod6.z.string())
@@ -979,8 +1058,8 @@ var SarvamSpeechModel = class {
979
1058
  // src/sarvam-provider.ts
980
1059
  function createSarvam(options = {}) {
981
1060
  var _a;
982
- const baseURL = (_a = (0, import_provider_utils6.withoutTrailingSlash)(options.baseURL)) != null ? _a : "https://api.sarvam.ai";
983
- const ApiKey = (0, import_provider_utils6.loadApiKey)({
1061
+ const baseURL = (_a = (0, import_provider_utils7.withoutTrailingSlash)(options.baseURL)) != null ? _a : "https://api.sarvam.ai";
1062
+ const ApiKey = (0, import_provider_utils7.loadApiKey)({
984
1063
  apiKey: options.apiKey,
985
1064
  environmentVariableName: "SARVAM_API_KEY",
986
1065
  description: "Sarvam"