@ai-sdk/openai-compatible 2.0.20 → 2.0.22
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 +13 -0
- package/dist/index.d.mts +19 -19
- package/dist/index.d.ts +19 -19
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +4 -4
- package/dist/internal/index.d.ts +4 -4
- package/docs/index.mdx +579 -0
- package/package.json +7 -3
- package/src/chat/openai-compatible-metadata-extractor.ts +4 -4
- package/src/embedding/openai-compatible-embedding-model.ts +3 -3
- package/src/openai-compatible-provider.ts +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @ai-sdk/openai-compatible
|
|
2
2
|
|
|
3
|
+
## 2.0.22
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9d056e6: chore(openai-compatible): add docs to package
|
|
8
|
+
|
|
9
|
+
## 2.0.21
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [462ad00]
|
|
14
|
+
- @ai-sdk/provider-utils@4.0.10
|
|
15
|
+
|
|
3
16
|
## 2.0.20
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -27,10 +27,10 @@ declare const openaiCompatibleProviderOptions: z.ZodObject<{
|
|
|
27
27
|
type OpenAICompatibleProviderOptions = z.infer<typeof openaiCompatibleProviderOptions>;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
Extracts provider-specific metadata from API responses.
|
|
31
|
-
Used to standardize metadata handling across different LLM providers while allowing
|
|
32
|
-
provider-specific metadata to be captured.
|
|
33
|
-
*/
|
|
30
|
+
* Extracts provider-specific metadata from API responses.
|
|
31
|
+
* Used to standardize metadata handling across different LLM providers while allowing
|
|
32
|
+
* provider-specific metadata to be captured.
|
|
33
|
+
*/
|
|
34
34
|
type MetadataExtractor = {
|
|
35
35
|
/**
|
|
36
36
|
* Extracts provider metadata from a complete, non-streaming response.
|
|
@@ -160,12 +160,12 @@ type OpenAICompatibleEmbeddingProviderOptions = z.infer<typeof openaiCompatibleE
|
|
|
160
160
|
|
|
161
161
|
type OpenAICompatibleEmbeddingConfig = {
|
|
162
162
|
/**
|
|
163
|
-
|
|
163
|
+
* Override the maximum number of embeddings per call.
|
|
164
164
|
*/
|
|
165
165
|
maxEmbeddingsPerCall?: number;
|
|
166
166
|
/**
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
* Override the parallelism of embedding calls.
|
|
168
|
+
*/
|
|
169
169
|
supportsParallelCalls?: boolean;
|
|
170
170
|
provider: string;
|
|
171
171
|
url: (options: {
|
|
@@ -232,35 +232,35 @@ interface OpenAICompatibleProvider<CHAT_MODEL_IDS extends string = string, COMPL
|
|
|
232
232
|
}
|
|
233
233
|
interface OpenAICompatibleProviderSettings {
|
|
234
234
|
/**
|
|
235
|
-
|
|
235
|
+
* Base URL for the API calls.
|
|
236
236
|
*/
|
|
237
237
|
baseURL: string;
|
|
238
238
|
/**
|
|
239
|
-
|
|
239
|
+
* Provider name.
|
|
240
240
|
*/
|
|
241
241
|
name: string;
|
|
242
242
|
/**
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
* API key for authenticating requests. If specified, adds an `Authorization`
|
|
244
|
+
* header to request headers with the value `Bearer <apiKey>`. This will be added
|
|
245
|
+
* before any headers potentially specified in the `headers` option.
|
|
246
246
|
*/
|
|
247
247
|
apiKey?: string;
|
|
248
248
|
/**
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
* Optional custom headers to include in requests. These will be added to request headers
|
|
250
|
+
* after any headers potentially added by use of the `apiKey` option.
|
|
251
251
|
*/
|
|
252
252
|
headers?: Record<string, string>;
|
|
253
253
|
/**
|
|
254
|
-
|
|
254
|
+
* Optional custom url query parameters to include in request urls.
|
|
255
255
|
*/
|
|
256
256
|
queryParams?: Record<string, string>;
|
|
257
257
|
/**
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
259
|
+
* or to provide a custom fetch implementation for e.g. testing.
|
|
260
260
|
*/
|
|
261
261
|
fetch?: FetchFunction;
|
|
262
262
|
/**
|
|
263
|
-
|
|
263
|
+
* Include usage information in streaming responses.
|
|
264
264
|
*/
|
|
265
265
|
includeUsage?: boolean;
|
|
266
266
|
/**
|
|
@@ -281,7 +281,7 @@ interface OpenAICompatibleProviderSettings {
|
|
|
281
281
|
metadataExtractor?: MetadataExtractor;
|
|
282
282
|
}
|
|
283
283
|
/**
|
|
284
|
-
Create an OpenAICompatible provider instance.
|
|
284
|
+
* Create an OpenAICompatible provider instance.
|
|
285
285
|
*/
|
|
286
286
|
declare function createOpenAICompatible<CHAT_MODEL_IDS extends string, COMPLETION_MODEL_IDS extends string, EMBEDDING_MODEL_IDS extends string, IMAGE_MODEL_IDS extends string>(options: OpenAICompatibleProviderSettings): OpenAICompatibleProvider<CHAT_MODEL_IDS, COMPLETION_MODEL_IDS, EMBEDDING_MODEL_IDS, IMAGE_MODEL_IDS>;
|
|
287
287
|
|
package/dist/index.d.ts
CHANGED
|
@@ -27,10 +27,10 @@ declare const openaiCompatibleProviderOptions: z.ZodObject<{
|
|
|
27
27
|
type OpenAICompatibleProviderOptions = z.infer<typeof openaiCompatibleProviderOptions>;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
Extracts provider-specific metadata from API responses.
|
|
31
|
-
Used to standardize metadata handling across different LLM providers while allowing
|
|
32
|
-
provider-specific metadata to be captured.
|
|
33
|
-
*/
|
|
30
|
+
* Extracts provider-specific metadata from API responses.
|
|
31
|
+
* Used to standardize metadata handling across different LLM providers while allowing
|
|
32
|
+
* provider-specific metadata to be captured.
|
|
33
|
+
*/
|
|
34
34
|
type MetadataExtractor = {
|
|
35
35
|
/**
|
|
36
36
|
* Extracts provider metadata from a complete, non-streaming response.
|
|
@@ -160,12 +160,12 @@ type OpenAICompatibleEmbeddingProviderOptions = z.infer<typeof openaiCompatibleE
|
|
|
160
160
|
|
|
161
161
|
type OpenAICompatibleEmbeddingConfig = {
|
|
162
162
|
/**
|
|
163
|
-
|
|
163
|
+
* Override the maximum number of embeddings per call.
|
|
164
164
|
*/
|
|
165
165
|
maxEmbeddingsPerCall?: number;
|
|
166
166
|
/**
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
* Override the parallelism of embedding calls.
|
|
168
|
+
*/
|
|
169
169
|
supportsParallelCalls?: boolean;
|
|
170
170
|
provider: string;
|
|
171
171
|
url: (options: {
|
|
@@ -232,35 +232,35 @@ interface OpenAICompatibleProvider<CHAT_MODEL_IDS extends string = string, COMPL
|
|
|
232
232
|
}
|
|
233
233
|
interface OpenAICompatibleProviderSettings {
|
|
234
234
|
/**
|
|
235
|
-
|
|
235
|
+
* Base URL for the API calls.
|
|
236
236
|
*/
|
|
237
237
|
baseURL: string;
|
|
238
238
|
/**
|
|
239
|
-
|
|
239
|
+
* Provider name.
|
|
240
240
|
*/
|
|
241
241
|
name: string;
|
|
242
242
|
/**
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
* API key for authenticating requests. If specified, adds an `Authorization`
|
|
244
|
+
* header to request headers with the value `Bearer <apiKey>`. This will be added
|
|
245
|
+
* before any headers potentially specified in the `headers` option.
|
|
246
246
|
*/
|
|
247
247
|
apiKey?: string;
|
|
248
248
|
/**
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
* Optional custom headers to include in requests. These will be added to request headers
|
|
250
|
+
* after any headers potentially added by use of the `apiKey` option.
|
|
251
251
|
*/
|
|
252
252
|
headers?: Record<string, string>;
|
|
253
253
|
/**
|
|
254
|
-
|
|
254
|
+
* Optional custom url query parameters to include in request urls.
|
|
255
255
|
*/
|
|
256
256
|
queryParams?: Record<string, string>;
|
|
257
257
|
/**
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
259
|
+
* or to provide a custom fetch implementation for e.g. testing.
|
|
260
260
|
*/
|
|
261
261
|
fetch?: FetchFunction;
|
|
262
262
|
/**
|
|
263
|
-
|
|
263
|
+
* Include usage information in streaming responses.
|
|
264
264
|
*/
|
|
265
265
|
includeUsage?: boolean;
|
|
266
266
|
/**
|
|
@@ -281,7 +281,7 @@ interface OpenAICompatibleProviderSettings {
|
|
|
281
281
|
metadataExtractor?: MetadataExtractor;
|
|
282
282
|
}
|
|
283
283
|
/**
|
|
284
|
-
Create an OpenAICompatible provider instance.
|
|
284
|
+
* Create an OpenAICompatible provider instance.
|
|
285
285
|
*/
|
|
286
286
|
declare function createOpenAICompatible<CHAT_MODEL_IDS extends string, COMPLETION_MODEL_IDS extends string, EMBEDDING_MODEL_IDS extends string, IMAGE_MODEL_IDS extends string>(options: OpenAICompatibleProviderSettings): OpenAICompatibleProvider<CHAT_MODEL_IDS, COMPLETION_MODEL_IDS, EMBEDDING_MODEL_IDS, IMAGE_MODEL_IDS>;
|
|
287
287
|
|
package/dist/index.js
CHANGED
|
@@ -1661,7 +1661,7 @@ function toCamelCase(str) {
|
|
|
1661
1661
|
var import_provider_utils6 = require("@ai-sdk/provider-utils");
|
|
1662
1662
|
|
|
1663
1663
|
// src/version.ts
|
|
1664
|
-
var VERSION = true ? "2.0.
|
|
1664
|
+
var VERSION = true ? "2.0.22" : "0.0.0-test";
|
|
1665
1665
|
|
|
1666
1666
|
// src/openai-compatible-provider.ts
|
|
1667
1667
|
function createOpenAICompatible(options) {
|