krutrim-ai-sdk 0.1.0 → 0.1.1
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/CHANGELOG.md +10 -0
- package/README.md +34 -3
- package/dist/index.cjs +545 -124
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +95 -47
- package/dist/index.d.ts +95 -47
- package/dist/index.js +545 -124
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.1.1] — 2026-07-13
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **`transliterate({ to, from })`** — Sarvam-compatible DX (chat-backed; no dedicated Bhashik endpoint)
|
|
13
|
+
- **`languageIdentification()`** — alias of `languageDetection()` (Sarvam naming)
|
|
14
|
+
- **`summarization()`** / **`sentiment()`** — Bhashik Language Labs helpers
|
|
15
|
+
- Sarvam-style overloads: `speech(model, language)`, `transcription(model, language)`, `translation(model, settings)`
|
|
16
|
+
|
|
8
17
|
## [0.1.0] — 2026-07-13
|
|
9
18
|
|
|
10
19
|
### Added
|
|
@@ -21,4 +30,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
21
30
|
- India-aware error enrichment (rate limits, INR credits, region, invalid model)
|
|
22
31
|
- Examples, tests, MIT license, contributing docs
|
|
23
32
|
|
|
33
|
+
[0.1.1]: https://github.com/aljojoby9/krutrim-ai-sdk/releases/tag/v0.1.1
|
|
24
34
|
[0.1.0]: https://github.com/aljojoby9/krutrim-ai-sdk/releases/tag/v0.1.0
|
package/README.md
CHANGED
|
@@ -236,10 +236,12 @@ transliterationNotes('hi-IN');
|
|
|
236
236
|
indicSupportAgentPrompt({ brandName: 'PayApp' });
|
|
237
237
|
```
|
|
238
238
|
|
|
239
|
-
### Bhashik
|
|
239
|
+
### Bhashik / TTT helpers (Sarvam-style surface)
|
|
240
|
+
|
|
241
|
+
Same idea as [sarvam-ai-sdk](https://github.com/sarvamai/sarvam-ai-sdk): language ID, translation, transliteration, speech, STT — plus Krutrim extras.
|
|
240
242
|
|
|
241
243
|
```ts
|
|
242
|
-
// Language detection
|
|
244
|
+
// Language detection (also: languageIdentification())
|
|
243
245
|
await generateText({
|
|
244
246
|
model: krutrim.languageDetection(),
|
|
245
247
|
prompt: 'എന്തൊരു മനോഹരമായ ദിവസം!',
|
|
@@ -251,6 +253,22 @@ await generateText({
|
|
|
251
253
|
prompt: 'आज मौसम बहुत सुहाना है।',
|
|
252
254
|
});
|
|
253
255
|
|
|
256
|
+
// Transliteration (chat-backed; same DX as Sarvam)
|
|
257
|
+
await generateText({
|
|
258
|
+
model: krutrim.transliterate({ to: 'hi-IN', from: 'en-IN' }),
|
|
259
|
+
prompt: 'namaste, aap kaise ho?',
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
// Summarization / sentiment (Bhashik Language Labs)
|
|
263
|
+
await generateText({
|
|
264
|
+
model: krutrim.summarization({ language: 'hin', summarySize: 40 }),
|
|
265
|
+
prompt: '…long Hindi article…',
|
|
266
|
+
});
|
|
267
|
+
await generateText({
|
|
268
|
+
model: krutrim.sentiment({ language: 'eng' }),
|
|
269
|
+
prompt: 'The service was excellent!',
|
|
270
|
+
});
|
|
271
|
+
|
|
254
272
|
// Embeddings
|
|
255
273
|
await embed({
|
|
256
274
|
model: krutrim.embedding('Vyakyarth'),
|
|
@@ -285,11 +303,22 @@ krutrim.chat('deepseek-r1');
|
|
|
285
303
|
krutrim.embedding('Vyakyarth');
|
|
286
304
|
krutrim.textEmbeddingModel('Bhasantarit');
|
|
287
305
|
|
|
288
|
-
//
|
|
306
|
+
// Speech / STT (language-first or Sarvam-style model + language)
|
|
289
307
|
krutrim.speech('hi-IN');
|
|
308
|
+
krutrim.speech('Krutrim-TTS', 'hi-IN');
|
|
290
309
|
krutrim.transcription('ta-IN');
|
|
310
|
+
krutrim.transcription('Krutrim-Dhwani', 'ta-IN');
|
|
311
|
+
|
|
312
|
+
// Language ID / translation / transliterate
|
|
291
313
|
krutrim.languageDetection();
|
|
314
|
+
krutrim.languageIdentification(); // alias
|
|
292
315
|
krutrim.translation({ from: 'hi-IN', to: 'en-IN' });
|
|
316
|
+
krutrim.translation('krutrim-translate-v1.0', { from: 'hi-IN', to: 'en-IN' });
|
|
317
|
+
krutrim.transliterate({ to: 'hi-IN', from: 'en-IN' });
|
|
318
|
+
|
|
319
|
+
// Bhashik extras
|
|
320
|
+
krutrim.summarization({ language: 'hin' });
|
|
321
|
+
krutrim.sentiment({ language: 'eng' });
|
|
293
322
|
```
|
|
294
323
|
|
|
295
324
|
Base URL: `https://cloud.olakrutrim.com/v1`
|
|
@@ -325,6 +354,8 @@ npx tsx --env-file=.env examples/generate-text.ts
|
|
|
325
354
|
- [x] Indic prompt helpers + India-aware errors
|
|
326
355
|
- [x] Embeddings (Vyakyarth / Bhasantarit)
|
|
327
356
|
- [x] Bhashik TTS / STT / LID / translation (lightweight)
|
|
357
|
+
- [x] Transliterate + languageIdentification (Sarvam-compatible surface)
|
|
358
|
+
- [x] Summarization + sentiment (Bhashik)
|
|
328
359
|
- [ ] Official listing under AI SDK [community providers](https://ai-sdk.dev/providers/community-providers)
|
|
329
360
|
- [ ] Image generation helpers (diffusion / multimodal)
|
|
330
361
|
- [ ] AI SDK v7 (`LanguageModelV4`) track
|