@ai-sdk/azure 3.0.130 → 3.0.131
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 +8 -0
- package/dist/index.d.mts +20 -6
- package/dist/index.d.ts +20 -6
- package/dist/index.js +380 -74
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +384 -64
- package/dist/index.mjs.map +1 -1
- package/docs/04-azure.mdx +104 -18
- package/package.json +1 -1
- package/src/azure-openai-provider.ts +101 -19
- package/src/azure-speech-model-options.ts +33 -0
- package/src/azure-speech-speech-model-options.ts +27 -0
- package/src/azure-speech-speech-model.ts +282 -0
- package/src/azure-speech-transcription-model.ts +6 -5
- package/src/azure-transcription-model-options.ts +13 -3
- package/src/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @ai-sdk/azure
|
|
2
2
|
|
|
3
|
+
## 3.0.131
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b98e43b: Route `mai-transcribe-1.5` to the Azure Speech API by default, like `mai-transcribe-2`. MAI-Transcribe-1.5 requests no longer send the `segment` timestamps default, which the model rejects.
|
|
8
|
+
- 2443982: Add MAI-Voice-2-Flash and MAI-Voice-2 speech generation through `azure.speech()` using Azure Speech text to speech (SSML), with voice, output format, speed, and `style`/`styleDegree` provider options. `language` picks a default voice when no voice is set. Select the API with `providerOptions.azure.api` to override model-based routing, and add `azure.speechModel()` as an alias of `azure.speech()`.
|
|
9
|
+
- e66dcd5: Reject an Azure `resourceName` that is not a single DNS label, so a malformed value cannot rewrite the request host.
|
|
10
|
+
|
|
3
11
|
## 3.0.130
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -60,8 +60,8 @@ interface AzureOpenAIProvider extends ProviderV3 {
|
|
|
60
60
|
*/
|
|
61
61
|
imageModel(deploymentId: string): ImageModelV3;
|
|
62
62
|
/**
|
|
63
|
-
* Creates an Azure transcription model. MAI-Transcribe
|
|
64
|
-
* by default; other IDs use OpenAI. Override with providerOptions.azure.api.
|
|
63
|
+
* Creates an Azure transcription model. MAI-Transcribe models use the Speech
|
|
64
|
+
* API by default; other IDs use OpenAI. Override with providerOptions.azure.api.
|
|
65
65
|
*/
|
|
66
66
|
transcription(deploymentId: string): TranscriptionModelV3;
|
|
67
67
|
/**
|
|
@@ -69,9 +69,14 @@ interface AzureOpenAIProvider extends ProviderV3 {
|
|
|
69
69
|
*/
|
|
70
70
|
transcriptionModel(deploymentId: string): TranscriptionModelV3;
|
|
71
71
|
/**
|
|
72
|
-
* Creates an Azure
|
|
72
|
+
* Creates an Azure speech generation model. MAI-Voice models use the Speech
|
|
73
|
+
* API by default; other IDs use OpenAI. Override with providerOptions.azure.api.
|
|
73
74
|
*/
|
|
74
75
|
speech(deploymentId: string): SpeechModelV3;
|
|
76
|
+
/**
|
|
77
|
+
* Creates an Azure speech generation model. Alias of `speech`.
|
|
78
|
+
*/
|
|
79
|
+
speechModel(deploymentId: string): SpeechModelV3;
|
|
75
80
|
/**
|
|
76
81
|
* AzureOpenAI-specific tools.
|
|
77
82
|
*/
|
|
@@ -82,6 +87,7 @@ interface AzureOpenAIProviderSettings {
|
|
|
82
87
|
* Name of the Azure OpenAI resource. Either this or `baseURL` can be used.
|
|
83
88
|
*
|
|
84
89
|
* The resource name is used in the assembled URL: `https://{resourceName}.openai.azure.com/openai/v1{path}`.
|
|
90
|
+
* It must be a single DNS label (letters, digits, and hyphens).
|
|
85
91
|
*/
|
|
86
92
|
resourceName?: string;
|
|
87
93
|
/**
|
|
@@ -124,8 +130,9 @@ interface AzureOpenAIProviderSettings {
|
|
|
124
130
|
*/
|
|
125
131
|
useDeploymentBasedUrls?: boolean;
|
|
126
132
|
/**
|
|
127
|
-
* URL prefix for Azure Speech
|
|
128
|
-
* regional endpoint like
|
|
133
|
+
* URL prefix for Azure Speech (MAI-Transcribe transcription and MAI-Voice
|
|
134
|
+
* speech), e.g. a regional endpoint like
|
|
135
|
+
* `https://eastus.api.cognitive.microsoft.com`.
|
|
129
136
|
* Defaults to `https://{resourceName}.cognitiveservices.azure.com`.
|
|
130
137
|
* Speech requests do not use `baseURL` or `apiVersion`.
|
|
131
138
|
*/
|
|
@@ -155,6 +162,13 @@ type AzureResponsesSourceDocumentProviderMetadata = {
|
|
|
155
162
|
|
|
156
163
|
declare const VERSION: string;
|
|
157
164
|
|
|
165
|
+
declare const azureSpeechModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
166
|
+
style?: string | undefined;
|
|
167
|
+
styleDegree?: number | undefined;
|
|
168
|
+
api?: "openai" | "speech" | undefined;
|
|
169
|
+
}>;
|
|
170
|
+
type AzureSpeechModelOptions = InferSchema<typeof azureSpeechModelOptions>;
|
|
171
|
+
|
|
158
172
|
declare const azureTranscriptionModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
159
173
|
timestamps?: "word" | "segment" | "none" | undefined;
|
|
160
174
|
transcribeStyle?: "verbatim" | "clean" | undefined;
|
|
@@ -191,4 +205,4 @@ type AzureDeepSeekLanguageModelOptions = Omit<DeepSeekLanguageModelOptions, 'thi
|
|
|
191
205
|
/** @deprecated Use `AzureDeepSeekLanguageModelOptions` instead. */
|
|
192
206
|
type AzureDeepSeekChatOptions = AzureDeepSeekLanguageModelOptions;
|
|
193
207
|
|
|
194
|
-
export { type AzureDeepSeekChatOptions, type AzureDeepSeekLanguageModelOptions, type AzureOpenAIProvider, type AzureOpenAIProviderSettings, type AzureResponsesProviderMetadata, type AzureResponsesReasoningProviderMetadata, type AzureResponsesSourceDocumentProviderMetadata, type AzureResponsesTextProviderMetadata, type AzureTranscriptionModelOptions, type AzureTranscriptionProviderMetadata, VERSION, azure, createAzure };
|
|
208
|
+
export { type AzureDeepSeekChatOptions, type AzureDeepSeekLanguageModelOptions, type AzureOpenAIProvider, type AzureOpenAIProviderSettings, type AzureResponsesProviderMetadata, type AzureResponsesReasoningProviderMetadata, type AzureResponsesSourceDocumentProviderMetadata, type AzureResponsesTextProviderMetadata, type AzureSpeechModelOptions, type AzureTranscriptionModelOptions, type AzureTranscriptionProviderMetadata, VERSION, azure, createAzure };
|
package/dist/index.d.ts
CHANGED
|
@@ -60,8 +60,8 @@ interface AzureOpenAIProvider extends ProviderV3 {
|
|
|
60
60
|
*/
|
|
61
61
|
imageModel(deploymentId: string): ImageModelV3;
|
|
62
62
|
/**
|
|
63
|
-
* Creates an Azure transcription model. MAI-Transcribe
|
|
64
|
-
* by default; other IDs use OpenAI. Override with providerOptions.azure.api.
|
|
63
|
+
* Creates an Azure transcription model. MAI-Transcribe models use the Speech
|
|
64
|
+
* API by default; other IDs use OpenAI. Override with providerOptions.azure.api.
|
|
65
65
|
*/
|
|
66
66
|
transcription(deploymentId: string): TranscriptionModelV3;
|
|
67
67
|
/**
|
|
@@ -69,9 +69,14 @@ interface AzureOpenAIProvider extends ProviderV3 {
|
|
|
69
69
|
*/
|
|
70
70
|
transcriptionModel(deploymentId: string): TranscriptionModelV3;
|
|
71
71
|
/**
|
|
72
|
-
* Creates an Azure
|
|
72
|
+
* Creates an Azure speech generation model. MAI-Voice models use the Speech
|
|
73
|
+
* API by default; other IDs use OpenAI. Override with providerOptions.azure.api.
|
|
73
74
|
*/
|
|
74
75
|
speech(deploymentId: string): SpeechModelV3;
|
|
76
|
+
/**
|
|
77
|
+
* Creates an Azure speech generation model. Alias of `speech`.
|
|
78
|
+
*/
|
|
79
|
+
speechModel(deploymentId: string): SpeechModelV3;
|
|
75
80
|
/**
|
|
76
81
|
* AzureOpenAI-specific tools.
|
|
77
82
|
*/
|
|
@@ -82,6 +87,7 @@ interface AzureOpenAIProviderSettings {
|
|
|
82
87
|
* Name of the Azure OpenAI resource. Either this or `baseURL` can be used.
|
|
83
88
|
*
|
|
84
89
|
* The resource name is used in the assembled URL: `https://{resourceName}.openai.azure.com/openai/v1{path}`.
|
|
90
|
+
* It must be a single DNS label (letters, digits, and hyphens).
|
|
85
91
|
*/
|
|
86
92
|
resourceName?: string;
|
|
87
93
|
/**
|
|
@@ -124,8 +130,9 @@ interface AzureOpenAIProviderSettings {
|
|
|
124
130
|
*/
|
|
125
131
|
useDeploymentBasedUrls?: boolean;
|
|
126
132
|
/**
|
|
127
|
-
* URL prefix for Azure Speech
|
|
128
|
-
* regional endpoint like
|
|
133
|
+
* URL prefix for Azure Speech (MAI-Transcribe transcription and MAI-Voice
|
|
134
|
+
* speech), e.g. a regional endpoint like
|
|
135
|
+
* `https://eastus.api.cognitive.microsoft.com`.
|
|
129
136
|
* Defaults to `https://{resourceName}.cognitiveservices.azure.com`.
|
|
130
137
|
* Speech requests do not use `baseURL` or `apiVersion`.
|
|
131
138
|
*/
|
|
@@ -155,6 +162,13 @@ type AzureResponsesSourceDocumentProviderMetadata = {
|
|
|
155
162
|
|
|
156
163
|
declare const VERSION: string;
|
|
157
164
|
|
|
165
|
+
declare const azureSpeechModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
166
|
+
style?: string | undefined;
|
|
167
|
+
styleDegree?: number | undefined;
|
|
168
|
+
api?: "openai" | "speech" | undefined;
|
|
169
|
+
}>;
|
|
170
|
+
type AzureSpeechModelOptions = InferSchema<typeof azureSpeechModelOptions>;
|
|
171
|
+
|
|
158
172
|
declare const azureTranscriptionModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
159
173
|
timestamps?: "word" | "segment" | "none" | undefined;
|
|
160
174
|
transcribeStyle?: "verbatim" | "clean" | undefined;
|
|
@@ -191,4 +205,4 @@ type AzureDeepSeekLanguageModelOptions = Omit<DeepSeekLanguageModelOptions, 'thi
|
|
|
191
205
|
/** @deprecated Use `AzureDeepSeekLanguageModelOptions` instead. */
|
|
192
206
|
type AzureDeepSeekChatOptions = AzureDeepSeekLanguageModelOptions;
|
|
193
207
|
|
|
194
|
-
export { type AzureDeepSeekChatOptions, type AzureDeepSeekLanguageModelOptions, type AzureOpenAIProvider, type AzureOpenAIProviderSettings, type AzureResponsesProviderMetadata, type AzureResponsesReasoningProviderMetadata, type AzureResponsesSourceDocumentProviderMetadata, type AzureResponsesTextProviderMetadata, type AzureTranscriptionModelOptions, type AzureTranscriptionProviderMetadata, VERSION, azure, createAzure };
|
|
208
|
+
export { type AzureDeepSeekChatOptions, type AzureDeepSeekLanguageModelOptions, type AzureOpenAIProvider, type AzureOpenAIProviderSettings, type AzureResponsesProviderMetadata, type AzureResponsesReasoningProviderMetadata, type AzureResponsesSourceDocumentProviderMetadata, type AzureResponsesTextProviderMetadata, type AzureSpeechModelOptions, type AzureTranscriptionModelOptions, type AzureTranscriptionProviderMetadata, VERSION, azure, createAzure };
|