@ai-sdk/azure 4.0.85 → 4.0.87

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 CHANGED
@@ -1,5 +1,30 @@
1
1
  # @ai-sdk/azure
2
2
 
3
+ ## 4.0.87
4
+
5
+ ### Patch Changes
6
+
7
+ - 527a163: fix: validate hostname parts using `isValidHostnamePart`
8
+ - Updated dependencies [8c65988]
9
+ - Updated dependencies [527a163]
10
+ - @ai-sdk/provider@4.0.21
11
+ - @ai-sdk/provider-utils@5.0.53
12
+ - @ai-sdk/openai@4.0.83
13
+ - @ai-sdk/deepseek@3.0.58
14
+
15
+ ## 4.0.86
16
+
17
+ ### Patch Changes
18
+
19
+ - ede5b89: chore: migrate package builds from tsup to tsdown
20
+ - Updated dependencies [040033b]
21
+ - Updated dependencies [ea54a10]
22
+ - Updated dependencies [ede5b89]
23
+ - @ai-sdk/openai@4.0.82
24
+ - @ai-sdk/deepseek@3.0.57
25
+ - @ai-sdk/provider@4.0.20
26
+ - @ai-sdk/provider-utils@5.0.52
27
+
3
28
  ## 4.0.85
4
29
 
5
30
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,195 +1,201 @@
1
- import { DeepSeekLanguageModelChatOptions } from '@ai-sdk/deepseek';
2
- export { OpenAILanguageModelChatOptions as OpenAIChatLanguageModelOptions, OpenAILanguageModelChatOptions, OpenAILanguageModelResponsesOptions, OpenAILanguageModelResponsesOptions as OpenAIResponsesProviderOptions, OpenAIResponsesSystemMessageOptions } from '@ai-sdk/openai';
3
- import { ProviderV4, LanguageModelV4, EmbeddingModelV4, ImageModelV4, TranscriptionModelV4, SpeechModelV4 } from '@ai-sdk/provider';
4
- import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
5
- import { FetchFunction, InferSchema } from '@ai-sdk/provider-utils';
6
- import { codeInterpreter, fileSearch, imageGeneration, webSearch, webSearchPreview, ResponsesProviderMetadata, ResponsesReasoningProviderMetadata, ResponsesSourceDocumentProviderMetadata, ResponsesTextProviderMetadata } from '@ai-sdk/openai/internal';
7
-
1
+ import { ResponsesProviderMetadata, ResponsesReasoningProviderMetadata, ResponsesSourceDocumentProviderMetadata, ResponsesTextProviderMetadata, codeInterpreter, fileSearch, imageGeneration, webSearch, webSearchPreview } from "@ai-sdk/openai/internal";
2
+ import { EmbeddingModelV4, ImageModelV4, LanguageModelV4, ProviderV4, SpeechModelV4, TranscriptionModelV4 } from "@ai-sdk/provider";
3
+ import { FetchFunction, InferSchema } from "@ai-sdk/provider-utils";
4
+ import { DeepSeekLanguageModelChatOptions } from "@ai-sdk/deepseek";
5
+ import { OpenAILanguageModelChatOptions, OpenAILanguageModelChatOptions as OpenAIChatLanguageModelOptions, OpenAILanguageModelResponsesOptions, OpenAILanguageModelResponsesOptions as OpenAIResponsesProviderOptions, OpenAIResponsesSystemMessageOptions } from "@ai-sdk/openai";
6
+ //#region src/azure-openai-tools.d.ts
8
7
  declare const azureOpenaiTools: {
9
- codeInterpreter: typeof codeInterpreter;
10
- fileSearch: typeof fileSearch;
11
- imageGeneration: typeof imageGeneration;
12
- webSearch: typeof webSearch;
13
- webSearchPreview: typeof webSearchPreview;
8
+ codeInterpreter: typeof codeInterpreter;
9
+ fileSearch: typeof fileSearch;
10
+ imageGeneration: typeof imageGeneration;
11
+ webSearch: typeof webSearch;
12
+ webSearchPreview: typeof webSearchPreview;
14
13
  };
