Skip to content

Commit a1ff602

Browse files
committed
Merge remote-tracking branch 'origin/v5' into v5-5721
* origin/v5: feat(providers/hume): add speech (#5727) (#5814) feat(providers/revai): add transcribe (#5730) (#5807) chore (ci): enable turbo concurrency for testing (#5839) chore: store responses and support simpler configuration for MockLanguageModelV2 (#5838) chore: update test expectations and guide to node 22 (#5829) chore (build): add test:update and test:watch targets (#5828) Version Packages (canary) (#5789) chore: move warnings into stream-start part (spec) (#5808)
2 parents 658cffb + 018f3c7 commit a1ff602

File tree

185 files changed

+5451
-2049
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+5451
-2049
lines changed

.changeset/eight-emus-push.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ai-sdk/provider': major
3+
---
4+
5+
chore: move warnings into stream-start part (spec)

.changeset/fair-cups-travel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ai-sdk/revai': patch
3+
---
4+
5+
feat(providers/revai): add transcribe

.changeset/pre.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
"@vercel/ai-tsconfig": "0.0.0",
5454
"analyze-downloads": "0.0.0",
5555
"generate-llms-txt": "0.0.0",
56-
"@ai-sdk/rsc": "1.0.0-canary.1"
56+
"@ai-sdk/rsc": "1.0.0-canary.1",
57+
"@ai-sdk/elevenlabs": "1.0.0-canary.0"
5758
},
5859
"changesets": [
5960
"afraid-moles-cross",
@@ -62,27 +63,33 @@
6263
"angry-poems-learn",
6364
"beige-ligers-kneel",
6465
"beige-penguins-greet",
66+
"beige-socks-stare",
6567
"big-panthers-judge",
6668
"brown-poems-boil",
6769
"chilled-queens-remember",
6870
"clean-numbers-cover",
6971
"cool-buckets-shout",
72+
"cool-shrimps-kick",
7073
"cuddly-icons-kick",
7174
"cuddly-kangaroos-double",
7275
"dull-candles-trade",
76+
"eight-emus-push",
7377
"eighty-seals-search",
7478
"eleven-lobsters-rescue",
7579
"fair-cobras-tan",
80+
"fifty-camels-visit",
7681
"fix-env-mutation",
7782
"flat-plums-bake",
7883
"fluffy-pets-pump",
84+
"fresh-forks-punch",
7985
"gentle-gorillas-mate",
8086
"green-deers-scream",
8187
"happy-kangaroos-roll",
8288
"heavy-pens-destroy",
8389
"huge-cloths-burn",
8490
"hungry-bears-glow",
8591
"hungry-pets-hear",
92+
"hungry-zebras-applaud",
8693
"itchy-cars-relax",
8794
"late-brooms-suffer",
8895
"late-foxes-battle",
@@ -97,10 +104,12 @@
97104
"nine-jars-hammer",
98105
"odd-vans-suffer",
99106
"old-moons-kiss",
107+
"olive-candles-compare",
100108
"pink-deers-switch",
101109
"pretty-bikes-appear",
102110
"pretty-jars-reflect",
103111
"quick-toys-help",
112+
"rich-days-call",
104113
"rotten-peaches-doubt",
105114
"rotten-walls-provide",
106115
"selfish-rice-own",
@@ -112,13 +121,15 @@
112121
"smooth-mirrors-kneel",
113122
"strange-apricots-enjoy",
114123
"strange-camels-decide",
124+
"sweet-turtles-kiss",
115125
"tall-rice-flash",
116126
"tender-buses-glow",
117127
"tender-tables-trade",
118128
"thick-chairs-remain",
119129
"thin-items-knock",
120130
"thin-numbers-shave",
121131
"tiny-deers-kick",
132+
"tough-suns-eat",
122133
"tricky-hats-fly",
123134
"tricky-zebras-cover",
124135
"twelve-kids-travel",
@@ -127,6 +138,7 @@
127138
"wicked-flowers-study",
128139
"wild-candles-judge",
129140
"wild-cats-work",
141+
"witty-candles-pretend",
130142
"yellow-ligers-brake"
131143
]
132144
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ai-sdk/hume': patch
3+
---
4+
5+
feat(providers/hume): add speech

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ We welcome your contributions to our code and documentation. Here's how you can
3232

3333
### Environment Setup
3434

35-
AI SDK development requires PNPM v9 (lockfile version) or higher and Node v20 or higher.
35+
AI SDK development requires PNPM v9 (lockfile version) or higher and Node v22.
3636

3737
### Setting Up the Repository Locally
3838

3939
To set up the repository on your local machine, follow these steps:
4040

4141
1. **Fork the Repository**: Make a copy of the repository to your GitHub account.
4242
2. **Clone the Repository**: Clone the repository to your local machine, e.g. using `git clone`.
43-
3. **Install Node**: If you haven't already, install Node v20.
43+
3. **Install Node**: If you haven't already, install Node v22.
4444
4. **Install pnpm**: If you haven't already, install pnpm v9. You can do this by running `npm install -g pnpm@9` if you're using npm. Alternatively, if you're using Homebrew (Mac), you can run `brew install pnpm`. For more see [the pnpm site](https://pnpm.io/installation).
4545
5. **Install Dependencies**: Navigate to the project directory and run `pnpm install` to install all necessary dependencies.
4646
6. **Build the Project**: Run `pnpm build` in the root to build all packages.

