ai 5.0.0-canary.2 → 5.0.0-canary.3
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 +10 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +46 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -46
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/rsc/dist/rsc-server.mjs +21 -24
- package/rsc/dist/rsc-server.mjs.map +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# ai
|
2
2
|
|
3
|
+
## 5.0.0-canary.3
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- Updated dependencies [c57e248]
|
8
|
+
- Updated dependencies [33f4a6a]
|
9
|
+
- @ai-sdk/provider@2.0.0-canary.1
|
10
|
+
- @ai-sdk/provider-utils@3.0.0-canary.2
|
11
|
+
- @ai-sdk/ui-utils@2.0.0-canary.2
|
12
|
+
|
3
13
|
## 5.0.0-canary.2
|
4
14
|
|
5
15
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
@@ -2,7 +2,7 @@ import { IDGenerator } from '@ai-sdk/provider-utils';
|
|
2
2
|
export { CoreToolCall, CoreToolResult, IDGenerator, ToolCall, ToolResult, createIdGenerator, generateId } from '@ai-sdk/provider-utils';
|
3
3
|
import { DataStreamString, Message, Schema, DeepPartial, JSONValue as JSONValue$1 } from '@ai-sdk/ui-utils';
|
4
4
|
export { Attachment, ChatRequest, ChatRequestOptions, CreateMessage, DataStreamPart, DeepPartial, IdGenerator, JSONValue, Message, RequestOptions, Schema, ToolInvocation, UIMessage, formatDataStreamPart, jsonSchema, parseDataStreamPart, processDataStream, processTextStream, zodSchema } from '@ai-sdk/ui-utils';
|
5
|
-
import { LanguageModelV2, LanguageModelV2FinishReason, LanguageModelV2LogProbs, LanguageModelV2CallWarning, LanguageModelV2Source, JSONValue, EmbeddingModelV1, EmbeddingModelV1Embedding, ImageModelV1, ImageModelV1CallWarning, LanguageModelV2ProviderMetadata, LanguageModelV2CallOptions, AISDKError, LanguageModelV2FunctionToolCall, JSONSchema7, JSONParseError, TypeValidationError, LanguageModelV2Middleware, ProviderV2, NoSuchModelError } from '@ai-sdk/provider';
|
5
|
+
import { LanguageModelV2, LanguageModelV2FinishReason, LanguageModelV2LogProbs, LanguageModelV2CallWarning, LanguageModelV2Source, JSONValue, EmbeddingModelV1, EmbeddingModelV1Embedding, ImageModelV1, ImageModelV1CallWarning, LanguageModelV2ProviderMetadata, LanguageModelV2CallOptions, AISDKError, LanguageModelV2FunctionToolCall, JSONSchema7, JSONParseError, TypeValidationError, LanguageModelV2ProviderOptions, LanguageModelV2Middleware, ProviderV2, NoSuchModelError } from '@ai-sdk/provider';
|
6
6
|
export { AISDKError, APICallError, EmptyResponseBodyError, InvalidPromptError, InvalidResponseDataError, JSONParseError, LanguageModelV2, LanguageModelV2CallOptions, LanguageModelV2Prompt, LanguageModelV2StreamPart, LoadAPIKeyError, NoContentGeneratedError, NoSuchModelError, TypeValidationError, UnsupportedFunctionalityError } from '@ai-sdk/provider';
|
7
7
|
import { ServerResponse } from 'node:http';
|
8
8
|
import { AttributeValue, Tracer } from '@opentelemetry/api';
|
@@ -3797,7 +3797,7 @@ Callback that is called when the LLM response and the final object validation ar
|
|
3797
3797
|
*/
|
3798
3798
|
declare function defaultSettingsMiddleware({ settings, }: {
|
3799
3799
|
settings: Partial<LanguageModelV2CallOptions & {
|
3800
|
-
|
3800
|
+
providerOptions?: LanguageModelV2ProviderOptions;
|
3801
3801
|
}>;
|
3802
3802
|
}): LanguageModelV2Middleware;
|
3803
3803
|
|
@@ -4254,7 +4254,7 @@ The following streams are supported:
|
|
4254
4254
|
- `LangChainAIMessageChunk` streams (LangChain `model.stream` output)
|
4255
4255
|
- `string` streams (LangChain `StringOutputParser` output)
|
4256
4256
|
*/
|
4257
|
-
declare function toDataStream$1(stream: ReadableStream<LangChainStreamEvent> | ReadableStream<LangChainAIMessageChunk> | ReadableStream<string>, callbacks?: StreamCallbacks): ReadableStream<Uint8Array
|
4257
|
+
declare function toDataStream$1(stream: ReadableStream<LangChainStreamEvent> | ReadableStream<LangChainAIMessageChunk> | ReadableStream<string>, callbacks?: StreamCallbacks): ReadableStream<Uint8Array<ArrayBufferLike>>;
|
4258
4258
|
declare function toDataStreamResponse$1(stream: ReadableStream<LangChainStreamEvent> | ReadableStream<LangChainAIMessageChunk> | ReadableStream<string>, options?: {
|
4259
4259
|
init?: ResponseInit;
|
4260
4260
|
data?: StreamData;
|
@@ -4276,7 +4276,7 @@ declare namespace langchainAdapter {
|
|
4276
4276
|
type EngineResponse = {
|
4277
4277
|
delta: string;
|
4278
4278
|
};
|
4279
|
-
declare function toDataStream(stream: AsyncIterable<EngineResponse>, callbacks?: StreamCallbacks): ReadableStream<Uint8Array
|
4279
|
+
declare function toDataStream(stream: AsyncIterable<EngineResponse>, callbacks?: StreamCallbacks): ReadableStream<Uint8Array<ArrayBufferLike>>;
|
4280
4280
|
declare function toDataStreamResponse(stream: AsyncIterable<EngineResponse>, options?: {
|
4281
4281
|
init?: ResponseInit;
|
4282
4282
|
data?: StreamData;
|
package/dist/index.d.ts
CHANGED
@@ -2,7 +2,7 @@ import { IDGenerator } from '@ai-sdk/provider-utils';
|
|
2
2
|
export { CoreToolCall, CoreToolResult, IDGenerator, ToolCall, ToolResult, createIdGenerator, generateId } from '@ai-sdk/provider-utils';
|
3
3
|
import { DataStreamString, Message, Schema, DeepPartial, JSONValue as JSONValue$1 } from '@ai-sdk/ui-utils';
|
4
4
|
export { Attachment, ChatRequest, ChatRequestOptions, CreateMessage, DataStreamPart, DeepPartial, IdGenerator, JSONValue, Message, RequestOptions, Schema, ToolInvocation, UIMessage, formatDataStreamPart, jsonSchema, parseDataStreamPart, processDataStream, processTextStream, zodSchema } from '@ai-sdk/ui-utils';
|
5
|
-
import { LanguageModelV2, LanguageModelV2FinishReason, LanguageModelV2LogProbs, LanguageModelV2CallWarning, LanguageModelV2Source, JSONValue, EmbeddingModelV1, EmbeddingModelV1Embedding, ImageModelV1, ImageModelV1CallWarning, LanguageModelV2ProviderMetadata, LanguageModelV2CallOptions, AISDKError, LanguageModelV2FunctionToolCall, JSONSchema7, JSONParseError, TypeValidationError, LanguageModelV2Middleware, ProviderV2, NoSuchModelError } from '@ai-sdk/provider';
|
5
|
+
import { LanguageModelV2, LanguageModelV2FinishReason, LanguageModelV2LogProbs, LanguageModelV2CallWarning, LanguageModelV2Source, JSONValue, EmbeddingModelV1, EmbeddingModelV1Embedding, ImageModelV1, ImageModelV1CallWarning, LanguageModelV2ProviderMetadata, LanguageModelV2CallOptions, AISDKError, LanguageModelV2FunctionToolCall, JSONSchema7, JSONParseError, TypeValidationError, LanguageModelV2ProviderOptions, LanguageModelV2Middleware, ProviderV2, NoSuchModelError } from '@ai-sdk/provider';
|
6
6
|
export { AISDKError, APICallError, EmptyResponseBodyError, InvalidPromptError, InvalidResponseDataError, JSONParseError, LanguageModelV2, LanguageModelV2CallOptions, LanguageModelV2Prompt, LanguageModelV2StreamPart, LoadAPIKeyError, NoContentGeneratedError, NoSuchModelError, TypeValidationError, UnsupportedFunctionalityError } from '@ai-sdk/provider';
|
7
7
|
import { ServerResponse } from 'node:http';
|
8
8
|
import { AttributeValue, Tracer } from '@opentelemetry/api';
|
@@ -3797,7 +3797,7 @@ Callback that is called when the LLM response and the final object validation ar
|
|
3797
3797
|
*/
|
3798
3798
|
declare function defaultSettingsMiddleware({ settings, }: {
|
3799
3799
|
settings: Partial<LanguageModelV2CallOptions & {
|
3800
|
-
|
3800
|
+
providerOptions?: LanguageModelV2ProviderOptions;
|
3801
3801
|
}>;
|
3802
3802
|
}): LanguageModelV2Middleware;
|
3803
3803
|
|
@@ -4254,7 +4254,7 @@ The following streams are supported:
|
|
4254
4254
|
- `LangChainAIMessageChunk` streams (LangChain `model.stream` output)
|
4255
4255
|
- `string` streams (LangChain `StringOutputParser` output)
|
4256
4256
|
*/
|
4257
|
-
declare function toDataStream$1(stream: ReadableStream<LangChainStreamEvent> | ReadableStream<LangChainAIMessageChunk> | ReadableStream<string>, callbacks?: StreamCallbacks): ReadableStream<Uint8Array
|
4257
|
+
declare function toDataStream$1(stream: ReadableStream<LangChainStreamEvent> | ReadableStream<LangChainAIMessageChunk> | ReadableStream<string>, callbacks?: StreamCallbacks): ReadableStream<Uint8Array<ArrayBufferLike>>;
|
4258
4258
|
declare function toDataStreamResponse$1(stream: ReadableStream<LangChainStreamEvent> | ReadableStream<LangChainAIMessageChunk> | ReadableStream<string>, options?: {
|
4259
4259
|
init?: ResponseInit;
|
4260
4260
|
data?: StreamData;
|
@@ -4276,7 +4276,7 @@ declare namespace langchainAdapter {
|
|
4276
4276
|
type EngineResponse = {
|
4277
4277
|
delta: string;
|
4278
4278
|
};
|
4279
|
-
declare function toDataStream(stream: AsyncIterable<EngineResponse>, callbacks?: StreamCallbacks): ReadableStream<Uint8Array
|
4279
|
+
declare function toDataStream(stream: AsyncIterable<EngineResponse>, callbacks?: StreamCallbacks): ReadableStream<Uint8Array<ArrayBufferLike>>;
|
4280
4280
|
declare function toDataStreamResponse(stream: AsyncIterable<EngineResponse>, options?: {
|
4281
4281
|
init?: ResponseInit;
|
4282
4282
|
data?: StreamData;
|
package/dist/index.js
CHANGED
@@ -1321,7 +1321,7 @@ function convertToLanguageModelMessage(message, downloadedAssets) {
|
|
1321
1321
|
return {
|
1322
1322
|
role: "system",
|
1323
1323
|
content: message.content,
|
1324
|
-
|
1324
|
+
providerOptions: (_a17 = message.providerOptions) != null ? _a17 : message.experimental_providerMetadata
|
1325
1325
|
};
|
1326
1326
|
}
|
1327
1327
|
case "user": {
|
@@ -1329,13 +1329,13 @@ function convertToLanguageModelMessage(message, downloadedAssets) {
|
|
1329
1329
|
return {
|
1330
1330
|
role: "user",
|
1331
1331
|
content: [{ type: "text", text: message.content }],
|
1332
|
-
|
1332
|
+
providerOptions: (_b = message.providerOptions) != null ? _b : message.experimental_providerMetadata
|
1333
1333
|
};
|
1334
1334
|
}
|
1335
1335
|
return {
|
1336
1336
|
role: "user",
|
1337
1337
|
content: message.content.map((part) => convertPartToLanguageModelPart(part, downloadedAssets)).filter((part) => part.type !== "text" || part.text !== ""),
|
1338
|
-
|
1338
|
+
providerOptions: (_c = message.providerOptions) != null ? _c : message.experimental_providerMetadata
|
1339
1339
|
};
|
1340
1340
|
}
|
1341
1341
|
case "assistant": {
|
@@ -1343,7 +1343,7 @@ function convertToLanguageModelMessage(message, downloadedAssets) {
|
|
1343
1343
|
return {
|
1344
1344
|
role: "assistant",
|
1345
1345
|
content: [{ type: "text", text: message.content }],
|
1346
|
-
|
1346
|
+
providerOptions: (_d = message.providerOptions) != null ? _d : message.experimental_providerMetadata
|
1347
1347
|
};
|
1348
1348
|
}
|
1349
1349
|
return {
|
@@ -1361,7 +1361,7 @@ function convertToLanguageModelMessage(message, downloadedAssets) {
|
|
1361
1361
|
data: part.data instanceof URL ? part.data : convertDataContentToBase64String(part.data),
|
1362
1362
|
filename: part.filename,
|
1363
1363
|
mimeType: part.mimeType,
|
1364
|
-
|
1364
|
+
providerOptions
|
1365
1365
|
};
|
1366
1366
|
}
|
1367
1367
|
case "reasoning": {
|
@@ -1369,21 +1369,21 @@ function convertToLanguageModelMessage(message, downloadedAssets) {
|
|
1369
1369
|
type: "reasoning",
|
1370
1370
|
text: part.text,
|
1371
1371
|
signature: part.signature,
|
1372
|
-
|
1372
|
+
providerOptions
|
1373
1373
|
};
|
1374
1374
|
}
|
1375
1375
|
case "redacted-reasoning": {
|
1376
1376
|
return {
|
1377
1377
|
type: "redacted-reasoning",
|
1378
1378
|
data: part.data,
|
1379
|
-
|
1379
|
+
providerOptions
|
1380
1380
|
};
|
1381
1381
|
}
|
1382
1382
|
case "text": {
|
1383
1383
|
return {
|
1384
1384
|
type: "text",
|
1385
1385
|
text: part.text,
|
1386
|
-
|
1386
|
+
providerOptions
|
1387
1387
|
};
|
1388
1388
|
}
|
1389
1389
|
case "tool-call": {
|
@@ -1392,12 +1392,12 @@ function convertToLanguageModelMessage(message, downloadedAssets) {
|
|
1392
1392
|
toolCallId: part.toolCallId,
|
1393
1393
|
toolName: part.toolName,
|
1394
1394
|
args: part.args,
|
1395
|
-
|
1395
|
+
providerOptions
|
1396
1396
|
};
|
1397
1397
|
}
|
1398
1398
|
}
|
1399
1399
|
}),
|
1400
|
-
|
1400
|
+
providerOptions: (_e = message.providerOptions) != null ? _e : message.experimental_providerMetadata
|
1401
1401
|
};
|
1402
1402
|
}
|
1403
1403
|
case "tool": {
|
@@ -1412,10 +1412,10 @@ function convertToLanguageModelMessage(message, downloadedAssets) {
|
|
1412
1412
|
result: part.result,
|
1413
1413
|
content: part.experimental_content,
|
1414
1414
|
isError: part.isError,
|
1415
|
-
|
1415
|
+
providerOptions: (_a18 = part.providerOptions) != null ? _a18 : part.experimental_providerMetadata
|
1416
1416
|
};
|
1417
1417
|
}),
|
1418
|
-
|
1418
|
+
providerOptions: (_f = message.providerOptions) != null ? _f : message.experimental_providerMetadata
|
1419
1419
|
};
|
1420
1420
|
}
|
1421
1421
|
default: {
|
@@ -1453,7 +1453,7 @@ function convertPartToLanguageModelPart(part, downloadedAssets) {
|
|
1453
1453
|
return {
|
1454
1454
|
type: "text",
|
1455
1455
|
text: part.text,
|
1456
|
-
|
1456
|
+
providerOptions: (_a17 = part.providerOptions) != null ? _a17 : part.experimental_providerMetadata
|
1457
1457
|
};
|
1458
1458
|
}
|
1459
1459
|
let mimeType = part.mimeType;
|
@@ -1507,7 +1507,7 @@ function convertPartToLanguageModelPart(part, downloadedAssets) {
|
|
1507
1507
|
type: "image",
|
1508
1508
|
image: normalizedData,
|
1509
1509
|
mimeType,
|
1510
|
-
|
1510
|
+
providerOptions: (_c = part.providerOptions) != null ? _c : part.experimental_providerMetadata
|
1511
1511
|
};
|
1512
1512
|
}
|
1513
1513
|
case "file": {
|
@@ -1519,7 +1519,7 @@ function convertPartToLanguageModelPart(part, downloadedAssets) {
|
|
1519
1519
|
data: normalizedData instanceof Uint8Array ? convertDataContentToBase64String(normalizedData) : normalizedData,
|
1520
1520
|
filename: part.filename,
|
1521
1521
|
mimeType,
|
1522
|
-
|
1522
|
+
providerOptions: (_d = part.providerOptions) != null ? _d : part.experimental_providerMetadata
|
1523
1523
|
};
|
1524
1524
|
}
|
1525
1525
|
}
|
@@ -2758,8 +2758,8 @@ async function generateObject({
|
|
2758
2758
|
fn: async (span2) => {
|
2759
2759
|
var _a18, _b2, _c2, _d2, _e, _f;
|
2760
2760
|
const result2 = await model.doGenerate({
|
2761
|
-
|
2762
|
-
type: "
|
2761
|
+
responseFormat: {
|
2762
|
+
type: "json",
|
2763
2763
|
schema: outputStrategy.jsonSchema,
|
2764
2764
|
name: schemaName,
|
2765
2765
|
description: schemaDescription
|
@@ -2767,7 +2767,7 @@ async function generateObject({
|
|
2767
2767
|
...prepareCallSettings(settings),
|
2768
2768
|
inputFormat: standardizedPrompt.type,
|
2769
2769
|
prompt: promptMessages,
|
2770
|
-
|
2770
|
+
providerOptions,
|
2771
2771
|
abortSignal,
|
2772
2772
|
headers
|
2773
2773
|
});
|
@@ -2864,19 +2864,19 @@ async function generateObject({
|
|
2864
2864
|
fn: async (span2) => {
|
2865
2865
|
var _a18, _b2, _c2, _d2, _e, _f, _g, _h;
|
2866
2866
|
const result2 = await model.doGenerate({
|
2867
|
-
|
2868
|
-
|
2869
|
-
tool: {
|
2867
|
+
tools: [
|
2868
|
+
{
|
2870
2869
|
type: "function",
|
2871
2870
|
name: schemaName != null ? schemaName : "json",
|
2872
2871
|
description: schemaDescription != null ? schemaDescription : "Respond with a JSON object.",
|
2873
2872
|
parameters: outputStrategy.jsonSchema
|
2874
2873
|
}
|
2875
|
-
|
2874
|
+
],
|
2875
|
+
toolChoice: { type: "required" },
|
2876
2876
|
...prepareCallSettings(settings),
|
2877
2877
|
inputFormat,
|
2878
2878
|
prompt: promptMessages,
|
2879
|
-
|
2879
|
+
providerOptions,
|
2880
2880
|
abortSignal,
|
2881
2881
|
headers
|
2882
2882
|
});
|
@@ -3339,8 +3339,8 @@ var DefaultStreamObjectResult = class {
|
|
3339
3339
|
tools: void 0
|
3340
3340
|
});
|
3341
3341
|
callOptions = {
|
3342
|
-
|
3343
|
-
type: "
|
3342
|
+
responseFormat: {
|
3343
|
+
type: "json",
|
3344
3344
|
schema: outputStrategy.jsonSchema,
|
3345
3345
|
name: schemaName,
|
3346
3346
|
description: schemaDescription
|
@@ -3353,7 +3353,7 @@ var DefaultStreamObjectResult = class {
|
|
3353
3353
|
modelSupportsUrl: (_a17 = model.supportsUrl) == null ? void 0 : _a17.bind(model)
|
3354
3354
|
// support 'this' context
|
3355
3355
|
}),
|
3356
|
-
|
3356
|
+
providerOptions,
|
3357
3357
|
abortSignal,
|
3358
3358
|
headers
|
3359
3359
|
};
|
@@ -3379,15 +3379,15 @@ var DefaultStreamObjectResult = class {
|
|
3379
3379
|
tools: void 0
|
3380
3380
|
});
|
3381
3381
|
callOptions = {
|
3382
|
-
|
3383
|
-
|
3384
|
-
tool: {
|
3382
|
+
tools: [
|
3383
|
+
{
|
3385
3384
|
type: "function",
|
3386
3385
|
name: schemaName != null ? schemaName : "json",
|
3387
3386
|
description: schemaDescription != null ? schemaDescription : "Respond with a JSON object.",
|
3388
3387
|
parameters: outputStrategy.jsonSchema
|
3389
3388
|
}
|
3390
|
-
|
3389
|
+
],
|
3390
|
+
toolChoice: { type: "required" },
|
3391
3391
|
...prepareCallSettings(settings),
|
3392
3392
|
inputFormat: standardizedPrompt.type,
|
3393
3393
|
prompt: await convertToLanguageModelPrompt({
|
@@ -3396,7 +3396,7 @@ var DefaultStreamObjectResult = class {
|
|
3396
3396
|
modelSupportsUrl: (_b = model.supportsUrl) == null ? void 0 : _b.bind(model)
|
3397
3397
|
// support 'this' context,
|
3398
3398
|
}),
|
3399
|
-
|
3399
|
+
providerOptions,
|
3400
3400
|
abortSignal,
|
3401
3401
|
headers
|
3402
3402
|
};
|
@@ -4153,8 +4153,7 @@ async function generateText({
|
|
4153
4153
|
tracer,
|
4154
4154
|
fn: async (span) => {
|
4155
4155
|
var _a18, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
4156
|
-
const
|
4157
|
-
type: "regular",
|
4156
|
+
const toolsAndToolChoice = {
|
4158
4157
|
...prepareToolsAndToolChoice({ tools, toolChoice, activeTools })
|
4159
4158
|
};
|
4160
4159
|
const callSettings = prepareCallSettings(settings);
|
@@ -4208,11 +4207,11 @@ async function generateText({
|
|
4208
4207
|
// convert the language model level tools:
|
4209
4208
|
input: () => {
|
4210
4209
|
var _a19;
|
4211
|
-
return (_a19 =
|
4210
|
+
return (_a19 = toolsAndToolChoice.tools) == null ? void 0 : _a19.map((tool2) => JSON.stringify(tool2));
|
4212
4211
|
}
|
4213
4212
|
},
|
4214
4213
|
"ai.prompt.toolChoice": {
|
4215
|
-
input: () =>
|
4214
|
+
input: () => toolsAndToolChoice.toolChoice != null ? JSON.stringify(toolsAndToolChoice.toolChoice) : void 0
|
4216
4215
|
},
|
4217
4216
|
// standardized gen-ai llm span attributes:
|
4218
4217
|
"gen_ai.system": model.provider,
|
@@ -4230,12 +4229,12 @@ async function generateText({
|
|
4230
4229
|
fn: async (span2) => {
|
4231
4230
|
var _a19, _b2, _c2, _d2, _e2, _f2;
|
4232
4231
|
const result = await model.doGenerate({
|
4233
|
-
mode,
|
4234
4232
|
...callSettings,
|
4233
|
+
...toolsAndToolChoice,
|
4235
4234
|
inputFormat: promptFormat,
|
4236
4235
|
responseFormat: output == null ? void 0 : output.responseFormat({ model }),
|
4237
4236
|
prompt: promptMessages,
|
4238
|
-
|
4237
|
+
providerOptions,
|
4239
4238
|
abortSignal,
|
4240
4239
|
headers
|
4241
4240
|
});
|
@@ -5525,8 +5524,7 @@ var DefaultStreamTextResult = class {
|
|
5525
5524
|
modelSupportsUrl: (_a18 = model.supportsUrl) == null ? void 0 : _a18.bind(model)
|
5526
5525
|
// support 'this' context
|
5527
5526
|
});
|
5528
|
-
const
|
5529
|
-
type: "regular",
|
5527
|
+
const toolsAndToolChoice = {
|
5530
5528
|
...prepareToolsAndToolChoice({ tools, toolChoice, activeTools })
|
5531
5529
|
};
|
5532
5530
|
const {
|
@@ -5554,11 +5552,13 @@ var DefaultStreamTextResult = class {
|
|
5554
5552
|
// convert the language model level tools:
|
5555
5553
|
input: () => {
|
5556
5554
|
var _a19;
|
5557
|
-
return (_a19 =
|
5555
|
+
return (_a19 = toolsAndToolChoice.tools) == null ? void 0 : _a19.map(
|
5556
|
+
(tool2) => JSON.stringify(tool2)
|
5557
|
+
);
|
5558
5558
|
}
|
5559
5559
|
},
|
5560
5560
|
"ai.prompt.toolChoice": {
|
5561
|
-
input: () =>
|
5561
|
+
input: () => toolsAndToolChoice.toolChoice != null ? JSON.stringify(toolsAndToolChoice.toolChoice) : void 0
|
5562
5562
|
},
|
5563
5563
|
// standardized gen-ai llm span attributes:
|
5564
5564
|
"gen_ai.system": model.provider,
|
@@ -5579,12 +5579,12 @@ var DefaultStreamTextResult = class {
|
|
5579
5579
|
// get before the call
|
5580
5580
|
doStreamSpan: doStreamSpan2,
|
5581
5581
|
result: await model.doStream({
|
5582
|
-
mode,
|
5583
5582
|
...prepareCallSettings(settings),
|
5583
|
+
...toolsAndToolChoice,
|
5584
5584
|
inputFormat: promptFormat,
|
5585
5585
|
responseFormat: output == null ? void 0 : output.responseFormat({ model }),
|
5586
5586
|
prompt: promptMessages,
|
5587
|
-
|
5587
|
+
providerOptions,
|
5588
5588
|
abortSignal,
|
5589
5589
|
headers
|
5590
5590
|
})
|
@@ -6334,9 +6334,9 @@ function defaultSettingsMiddleware({
|
|
6334
6334
|
return {
|
6335
6335
|
...settings,
|
6336
6336
|
...params,
|
6337
|
-
|
6338
|
-
settings.
|
6339
|
-
params.
|
6337
|
+
providerOptions: mergeObjects(
|
6338
|
+
settings.providerOptions,
|
6339
|
+
params.providerOptions
|
6340
6340
|
),
|
6341
6341
|
// special case for temperature 0
|
6342
6342
|
// TODO remove when temperature defaults to undefined
|