15
-
14
+ //#endregion
15
+ //#region src/azure-openai-provider.d.ts
16
16
  interface AzureOpenAIProvider extends ProviderV4 {
17
- (deploymentId: string): LanguageModelV4;
18
- /**
19
- * Creates an Azure OpenAI responses API model for text generation.
20
- */
21
- languageModel(deploymentId: string): LanguageModelV4;
22
- /**
23
- * Creates an Azure OpenAI chat model for text generation.
24
- */
25
- chat(deploymentId: string): LanguageModelV4;
26
- /**
27
- * Creates an Azure-hosted DeepSeek chat model for text generation.
28
- */
29
- deepseek(deploymentId: string): LanguageModelV4;
30
- /**
31
- * Creates an Azure OpenAI responses API model for text generation.
32
- */
33
- responses(deploymentId: string): LanguageModelV4;
34
- /**
35
- * Creates an Azure OpenAI completion model for text generation.
36
- */
37
- completion(deploymentId: string): LanguageModelV4;
38
- /**
39
- * Creates an Azure OpenAI model for text embeddings.
40
- */
41
- embedding(deploymentId: string): EmbeddingModelV4;
42
- /**
43
- * Creates an Azure OpenAI model for text embeddings.
44
- */
45
- embeddingModel(deploymentId: string): EmbeddingModelV4;
46
- /**
47
- * @deprecated Use `embedding` instead.
48
- */
49
- textEmbedding(deploymentId: string): EmbeddingModelV4;
50
- /**
51
- * @deprecated Use `embeddingModel` instead.
52
- */
53
- textEmbeddingModel(deploymentId: string): EmbeddingModelV4;
54
- /**
55
- * Creates an Azure OpenAI DALL-E model for image generation.
56
- */
57
- image(deploymentId: string): ImageModelV4;
58
- /**
59
- * Creates an Azure OpenAI DALL-E model for image generation.
60
- */
61
- imageModel(deploymentId: string): ImageModelV4;
62
- /**
63
- * Creates an Azure transcription model. MAI-Transcribe-2 uses the Speech API
64
- * by default; other IDs use OpenAI. Override with providerOptions.azure.api.
65
- */
66
- transcription(deploymentId: string): TranscriptionModelV4;
67
- /**
68
- * Creates an Azure transcription model. Alias of `transcription`.
69
- */
70
- transcriptionModel(deploymentId: string): TranscriptionModelV4;
71
- /**
72
- * Creates an Azure OpenAI model for speech generation.
73
- */
74
- speech(deploymentId: string): SpeechModelV4;
75
- /**
76
- * AzureOpenAI-specific tools.
77
- */
78
- tools: typeof azureOpenaiTools;
17
+ (deploymentId: string): LanguageModelV4;
18
+ /**
19
+ * Creates an Azure OpenAI responses API model for text generation.
20
+ */
21
+ languageModel(deploymentId: string): LanguageModelV4;
22
+ /**
23
+ * Creates an Azure OpenAI chat model for text generation.
24
+ */
25
+ chat(deploymentId: string): LanguageModelV4;
26
+ /**
27
+ * Creates an Azure-hosted DeepSeek chat model for text generation.
28
+ */
29
+ deepseek(deploymentId: string): LanguageModelV4;
30
+ /**
31
+ * Creates an Azure OpenAI responses API model for text generation.
32
+ */
33
+ responses(deploymentId: string): LanguageModelV4;
34
+ /**
35
+ * Creates an Azure OpenAI completion model for text generation.
36
+ */
37
+ completion(deploymentId: string): LanguageModelV4;
38
+ /**
39
+ * Creates an Azure OpenAI model for text embeddings.
40
+ */
41
+ embedding(deploymentId: string): EmbeddingModelV4;
42
+ /**
43
+ * Creates an Azure OpenAI model for text embeddings.
44
+ */
45
+ embeddingModel(deploymentId: string): EmbeddingModelV4;
46
+ /**
47
+ * @deprecated Use `embedding` instead.
48
+ */
49
+ textEmbedding(deploymentId: string): EmbeddingModelV4;
50
+ /**
51
+ * @deprecated Use `embeddingModel` instead.
52
+ */
53
+ textEmbeddingModel(deploymentId: string): EmbeddingModelV4;
54
+ /**
55
+ * Creates an Azure OpenAI DALL-E model for image generation.
56
+ */
57
+ image(deploymentId: string): ImageModelV4;
58
+ /**
59
+ * Creates an Azure OpenAI DALL-E model for image generation.
60
+ */
61
+ imageModel(deploymentId: string): ImageModelV4;
62
+ /**
63
+ * Creates an Azure transcription model. MAI-Transcribe-2 uses the Speech API
64
+ * by default; other IDs use OpenAI. Override with providerOptions.azure.api.
65
+ */
66
+ transcription(deploymentId: string): TranscriptionModelV4;
67
+ /**
68
+ * Creates an Azure transcription model. Alias of `transcription`.
69
+ */
70
+ transcriptionModel(deploymentId: string): TranscriptionModelV4;
71
+ /**
72
+ * Creates an Azure OpenAI model for speech generation.
73
+ */
74
+ speech(deploymentId: string): SpeechModelV4;
75
+ /**
76
+ * AzureOpenAI-specific tools.
77
+ */
78
+ tools: typeof azureOpenaiTools;
79
79
  }