content/docs/02-foundations/02-providers-and-models.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ The AI SDK comes with a wide range of providers that you can use to interact wit
4141
- [Groq Provider](/providers/ai-sdk-providers/groq) (`@ai-sdk/groq`)
4242
- [Perplexity Provider](/providers/ai-sdk-providers/perplexity) (`@ai-sdk/perplexity`)
4343
- [ElevenLabs Provider](/providers/ai-sdk-providers/elevenlabs) (`@ai-sdk/elevenlabs`)
44-
- [LMNT Provider](/providers/ai-sdk-providers/lmnt) (`@ai-sdk/lmnt`)
4544
- [Hume Provider](/providers/ai-sdk-providers/hume) (`@ai-sdk/hume`)
4645
- [Rev.ai Provider](/providers/ai-sdk-providers/revai) (`@ai-sdk/revai`)
46+
- [LMNT Provider](/providers/ai-sdk-providers/lmnt) (`@ai-sdk/lmnt`)
4747
- [Deepgram Provider](/providers/ai-sdk-providers/deepgram) (`@ai-sdk/deepgram`)
4848

4949
You can also use the [OpenAI Compatible provider](/providers/openai-compatible-providers) with OpenAI-compatible APIs:

content/docs/03-ai-sdk-core/37-speech.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,5 +145,6 @@ try {
145145
| [OpenAI](/providers/ai-sdk-providers/openai#speech-models) | `tts-1` |
146146
| [OpenAI](/providers/ai-sdk-providers/openai#speech-models) | `tts-1-hd` |
147147
| [OpenAI](/providers/ai-sdk-providers/openai#speech-models) | `gpt-4o-mini-tts` |
148+
| [Hume](/providers/ai-sdk-providers/hume#speech-models) | `default` |
148149

149150
Above are a small subset of the speech models supported by the AI SDK providers. For more, see the respective provider documentation.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
title: Hume
3+
description: Learn how to use the Hume provider for the AI SDK.
4+
---
5+
6+
# Hume Provider
7+
8+
The [Hume](https://hume.ai/) provider contains language model support for the Hume transcription API.
9+
10+
## Setup
11+
12+
The Hume provider is available in the `@ai-sdk/hume` module. You can install it with
13+
14+
<Tabs items={['pnpm', 'npm', 'yarn']}>
15+
<Tab>
16+
<Snippet text="pnpm add @ai-sdk/hume" dark />
17+
</Tab>
18+
<Tab>
19+
<Snippet text="npm install @ai-sdk/hume" dark />
20+
</Tab>
21+
<Tab>
22+
<Snippet text="yarn add @ai-sdk/hume" dark />
23+
</Tab>
24+
</Tabs>
25+
26+
## Provider Instance
27+
28+
You can import the default provider instance `hume` from `@ai-sdk/hume`:
29+
30+
```ts
31+
import { hume } from '@ai-sdk/hume';
32+
```
33+
34+
If you need a customized setup, you can import `createHume` from `@ai-sdk/hume` and create a provider instance with your settings:
35+
36+
```ts
37+
import { createHume } from '@ai-sdk/hume';
38+
39+
const hume = createHume({
40+
// custom settings, e.g.
41+
fetch: customFetch,
42+
});
43+
```
44+
45+
You can use the following optional settings to customize the Hume provider instance:
46+
47+
- **apiKey** _string_
48+
49+
API key that is being sent using the `Authorization` header.
50+
It defaults to the `HUME_API_KEY` environment variable.
51+
52+
- **headers** _Record&lt;string,string&gt;_
53+
54+
Custom headers to include in the requests.
55+
56+
- **fetch** _(input: RequestInfo, init?: RequestInit) => Promise&lt;Response&gt;_
57+
58+
Custom [fetch](https://developer.mozilla.org/en-US/docs/Web/API/fetch) implementation.
59+
Defaults to the global `fetch` function.
60+
You can use it as a middleware to intercept requests,
61+
or to provide a custom fetch implementation for e.g. testing.
62+
63+
## Speech Models
64+
65+
You can create models that call the [Hume speech API](https://dev.hume.ai/docs/text-to-speech-tts/overview)
66+
using the `.speech()` factory method.
67+
68+
```ts
69+
const model = hume.speech();
70+
```
71+
72+
You can also pass additional provider-specific options using the `providerOptions` argument. For example, supplying a voice to use for the generated audio.
73+
74+
```ts highlight="6"
75+
import { experimental_generateSpeech as generateSpeech } from 'ai';
76+
import { hume } from '@ai-sdk/hume';
77+
78+
const result = await generateSpeech({
79+
model: hume.speech(),
80+
text: 'Hello, world!',
81+
voice: 'd8ab67c6-953d-4bd8-9370-8fa53a0f1453',
82+
providerOptions: { hume: {} },
83+
});
84+
```
85+
86+
The following provider options are available:
87+
88+
- **context** _object_
89+
90+
Either:
91+
92+
- `{ generationId: string }` - A generation ID to use for context.
93+
- `{ utterances: HumeUtterance[] }` - An array of utterance objects for context.
94+
95+
### Model Capabilities
96+
97+
| Model | Instructions |
98+
| --------- | ------------------- |
99+
| `default` | <Check size={18} /> |

0 commit comments

Comments
 (0)