ai 6.0.167 → 6.0.168

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,12 @@
1
1
  # ai
2
2
 
3
+ ## 6.0.168
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [493d7d4]
8
+ - @ai-sdk/gateway@3.0.104
9
+
3
10
  ## 6.0.167
4
11
 
5
12
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1252,7 +1252,7 @@ var import_provider_utils3 = require("@ai-sdk/provider-utils");
1252
1252
  var import_provider_utils4 = require("@ai-sdk/provider-utils");
1253
1253
 
1254
1254
  // src/version.ts
1255
- var VERSION = true ? "6.0.167" : "0.0.0-test";
1255
+ var VERSION = true ? "6.0.168" : "0.0.0-test";
1256
1256
 
1257
1257
  // src/util/download/download.ts
1258
1258
  var download = async ({
package/dist/index.mjs CHANGED
@@ -1143,7 +1143,7 @@ import {
1143
1143
  } from "@ai-sdk/provider-utils";
1144
1144
 
1145
1145
  // src/version.ts
1146
- var VERSION = true ? "6.0.167" : "0.0.0-test";
1146
+ var VERSION = true ? "6.0.168" : "0.0.0-test";
1147
1147
 
1148
1148
  // src/util/download/download.ts
1149
1149
  var download = async ({
@@ -153,7 +153,7 @@ var import_provider_utils2 = require("@ai-sdk/provider-utils");
153
153
  var import_provider_utils3 = require("@ai-sdk/provider-utils");
154
154
 
155
155
  // src/version.ts
156
- var VERSION = true ? "6.0.167" : "0.0.0-test";
156
+ var VERSION = true ? "6.0.168" : "0.0.0-test";
157
157
 
158
158
  // src/util/download/download.ts
159
159
  var download = async ({
@@ -133,7 +133,7 @@ import {
133
133
  } from "@ai-sdk/provider-utils";
134
134
 
135
135
  // src/version.ts
136
- var VERSION = true ? "6.0.167" : "0.0.0-test";
136
+ var VERSION = true ? "6.0.168" : "0.0.0-test";
137
137
 
138
138
  // src/util/download/download.ts
139
139
  var download = async ({
@@ -153,7 +153,7 @@ await newsAgent.generate({
153
153
  Configure provider settings dynamically:
154
154
 
155
155
  ```ts
156
- import { openai, OpenAILanguageModelResponsesOptions } from '@ai-sdk/openai';
156
+ import { OpenAILanguageModelResponsesOptions } from '@ai-sdk/openai';
157
157
  import { ToolLoopAgent } from 'ai';
158
158
  import { z } from 'zod';
159
159
 
@@ -16,7 +16,6 @@ You can use it with embeddings models, e.g. `openai.embeddingModel('text-embeddi
16
16
 
17
17
  ```tsx
18
18
  import { embed } from 'ai';
19
- import { openai } from '@ai-sdk/openai';
20
19
 
21
20
  // 'embedding' is a single embedding object (number[])
22
21
  const { embedding } = await embed({
@@ -35,7 +34,6 @@ Similar to `embed`, you can use it with embeddings models,
35
34
  e.g. `openai.embeddingModel('text-embedding-3-large')` or `mistral.embeddingModel('mistral-embed')`.
36
35
 
37
36
  ```tsx
38
- import { openai } from '@ai-sdk/openai';
39
37
  import { embedMany } from 'ai';
40
38
 
41
39
  // 'embeddings' is an array of embedding objects (number[][]).
@@ -56,8 +54,7 @@ After embedding values, you can calculate the similarity between them using the
56
54
  This is useful to e.g. find similar words or phrases in a dataset.
57
55
  You can also rank and filter related items based on their similarity.
58
56
 
59
- ```ts highlight={"2,10"}
60
- import { openai } from '@ai-sdk/openai';
57
+ ```ts highlight={"1,9"}
61
58
  import { cosineSimilarity, embedMany } from 'ai';
62
59
 
63
60
  const { embeddings } = await embedMany({
@@ -75,8 +72,7 @@ console.log(
75
72
  Many providers charge based on the number of tokens used to generate embeddings.
76
73
  Both `embed` and `embedMany` provide token usage information in the `usage` property of the result object:
77
74
 
78
- ```ts highlight={"4,9"}
79
- import { openai } from '@ai-sdk/openai';
75
+ ```ts highlight={"3,8"}
80
76
  import { embed } from 'ai';
81
77
 
82
78
  const { embedding, usage } = await embed({
@@ -93,8 +89,7 @@ console.log(usage); // { tokens: 10 }
93
89
 
94
90
  Embedding model settings can be configured using `providerOptions` for provider-specific parameters:
95
91
 
96
- ```ts highlight={"5-9"}
97
- import { openai } from '@ai-sdk/openai';
92
+ ```ts highlight={"4-8"}
98
93
  import { embed } from 'ai';
99
94
 
100
95
  const { embedding } = await embed({
@@ -112,8 +107,7 @@ const { embedding } = await embed({
112
107
 
113
108
  The `embedMany` function now supports parallel processing with configurable `maxParallelCalls` to optimize performance:
114
109
 
115
- ```ts highlight={"4"}
116
- import { openai } from '@ai-sdk/openai';
110
+ ```ts highlight={"3"}
117
111
  import { embedMany } from 'ai';
118
112
 
119
113
  const { embeddings, usage } = await embedMany({
@@ -133,8 +127,7 @@ Both `embed` and `embedMany` accept an optional `maxRetries` parameter of type `
133
127
  that you can use to set the maximum number of retries for the embedding process.
134
128
  It defaults to `2` retries (3 attempts in total). You can set it to `0` to disable retries.
135
129
 
136
- ```ts highlight={"7"}
137
- import { openai } from '@ai-sdk/openai';
130
+ ```ts highlight={"6"}
138
131
  import { embed } from 'ai';
139
132
 
140
133
  const { embedding } = await embed({
@@ -150,8 +143,7 @@ Both `embed` and `embedMany` accept an optional `abortSignal` parameter of
150
143
  type [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)
151
144
  that you can use to abort the embedding process or set a timeout.
152
145
 
153
- ```ts highlight={"7"}
154
- import { openai } from '@ai-sdk/openai';
146
+ ```ts highlight={"6"}
155
147
  import { embed } from 'ai';
156
148
 
157
149
  const { embedding } = await embed({
@@ -166,8 +158,7 @@ const { embedding } = await embed({
166
158
  Both `embed` and `embedMany` accept an optional `headers` parameter of type `Record<string, string>`
167
159
  that you can use to add custom headers to the embedding request.
168
160
 
169
- ```ts highlight={"7"}
170
- import { openai } from '@ai-sdk/openai';
161
+ ```ts highlight={"6"}
171
162
  import { embed } from 'ai';
172
163
 
173
164
  const { embedding } = await embed({
@@ -181,8 +172,7 @@ const { embedding } = await embed({
181
172
 
182
173
  Both `embed` and `embedMany` return response information that includes the raw provider response:
183
174
 
184
- ```ts highlight={"4,9"}
185
- import { openai } from '@ai-sdk/openai';
175
+ ```ts highlight={"3,8"}
186
176
  import { embed } from 'ai';
187
177
 
188
178
  const { embedding, response } = await embed({
@@ -88,7 +88,6 @@ import {
88
88
  } from 'ai';
89
89
  import { z } from 'zod';
90
90
  import { loadChat, saveChat } from '@util/chat-store';
91
- import { openai } from '@ai-sdk/openai';
92
91
  import { dataPartsSchema, metadataSchema } from '@util/schemas';
93
92
 
94
93
  // Define your tools
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "6.0.167",
3
+ "version": "6.0.168",
4
4
  "description": "AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@opentelemetry/api": "1.9.0",
48
- "@ai-sdk/gateway": "3.0.103",
48
+ "@ai-sdk/gateway": "3.0.104",
49
49
  "@ai-sdk/provider": "3.0.8",
50
50
  "@ai-sdk/provider-utils": "4.0.23"
51
51
  },