80
80
  interface AzureOpenAIProviderSettings {
81
- /**
82
- * Name of the Azure OpenAI resource. Either this or `baseURL` can be used.
83
- *
84
- * The resource name is used in the assembled URL: `https://{resourceName}.openai.azure.com/openai/v1{path}`.
85
- * It must be a single DNS label (letters, digits, and hyphens).
86
- */
87
- resourceName?: string;
88
- /**
89
- * Use a different URL prefix for API calls, e.g. to use proxy servers. Either this or `resourceName` can be used.
90
- * When a baseURL is provided, the resourceName is ignored.
91
- *
92
- * With an unversioned Azure OpenAI baseURL, the resolved URL is `{baseURL}/v1{path}`.
93
- * Azure OpenAI base URLs that already end in `/openai/v1` are used as-is.
94
- * With a non-Azure custom gateway baseURL, the resolved URL is `{baseURL}{path}`.
95
- */
96
- baseURL?: string;
97
- /**
98
- * API key for authenticating requests.
99
- */
100
- apiKey?: string;
101
- /**
102
- * A function that returns an access token for Microsoft Entra
103
- * (formerly known as Azure Active Directory), which will be invoked
104
- * on every request.
105
- */
106
- tokenProvider?: (() => Promise<string>) | undefined;
107
- /**
108
- * Custom headers to include in the requests.
109
- */
110
- headers?: Record<string, string>;
111
- /**
112
- * Custom fetch implementation. You can use it as a middleware to intercept requests,
113
- * or to provide a custom fetch implementation for e.g. testing.
114
- */
115
- fetch?: FetchFunction;
116
- /**
117
- * Custom api version to use. Defaults to `v1`.
118
- * Complete v1 base URLs are used as-is.
119
- */
120
- apiVersion?: string;
121
- /**
122
- * Use deployment-based URLs for specific model types. Set to true to use legacy deployment format:
123
- * `{baseURL}/deployments/{deploymentId}{path}?api-version={apiVersion}` instead of
124
- * `{baseURL}/v1{path}?api-version={apiVersion}`.
125
- */
126
- useDeploymentBasedUrls?: boolean;
127
- /**
128
- * URL prefix for Azure Speech transcription (MAI-Transcribe-2), e.g. a
129
- * regional endpoint like `https://eastus.api.cognitive.microsoft.com`.
130
- * Defaults to `https://{resourceName}.cognitiveservices.azure.com`.
131
- * Speech requests do not use `baseURL` or `apiVersion`.
132
- */
133
- speechBaseURL?: string;
81
+ /**
82
+ * Name of the Azure OpenAI resource. Either this or `baseURL` can be used.
83
+ *
84
+ * The resource name is used in the assembled URL: `https://{resourceName}.openai.azure.com/openai/v1{path}`.
85
+ * It must be a single DNS label (letters, digits, and hyphens).
86
+ */
87
+ resourceName?: string;
88
+ /**
89
+ * Use a different URL prefix for API calls, e.g. to use proxy servers. Either this or `resourceName` can be used.
90
+ * When a baseURL is provided, the resourceName is ignored.
91
+ *
92
+ * With an unversioned Azure OpenAI baseURL, the resolved URL is `{baseURL}/v1{path}`.
93
+ * Azure OpenAI base URLs that already end in `/openai/v1` are used as-is.
94
+ * With a non-Azure custom gateway baseURL, the resolved URL is `{baseURL}{path}`.
95
+ */
96
+ baseURL?: string;
97
+ /**
98
+ * API key for authenticating requests.
99
+ */
100
+ apiKey?: string;
101
+ /**
102
+ * A function that returns an access token for Microsoft Entra
103
+ * (formerly known as Azure Active Directory), which will be invoked
104
+ * on every request.
105
+ */
106
+ tokenProvider?: (() => Promise<string>) | undefined;
107
+ /**
108
+ * Custom headers to include in the requests.
109
+ */
110
+ headers?: Record<string, string>;
111
+ /**
112
+ * Custom fetch implementation. You can use it as a middleware to intercept requests,
113
+ * or to provide a custom fetch implementation for e.g. testing.
114
+ */
115
+ fetch?: FetchFunction;
116
+ /**
117
+ * Custom api version to use. Defaults to `v1`.
118
+ * Complete v1 base URLs are used as-is.
119
+ */
120
+ apiVersion?: string;
121
+ /**
122
+ * Use deployment-based URLs for specific model types. Set to true to use legacy deployment format:
123
+ * `{baseURL}/deployments/{deploymentId}{path}?api-version={apiVersion}` instead of
124
+ * `{baseURL}/v1{path}?api-version={apiVersion}`.
125
+ */
126
+ useDeploymentBasedUrls?: boolean;
127
+ /**
128
+ * URL prefix for Azure Speech transcription (MAI-Transcribe-2), e.g. a
129
+ * regional endpoint like `https://eastus.api.cognitive.microsoft.com`.
130
+ * Defaults to `https://{resourceName}.cognitiveservices.azure.com`.
131
+ * Speech requests do not use `baseURL` or `apiVersion`.
132
+ */
133
+ speechBaseURL?: string;
134
134
  }
