@ai-sdk/openai 3.0.19 → 3.0.21
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 +27 -27
- package/dist/index.d.ts +27 -27
- package/dist/index.js +32 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -32
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +31 -31
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +31 -31
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +65 -6
- package/package.json +2 -2
- package/src/completion/openai-completion-options.ts +28 -28
- package/src/embedding/openai-embedding-options.ts +6 -6
- package/src/openai-provider.ts +27 -27
package/dist/index.mjs
CHANGED
|
@@ -1339,42 +1339,42 @@ var openaiCompletionProviderOptions = lazySchema4(
|
|
|
1339
1339
|
() => zodSchema4(
|
|
1340
1340
|
z5.object({
|
|
1341
1341
|
/**
|
|
1342
|
-
|
|
1343
|
-
|
|
1342
|
+
* Echo back the prompt in addition to the completion.
|
|
1343
|
+
*/
|
|
1344
1344
|
echo: z5.boolean().optional(),
|
|
1345
1345
|
/**
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1346
|
+
* Modify the likelihood of specified tokens appearing in the completion.
|
|
1347
|
+
*
|
|
1348
|
+
* Accepts a JSON object that maps tokens (specified by their token ID in
|
|
1349
|
+
* the GPT tokenizer) to an associated bias value from -100 to 100. You
|
|
1350
|
+
* can use this tokenizer tool to convert text to token IDs. Mathematically,
|
|
1351
|
+
* the bias is added to the logits generated by the model prior to sampling.
|
|
1352
|
+
* The exact effect will vary per model, but values between -1 and 1 should
|
|
1353
|
+
* decrease or increase likelihood of selection; values like -100 or 100
|
|
1354
|
+
* should result in a ban or exclusive selection of the relevant token.
|
|
1355
|
+
*
|
|
1356
|
+
* As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
|
|
1357
|
+
* token from being generated.
|
|
1358
1358
|
*/
|
|
1359
1359
|
logitBias: z5.record(z5.string(), z5.number()).optional(),
|
|
1360
1360
|
/**
|
|
1361
|
-
|
|
1361
|
+
* The suffix that comes after a completion of inserted text.
|
|
1362
1362
|
*/
|
|
1363
1363
|
suffix: z5.string().optional(),
|
|
1364
1364
|
/**
|
|
1365
|
-
|
|
1366
|
-
|
|
1365
|
+
* A unique identifier representing your end-user, which can help OpenAI to
|
|
1366
|
+
* monitor and detect abuse. Learn more.
|
|
1367
1367
|
*/
|
|
1368
1368
|
user: z5.string().optional(),
|
|
1369
1369
|
/**
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1370
|
+
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
1371
|
+
* the response size and can slow down response times. However, it can
|
|
1372
|
+
* be useful to better understand how the model is behaving.
|
|
1373
|
+
* Setting to true will return the log probabilities of the tokens that
|
|
1374
|
+
* were generated.
|
|
1375
|
+
* Setting to a number will return the log probabilities of the top n
|
|
1376
|
+
* tokens that were generated.
|
|
1377
|
+
*/
|
|
1378
1378
|
logprobs: z5.union([z5.boolean(), z5.number()]).optional()
|
|
1379
1379
|
})
|
|
1380
1380
|
)
|
|
@@ -1627,14 +1627,14 @@ var openaiEmbeddingProviderOptions = lazySchema5(
|
|
|
1627
1627
|
() => zodSchema5(
|
|
1628
1628
|
z6.object({
|
|
1629
1629
|
/**
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1630
|
+
* The number of dimensions the resulting output embeddings should have.
|
|
1631
|
+
* Only supported in text-embedding-3 and later models.
|
|
1632
|
+
*/
|
|
1633
1633
|
dimensions: z6.number().optional(),
|
|
1634
1634
|
/**
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1635
|
+
* A unique identifier representing your end-user, which can help OpenAI to
|
|
1636
|
+
* monitor and detect abuse. Learn more.
|
|
1637
|
+
*/
|
|
1638
1638
|
user: z6.string().optional()
|
|
1639
1639
|
})
|
|
1640
1640
|
)
|
|
@@ -5868,7 +5868,7 @@ var OpenAITranscriptionModel = class {
|
|
|
5868
5868
|
};
|
|
5869
5869
|
|
|
5870
5870
|
// src/version.ts
|
|
5871
|
-
var VERSION = true ? "3.0.
|
|
5871
|
+
var VERSION = true ? "3.0.21" : "0.0.0-test";
|
|
5872
5872
|
|
|
5873
5873
|
// src/openai-provider.ts
|
|
5874
5874
|
function createOpenAI(options = {}) {
|