sarvam-ai-sdk 0.4.1 → 0.4.2-beta
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 +172 -157
- package/dist/index.d.ts +32 -15
- package/dist/index.js +286 -238
- package/package.json +14 -10
- package/dist/index.cjs +0 -1277
- package/dist/index.d.cts +0 -496
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<a href="https://github.com/
|
|
2
|
-
<img alt="cover" src="https://github.com/
|
|
1
|
+
<a href="https://github.com/sarvamai/sarvam-ai-sdk">
|
|
2
|
+
<img alt="cover" src="https://github.com/sarvamai/sarvam-ai-sdk/blob/master/cover.png?raw=true" />
|
|
3
3
|
</a>
|
|
4
4
|
|
|
5
5
|
# AI SDK - Sarvam Provider
|
|
6
6
|
|
|
7
|
-
The **[Sarvam provider](https://
|
|
7
|
+
The **[Sarvam provider](https://v7.ai-sdk.dev/providers/community-providers/sarvam)** for the [AI SDK](https://v7.ai-sdk.dev/docs)
|
|
8
8
|
contains language model support for the Sarvam chat completion, Text-to-Speech and Speech-to-Text APIs.
|
|
9
9
|
|
|
10
10
|
## Setup
|
|
@@ -12,19 +12,29 @@ contains language model support for the Sarvam chat completion, Text-to-Speech a
|
|
|
12
12
|
The **[Sarvam](http://sarvam.ai)** provider is available in the `sarvam-ai-sdk` module. You can install it with
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
npm i sarvam-ai-sdk ai@
|
|
15
|
+
npm i sarvam-ai-sdk ai@7
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
> [!WARNING]
|
|
19
|
-
> This package only works with Vercel AI-SDK
|
|
19
|
+
> This package only works with Vercel AI-SDK v7, not v8. Make sure to install `ai@7` in your project.
|
|
20
|
+
|
|
21
|
+
### Version Compatibility
|
|
22
|
+
|
|
23
|
+
| Sarvam AI SDK Version | Vercel AI SDK Version |
|
|
24
|
+
|-----------------------|-----------------------|
|
|
25
|
+
| 0.5.x (beta) | 8.x.x (beta) |
|
|
26
|
+
| 0.4.x (current) | 7.x.x (current) |
|
|
27
|
+
| 0.3.x | 6.x.x |
|
|
28
|
+
| 0.2.x | 5.x.x |
|
|
29
|
+
| 0.1.x | 4.x.x |
|
|
20
30
|
|
|
21
31
|
## Provider Instance
|
|
22
32
|
|
|
23
33
|
You can import the default provider instance `sarvam` from `sarvam-ai-sdk`:
|
|
24
34
|
|
|
25
|
-
```ts
|
|
26
|
-
import { sarvam } from
|
|
27
|
-
```
|
|
35
|
+
```ts
|
|
36
|
+
import { sarvam } from "sarvam-ai-sdk";
|
|
37
|
+
```
|
|
28
38
|
|
|
29
39
|
Create `.env` file with API key from **[Sarvam Dashboard](https://dashboard.sarvam.ai/)**
|
|
30
40
|
```bash
|
|
@@ -33,182 +43,187 @@ SARVAM_API_KEY="your_api_key"
|
|
|
33
43
|
|
|
34
44
|
## Example
|
|
35
45
|
|
|
36
|
-
```ts
|
|
37
|
-
import { sarvam } from
|
|
38
|
-
import { generateText } from
|
|
39
|
-
|
|
40
|
-
const { text } = await generateText({
|
|
41
|
-
model: sarvam("sarvam-30b"
|
|
42
|
-
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
```ts
|
|
47
|
+
import { sarvam } from "sarvam-ai-sdk";
|
|
48
|
+
import { generateText } from "ai";
|
|
49
|
+
|
|
50
|
+
const { text } = await generateText({
|
|
51
|
+
model: sarvam("sarvam-30b", {
|
|
52
|
+
reasoning_effort: "low",
|
|
53
|
+
}),
|
|
54
|
+
prompt: "Translate this to malayalam: 'Keep cooking, guys'",
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
console.log(text); // പചക തടര, സഹതകള
|
|
58
|
+
```
|
|
47
59
|
|
|
48
60
|
## Text-to-Speech
|
|
49
61
|
|
|
50
|
-
```ts
|
|
51
|
-
import { sarvam } from "sarvam-ai-sdk";
|
|
52
|
-
import {
|
|
53
|
-
import { writeFile } from "fs/promises";
|
|
54
|
-
|
|
55
|
-
const { audio } = await generateSpeech({
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
const audioBuffer = Buffer.from(audio.base64, "base64")
|
|
61
|
-
await writeFile("./src/transcript-test.wav", audioBuffer);
|
|
62
|
-
```
|
|
62
|
+
```ts
|
|
63
|
+
import { sarvam } from "sarvam-ai-sdk";
|
|
64
|
+
import { generateSpeech } from "ai";
|
|
65
|
+
import { writeFile } from "fs/promises";
|
|
66
|
+
|
|
67
|
+
const { audio } = await generateSpeech({
|
|
68
|
+
model: sarvam.speech("bulbul:v3", "ml-IN"),
|
|
69
|
+
text: "പചക തടര, സഹതകള",
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const audioBuffer = Buffer.from(audio.base64, "base64");
|
|
73
|
+
await writeFile("./src/transcript-test.wav", audioBuffer);
|
|
74
|
+
```
|
|
63
75
|
|
|
64
76
|
## Speech-to-Text
|
|
65
77
|
|
|
66
|
-
```ts
|
|
67
|
-
import { sarvam } from "sarvam-ai-sdk";
|
|
68
|
-
import {
|
|
69
|
-
import { readFile } from "fs/promises";
|
|
70
|
-
|
|
71
|
-
const { text } = await transcribe({
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
console.log(text); // Pachakam thudaroo, suhruthukkale.
|
|
77
|
-
```
|
|
78
|
+
```ts
|
|
79
|
+
import { sarvam } from "sarvam-ai-sdk";
|
|
80
|
+
import { transcribe } from "ai";
|
|
81
|
+
import { readFile } from "fs/promises";
|
|
82
|
+
|
|
83
|
+
const { text } = await transcribe({
|
|
84
|
+
model: sarvam.transcription("saaras:v3", "en-IN"),
|
|
85
|
+
audio: await readFile("./src/transcript-test.wav"),
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
console.log(text); // Pachakam thudaroo, suhruthukkale.
|
|
89
|
+
```
|
|
78
90
|
|
|
79
91
|
## Translation
|
|
80
92
|
|
|
81
93
|
> NB: Only translates `prompt` and `role:user` messages, not `role:system` not `role:assistant`.
|
|
82
94
|
|
|
83
|
-
```ts
|
|
84
|
-
import { sarvam } from "sarvam-ai-sdk";
|
|
85
|
-
import { generateText } from "ai";
|
|
86
|
-
|
|
87
|
-
const result = await generateText({
|
|
88
|
-
model: sarvam.translation("mayura:v1", {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
console.log(result.text); // Shouldn't we be careful about this, Ambane?
|
|
96
|
-
```
|
|
95
|
+
```ts
|
|
96
|
+
import { sarvam } from "sarvam-ai-sdk";
|
|
97
|
+
import { generateText } from "ai";
|
|
98
|
+
|
|
99
|
+
const result = await generateText({
|
|
100
|
+
model: sarvam.translation("mayura:v1", {
|
|
101
|
+
from: "ml-IN",
|
|
102
|
+
to: "en-IN",
|
|
103
|
+
}),
|
|
104
|
+
prompt: "ഇതക ശദകണ അബന?",
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
console.log(result.text); // Shouldn't we be careful about this, Ambane?
|
|
108
|
+
```
|
|
97
109
|
|
|
98
110
|
## Transliterate
|
|
99
111
|
|
|
100
112
|
> NB: Only transliterates `prompt` and `role:user` messages, not `role:system` not `role:assistant`.
|
|
101
113
|
|
|
102
|
-
```ts
|
|
103
|
-
import { sarvam } from "sarvam-ai-sdk";
|
|
104
|
-
import { generateText } from "ai";
|
|
105
|
-
|
|
106
|
-
const result = await generateText({
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
console.log(result.text); //
|
|
115
|
-
```
|
|
114
|
+
```ts
|
|
115
|
+
import { sarvam } from "sarvam-ai-sdk";
|
|
116
|
+
import { generateText } from "ai";
|
|
117
|
+
|
|
118
|
+
const result = await generateText({
|
|
119
|
+
model: sarvam.transliterate({
|
|
120
|
+
to: "ml-IN",
|
|
121
|
+
from: "en-IN", // optional
|
|
122
|
+
}),
|
|
123
|
+
prompt: "eda mone, happy alle?",
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
console.log(result.text); // എട മന, ഹപ അല?
|
|
127
|
+
```
|
|
116
128
|
|
|
117
129
|
## Language Identification
|
|
118
130
|
|
|
119
131
|
> NB: Only identifies `prompt` and `role:user` messages, not `role:system` not `role:assistant`.
|
|
120
132
|
|
|
121
|
-
```ts
|
|
122
|
-
import { sarvam } from "sarvam-ai-sdk";
|
|
123
|
-
import { generateText } from "ai";
|
|
124
|
-
|
|
125
|
-
const result = await generateText({
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
console.log(result.text); // ml-IN
|
|
131
|
-
```
|
|
133
|
+
```ts
|
|
134
|
+
import { sarvam } from "sarvam-ai-sdk";
|
|
135
|
+
import { generateText } from "ai";
|
|
136
|
+
|
|
137
|
+
const result = await generateText({
|
|
138
|
+
model: sarvam.languageIdentification(),
|
|
139
|
+
prompt: "ബദയണ സറ ഇവൻറ മയൻ",
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
console.log(result.text); // ml-IN
|
|
143
|
+
```
|
|
132
144
|
|
|
133
145
|
## Tool Calling
|
|
134
146
|
|
|
135
|
-
```ts
|
|
136
|
-
import { z } from "zod";
|
|
137
|
-
import { generateText, tool } from "ai";
|
|
138
|
-
import { sarvam } from "sarvam-ai-sdk";
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
import {
|
|
166
|
-
import {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
})
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
147
|
+
```ts
|
|
148
|
+
import { z } from "zod";
|
|
149
|
+
import { generateText, tool } from "ai";
|
|
150
|
+
import { sarvam } from "sarvam-ai-sdk";
|
|
151
|
+
|
|
152
|
+
const result = await generateText({
|
|
153
|
+
model: sarvam("sarvam-30b"),
|
|
154
|
+
tools: {
|
|
155
|
+
weather: tool({
|
|
156
|
+
description: "Get the weather in a location",
|
|
157
|
+
inputSchema: z.object({
|
|
158
|
+
location: z.string(),
|
|
159
|
+
}),
|
|
160
|
+
execute: async ({ location }) => ({
|
|
161
|
+
location,
|
|
162
|
+
temperature: 72 + Math.floor(Math.random() * 21) - 10,
|
|
163
|
+
}),
|
|
164
|
+
}),
|
|
165
|
+
},
|
|
166
|
+
instructions: "Your are a helpful AI",
|
|
167
|
+
prompt: "കചയല കലവസ എനണ?",
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
console.log(result.toolResults);
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Generating Structured Outputs
|
|
174
|
+
|
|
175
|
+
```ts
|
|
176
|
+
import { z } from "zod";
|
|
177
|
+
import { sarvam } from "sarvam-ai-sdk";
|
|
178
|
+
import { generateText, Output } from "ai";
|
|
179
|
+
|
|
180
|
+
const { output } = await generateText({
|
|
181
|
+
model: sarvam("sarvam-105b", {
|
|
182
|
+
// uncomment to enable direct JSON mode
|
|
183
|
+
// experimental_json_mode: true,
|
|
184
|
+
}),
|
|
185
|
+
output: Output.object({
|
|
186
|
+
name: "Recipe",
|
|
187
|
+
description: "A recipe with a name, ingredients and steps",
|
|
188
|
+
schema: z.object({
|
|
189
|
+
recipe: z.object({
|
|
190
|
+
name: z.string(),
|
|
191
|
+
ingredients: z.array(z.string()),
|
|
192
|
+
steps: z.array(z.string()),
|
|
193
|
+
}),
|
|
194
|
+
}),
|
|
195
|
+
}),
|
|
196
|
+
prompt: "Generate a South Indian recipe, in Malayalam",
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
console.log(output);
|
|
200
|
+
```
|
|
185
201
|
|
|
186
202
|
## All APIs
|
|
187
203
|
|
|
188
|
-
```ts
|
|
189
|
-
import { sarvam } from "sarvam-ai-sdk";
|
|
190
|
-
|
|
191
|
-
// Text-to-Text + Chat Completion
|
|
192
|
-
sarvam("sarvam-105b");
|
|
193
|
-
sarvam.languageModel("sarvam-30b");
|
|
194
|
-
|
|
195
|
-
// Text-to-Text + Transliteration
|
|
196
|
-
sarvam.transliterate({ to: "ml-IN", from: "en-IN" });
|
|
197
|
-
|
|
198
|
-
// Text-to-Text + Translation
|
|
199
|
-
sarvam.translation("mayura:v1", { from: "en-IN", to: "ml-IN" });
|
|
200
|
-
|
|
201
|
-
// Text-to-Text + Language identification
|
|
202
|
-
sarvam.languageIdentification();
|
|
203
|
-
|
|
204
|
-
// Text-to-Speech
|
|
205
|
-
sarvam.speech("bulbul:v3", "ml-IN");
|
|
206
|
-
|
|
207
|
-
// Speech-to-Text
|
|
208
|
-
sarvam.transcription("saaras:v3");
|
|
209
|
-
```
|
|
210
|
-
|
|
204
|
+
```ts
|
|
205
|
+
import { sarvam } from "sarvam-ai-sdk";
|
|
206
|
+
|
|
207
|
+
// Text-to-Text + Chat Completion
|
|
208
|
+
sarvam("sarvam-105b");
|
|
209
|
+
sarvam.languageModel("sarvam-30b");
|
|
210
|
+
|
|
211
|
+
// Text-to-Text + Transliteration
|
|
212
|
+
sarvam.transliterate({ to: "ml-IN", from: "en-IN" });
|
|
213
|
+
|
|
214
|
+
// Text-to-Text + Translation
|
|
215
|
+
sarvam.translation("mayura:v1", { from: "en-IN", to: "ml-IN" });
|
|
216
|
+
|
|
217
|
+
// Text-to-Text + Language identification
|
|
218
|
+
sarvam.languageIdentification();
|
|
219
|
+
|
|
220
|
+
// Text-to-Speech
|
|
221
|
+
sarvam.speech("bulbul:v3", "ml-IN");
|
|
222
|
+
|
|
223
|
+
// Speech-to-Text
|
|
224
|
+
sarvam.transcription("saaras:v3");
|
|
225
|
+
```
|
|
211
226
|
|
|
212
227
|
## Documentation
|
|
213
228
|
|
|
214
|
-
Please check out the **[Sarvam provider documentation](https://
|
|
229
|
+
Please check out the **[Sarvam provider documentation](https://v7.ai-sdk.dev/providers/community-providers/sarvam)** and **[Sarvam API documentation](https://docs.sarvam.ai)** for more information.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FetchFunction } from "@ai-sdk/provider-utils";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { LanguageModelV4, SpeechModelV4, TranscriptionModelV4 } from "@ai-sdk/provider";
|
|
3
|
+
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/config.d.ts
|
|
6
6
|
|
|
@@ -64,14 +64,18 @@ interface SarvamProviderSettings {
|
|
|
64
64
|
//#region src/chat/settings.d.ts
|
|
65
65
|
/**
|
|
66
66
|
* @description Production models
|
|
67
|
-
* @see https://
|
|
67
|
+
* @see https://docs.sarvam.ai/api-reference-docs/chat/chat-completions
|
|
68
68
|
*/
|
|
69
69
|
type ChatModelId = "sarvam-30b" | "sarvam-105b" | (string & {});
|
|
70
70
|
type ChatSettings = {
|
|
71
71
|
/**
|
|
72
|
-
* The effort to use for reasoning
|
|
72
|
+
* The effort to use for reasoning.
|
|
73
|
+
*
|
|
74
|
+
* Can be disabled by explicitly setting to "none".
|
|
75
|
+
*
|
|
76
|
+
* @default "medium"
|
|
73
77
|
*/
|
|
74
|
-
reasoning_effort?: "low" | "medium" | "high";
|
|
78
|
+
reasoning_effort?: "none" | "low" | "medium" | "high";
|
|
75
79
|
/**
|
|
76
80
|
* If set to true, the model response will be wiki grounded.
|
|
77
81
|
*/
|
|
@@ -83,6 +87,18 @@ type ChatSettings = {
|
|
|
83
87
|
* Keep `n` as `1` to minimize costs.
|
|
84
88
|
*/
|
|
85
89
|
n?: number;
|
|
90
|
+
/**
|
|
91
|
+
* Enables structured outputs, with or without a specified JSON schema.
|
|
92
|
+
*
|
|
93
|
+
* Early & Experimental, Sarvam model might not perform well.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* true: JSON is generated with response_format
|
|
97
|
+
* false: JSON is generated through tool calling argument
|
|
98
|
+
*
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
101
|
+
experimental_json_mode?: boolean;
|
|
86
102
|
};
|
|
87
103
|
//#endregion
|
|
88
104
|
//#region src/stt/transcription-settings.d.ts
|
|
@@ -390,13 +406,14 @@ type TransliterateSettings<S extends boolean = true, T extends SarvamLanguageCod
|
|
|
390
406
|
type SarvamProvider = {
|
|
391
407
|
/**
|
|
392
408
|
* Creates a model for text generation.
|
|
409
|
+
*
|
|
393
410
|
* @example
|
|
394
411
|
* const { text } = await generateText({
|
|
395
412
|
* model: sarvam("sarvam-30b"),
|
|
396
413
|
* prompt: "Translate this to malayalam: 'Keep cooking, guys'",
|
|
397
414
|
* });
|
|
398
415
|
*/
|
|
399
|
-
(modelId: ChatModelId, settings?: ChatSettings):
|
|
416
|
+
(modelId: ChatModelId, settings?: ChatSettings): LanguageModelV4;
|
|
400
417
|
/**
|
|
401
418
|
* Creates an Sarvam chat model for text generation.
|
|
402
419
|
*
|
|
@@ -406,7 +423,7 @@ type SarvamProvider = {
|
|
|
406
423
|
* prompt: "Translate this to malayalam: 'Keep cooking, guys'",
|
|
407
424
|
* });
|
|
408
425
|
*/
|
|
409
|
-
languageModel(modelId: ChatModelId, settings?: ChatSettings):
|
|
426
|
+
languageModel(modelId: ChatModelId, settings?: ChatSettings): LanguageModelV4;
|
|
410
427
|
/**
|
|
411
428
|
* Creates a Sarvam model for chat.
|
|
412
429
|
*
|
|
@@ -416,13 +433,13 @@ type SarvamProvider = {
|
|
|
416
433
|
* prompt: "Translate this to malayalam: 'Keep cooking, guys'",
|
|
417
434
|
* });
|
|
418
435
|
*/
|
|
419
|
-
chat(modelId: ChatModelId, settings?: ChatSettings):
|
|
436
|
+
chat(modelId: ChatModelId, settings?: ChatSettings): LanguageModelV4;
|
|
420
437
|
/**
|
|
421
438
|
* Creates a Sarvam model for transcription.
|
|
422
439
|
*
|
|
423
440
|
* @example
|
|
424
441
|
* const { text } = await transcribe({
|
|
425
|
-
* model: sarvam.transcription("saaras:
|
|
442
|
+
* model: sarvam.transcription("saaras:v4"),
|
|
426
443
|
* audio: await readFile("./audio.wav"),
|
|
427
444
|
* });
|
|
428
445
|
*/
|
|
@@ -433,18 +450,18 @@ type SarvamProvider = {
|
|
|
433
450
|
*
|
|
434
451
|
* @default "unknown"
|
|
435
452
|
*/
|
|
436
|
-
languageCode?: SarvamLanguageCode | MoreSarvamLanguageCode | "unknown", settings?: TranscriptionSettings<T>):
|
|
453
|
+
languageCode?: SarvamLanguageCode | MoreSarvamLanguageCode | "unknown", settings?: TranscriptionSettings<T>): TranscriptionModelV4;
|
|
437
454
|
/**
|
|
438
455
|
* Creates a Sarvam model for speech.
|
|
439
456
|
* @example
|
|
440
457
|
* const { audio } = await generateSpeech({
|
|
441
|
-
* model: sarvam.speech("bulbul:
|
|
458
|
+
* model: sarvam.speech("bulbul:v4", "ml-IN"),
|
|
442
459
|
* text: "പാചകം തുടരൂ, സുഹൃത്തുക്കളേ",
|
|
443
460
|
* });
|
|
444
461
|
*
|
|
445
462
|
* await writeFile("./audio.wav", Buffer.from(audio.base64, "base64"));
|
|
446
463
|
*/
|
|
447
|
-
speech<T extends SpeechModelId>(modelId: T, languageCode: SarvamLanguageCode, settings?: SpeechSettings<T>):
|
|
464
|
+
speech<T extends SpeechModelId>(modelId: T, languageCode: SarvamLanguageCode, settings?: SpeechSettings<T>): SpeechModelV4;
|
|
448
465
|
/**
|
|
449
466
|
* Creates an Sarvam model for transliterate.
|
|
450
467
|
*
|
|
@@ -457,7 +474,7 @@ type SarvamProvider = {
|
|
|
457
474
|
* prompt: "eda mone, happy alle?",
|
|
458
475
|
* });
|
|
459
476
|
*/
|
|
460
|
-
transliterate<T extends SarvamLanguageCode>(settings: TransliterateSettings<false, T>):
|
|
477
|
+
transliterate<T extends SarvamLanguageCode>(settings: TransliterateSettings<false, T>): LanguageModelV4;
|
|
461
478
|
/**
|
|
462
479
|
* Creates an Sarvam model for translation.
|
|
463
480
|
*
|
|
@@ -470,7 +487,7 @@ type SarvamProvider = {
|
|
|
470
487
|
* prompt: "ഇതൊക്കെ ശ്രദ്ധിക്കണ്ടേ അംബാനെ?",
|
|
471
488
|
* });
|
|
472
489
|
*/
|
|
473
|
-
translation<T extends TranslationModelId>(model: T, settings: TranslationSettings<T>):
|
|
490
|
+
translation<T extends TranslationModelId>(model: T, settings: TranslationSettings<T>): LanguageModelV4;
|
|
474
491
|
/**
|
|
475
492
|
* Creates an Sarvam model for language identification.
|
|
476
493
|
*
|
|
@@ -480,7 +497,7 @@ type SarvamProvider = {
|
|
|
480
497
|
* prompt: "ബുദ്ധിയാണ് സാറേ ഇവൻ്റെ മെയിൻ",
|
|
481
498
|
* });
|
|
482
499
|
*/
|
|
483
|
-
languageIdentification():
|
|
500
|
+
languageIdentification(): LanguageModelV4;
|
|
484
501
|
};
|
|
485
502
|
//#endregion
|
|
486
503
|
//#region src/provider.d.ts
|