135
135
  /**
136
136
  * Create an Azure OpenAI provider instance.
137
137
  */
138
- declare function createAzure(options?: AzureOpenAIProviderSettings): AzureOpenAIProvider;
138
+ export declare function createAzure(options?: AzureOpenAIProviderSettings): AzureOpenAIProvider;
139
139
  /**
140
140
  * Default Azure OpenAI provider instance.
141
141
  */
142
- declare const azure: AzureOpenAIProvider;
143
-
142
+ export declare const azure: AzureOpenAIProvider;
143
+ //#endregion
144
+ //#region src/azure-openai-provider-metadata.d.ts
144
145
  type AzureResponsesProviderMetadata = {
145
- azure: ResponsesProviderMetadata;
146
+ azure: ResponsesProviderMetadata;
146
147
  };
147
148
  type AzureResponsesReasoningProviderMetadata = {
148
- azure: ResponsesReasoningProviderMetadata;
149
+ azure: ResponsesReasoningProviderMetadata;
149
150
  };
150
151
  type AzureResponsesTextProviderMetadata = {
151
- azure: ResponsesTextProviderMetadata;
152
+ azure: ResponsesTextProviderMetadata;
152
153
  };
153
154
  type AzureResponsesSourceDocumentProviderMetadata = {
154
- azure: ResponsesSourceDocumentProviderMetadata;
155
+ azure: ResponsesSourceDocumentProviderMetadata;
155
156
  };
156
-
157
- declare const VERSION: string;
158
-
159
- declare const azureTranscriptionModelOptions: _ai_sdk_provider_utils.LazySchema<{
160
- timestamps?: "word" | "segment" | "none" | undefined;
161
- transcribeStyle?: "verbatim" | "clean" | undefined;
162
- locales?: string[] | undefined;
163
- diarization?: {
164
- enabled: boolean;
165
- } | undefined;
166
- phraseList?: {
167
- phrases: string[];
168
- } | undefined;
169
- api?: "openai" | "speech" | undefined;
157
+ //#endregion
158
+ //#region src/version.d.ts
159
+ export declare const VERSION: string;
160
+ //#endregion
161
+ //#region src/azure-transcription-model-options.d.ts
162
+ declare const azureTranscriptionModelOptions: import("@ai-sdk/provider-utils").LazySchema<{
163
+ timestamps?: "word" | "segment" | "none" | undefined;
164
+ transcribeStyle?: "verbatim" | "clean" | undefined;
165
+ locales?: string[] | undefined;
166
+ diarization?: {
167
+ enabled: boolean;
168
+ } | undefined;
169
+ phraseList?: {
170
+ phrases: string[];
171
+ } | undefined;
172
+ api?: "openai" | "speech" | undefined;
170
173
  }>;
171
174
  type AzureTranscriptionModelOptions = InferSchema<typeof azureTranscriptionModelOptions>;
172
-
175
+ //#endregion
176
+ //#region src/azure-transcription-provider-metadata.d.ts
173
177
  type AzureTranscriptionProviderMetadata = {
174
- azure: {
175
- phrases: Array<{
176
- text: string;
177
- offsetMilliseconds?: number | null;
178
- durationMilliseconds?: number | null;
179
- locale?: string | null;
180
- speaker?: number | null;
181
- confidence?: number | null;
182
- words?: Array<{
183
- text: string;
184
- offsetMilliseconds?: number | null;
185
- durationMilliseconds?: number | null;
186
- }> | null;
187
- }>;
188
- };
178
+ azure: {
179
+ phrases: Array<{
180
+ text: string;
181
+ offsetMilliseconds?: number | null;
182
+ durationMilliseconds?: number | null;
183
+ locale?: string | null;
184
+ speaker?: number | null;
185
+ confidence?: number | null;
186
+ words?: Array<{
187
+ text: string;
188
+ offsetMilliseconds?: number | null;
189
+ durationMilliseconds?: number | null;
190
+ }> | null;
191
+ }>;
192
+ };
189
193
  };
190
-
191
- type AzureDeepSeekLanguageModelOptions = Omit<DeepSeekLanguageModelChatOptions, 'thinking'>;
194
+ //#endregion
195
+ //#region src/index.d.ts
196
+ export type AzureDeepSeekLanguageModelOptions = Omit<DeepSeekLanguageModelChatOptions, 'thinking'>;
192
197
  /** @deprecated Use `AzureDeepSeekLanguageModelOptions` instead. */
193
- type AzureDeepSeekChatOptions = AzureDeepSeekLanguageModelOptions;
194
-
195
- export { type AzureDeepSeekChatOptions, type AzureDeepSeekLanguageModelOptions, type AzureOpenAIProvider, type AzureOpenAIProviderSettings, type AzureResponsesProviderMetadata, type AzureResponsesReasoningProviderMetadata, type AzureResponsesSourceDocumentProviderMetadata, type AzureResponsesTextProviderMetadata, type AzureTranscriptionModelOptions, type AzureTranscriptionProviderMetadata, VERSION, azure, createAzure };
198
+ export type AzureDeepSeekChatOptions = AzureDeepSeekLanguageModelOptions;
199
+ //#endregion
200
+ export type { AzureOpenAIProvider, AzureOpenAIProviderSettings, AzureResponsesProviderMetadata, AzureResponsesReasoningProviderMetadata, AzureResponsesSourceDocumentProviderMetadata, AzureResponsesTextProviderMetadata, AzureTranscriptionModelOptions, AzureTranscriptionProviderMetadata, OpenAIChatLanguageModelOptions, OpenAILanguageModelChatOptions, OpenAILanguageModelResponsesOptions, OpenAIResponsesProviderOptions, OpenAIResponsesSystemMessageOptions };
201
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/azure-openai-tools.ts","../src/azure-openai-provider.ts","../src/azure-openai-provider-metadata.ts","../src/version.ts","../src/azure-transcription-model-options.ts","../src/azure-transcription-provider-metadata.ts","../src/index.ts"],"mappings":";;;;;;cAQa;EACX,wBAAwB;EACxB,mBAAmB;EACnB,wBAAwB;EACxB,kBAAkB;EAClB,yBAAyB;;;;UC4BV,4BAA4B;GAC1C,uBAAuB;;;;EAKxB,cAAc,uBAAuB;;;;EAKrC,KAAK,uBAAuB;;;;EAK5B,SAAS,uBAAuB;;;;EAKhC,UAAU,uBAAuB;;;;EAKjC,WAAW,uBAAuB;;;;EAKlC,UAAU,uBAAuB;;;;EAKjC,eAAe,uBAAuB;;;;EAKtC,cAAc,uBAAuB;;;;EAKrC,mBAAmB,uBAAuB;;;;EAK1C,MAAM,uBAAuB;;;;EAK7B,WAAW,uBAAuB;;;;;EAMlC,cAAc,uBAAuB;;;;EAKrC,mBAAmB,uBAAuB;;;;EAK1C,OAAO,uBAAuB;;;;EAK9B,cAAc;;UAGC;;;;;;;EAOf;;;;;;;;;EAUA;;;;EAKA;;;;;;EAOA,uBAAuB;;;;EAKvB,UAAU;;;;;EAMV,QAAQ;;;;;EAMR;;;;;;EAOA;;;;;;;EAQA;;;;;wBAgCc,YACd,UAAS,8BACR;;;;qBAiOU,OAAK;;;KClbN;EACV,OAAO;;KAGG;EACV,OAAO;;KAGG;EACV,OAAO;;KAGG;EACV,OAAO;;;;qBClBI;;;cCMA,iEAA8B;;;;;;;;;;;;KAY/B,iCAAiC,mBACpC;;;KCrBG;EACV;IACE,SAAS;MACP;MACA;MACA;MACA;MACA;MACA;MACA,QAAQ;QACN;QACA;QACA;;;;;;;YCVI,oCAAoC,KAC9C;;YAIU,2BAA2B"}