@ai-sdk/provider-utils 5.0.0-canary.38 → 5.0.0-canary.40
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 +12 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/schema.ts +5 -1
- package/src/types/index.ts +1 -1
- package/src/types/sandbox.ts +1 -1
- package/src/types/tool-execute-function.ts +2 -2
- package/src/types/tool.ts +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/provider-utils
|
|
2
2
|
|
|
3
|
+
## 5.0.0-canary.40
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a7de9c9: fix: make sandbox experimental
|
|
8
|
+
|
|
9
|
+
## 5.0.0-canary.39
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 105f95b: Ensure the default empty tool input schema includes `type: "object"` for OpenAI-compatible providers that require object schemas.
|
|
14
|
+
|
|
3
15
|
## 5.0.0-canary.38
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1285,7 +1285,7 @@ type ModelMessage = SystemModelMessage | UserModelMessage | AssistantModelMessag
|
|
|
1285
1285
|
/**
|
|
1286
1286
|
* Sandbox environment that can execute commands.
|
|
1287
1287
|
*/
|
|
1288
|
-
type
|
|
1288
|
+
type Experimental_Sandbox = {
|
|
1289
1289
|
/**
|
|
1290
1290
|
* Description of the sandbox environment that can be added to the agent's instructions
|
|
1291
1291
|
* so that the agent knows about relevant details such as the root directory, exposed
|
|
@@ -1356,7 +1356,7 @@ interface ToolExecutionOptions<CONTEXT extends Context | unknown | never> {
|
|
|
1356
1356
|
/**
|
|
1357
1357
|
* The sandbox environment that the tool is operating in.
|
|
1358
1358
|
*/
|
|
1359
|
-
|
|
1359
|
+
experimental_sandbox?: Experimental_Sandbox;
|
|
1360
1360
|
}
|
|
1361
1361
|
/**
|
|
1362
1362
|
* Function that executes the tool and returns either a single result or a stream of results.
|
|
@@ -1519,12 +1519,12 @@ type BaseFunctionTool<INPUT extends JSONValue | unknown | never = any, OUTPUT ex
|
|
|
1519
1519
|
* decide when and how to call the tool.
|
|
1520
1520
|
*
|
|
1521
1521
|
* Provide a string for a fixed description, or a function that returns a
|
|
1522
|
-
* string from the current `context` (and optional `
|
|
1522
|
+
* string from the current `context` (and optional `experimental_sandbox`) when the
|
|
1523
1523
|
* description should vary per call.
|
|
1524
1524
|
*/
|
|
1525
1525
|
description?: string | ((options: {
|
|
1526
1526
|
context: NoInfer<CONTEXT>;
|
|
1527
|
-
|
|
1527
|
+
experimental_sandbox?: Experimental_Sandbox;
|
|
1528
1528
|
}) => string);
|
|
1529
1529
|
/**
|
|
1530
1530
|
* Strict mode setting for the tool.
|
|
@@ -2087,4 +2087,4 @@ interface ToolResult<NAME extends string, INPUT, OUTPUT> {
|
|
|
2087
2087
|
dynamic?: boolean;
|
|
2088
2088
|
}
|
|
2089
2089
|
|
|
2090
|
-
export { type Arrayable, type AssistantContent, type AssistantModelMessage, type Context, type CustomPart, DEFAULT_MAX_DOWNLOAD_SIZE, type DataContent, DelayedPromise, DownloadError, type DynamicTool, type ExecutableTool, type FetchFunction, type FileData, type FileDataData, type FileDataReference, type FileDataText, type FileDataUrl, type FilePart, type FlexibleSchema, type FunctionTool, type HasRequiredKey, type IdGenerator, type ImagePart, type InferSchema, type InferToolContext, type InferToolInput, type InferToolOutput, type InferToolSetContext, type LazySchema, type MaybePromiseLike, type ModelMessage, type ParseResult, type ProviderDefinedTool, type ProviderDefinedToolFactory, type ProviderDefinedToolFactoryWithOutputSchema, type ProviderExecutedTool, type ProviderExecutedToolFactory, type ProviderOptions, type ProviderReference, type ReasoningFilePart, type ReasoningPart, type Resolvable, type ResponseHandler, type
|
|
2090
|
+
export { type Arrayable, type AssistantContent, type AssistantModelMessage, type Context, type CustomPart, DEFAULT_MAX_DOWNLOAD_SIZE, type DataContent, DelayedPromise, DownloadError, type DynamicTool, type ExecutableTool, type Experimental_Sandbox, type FetchFunction, type FileData, type FileDataData, type FileDataReference, type FileDataText, type FileDataUrl, type FilePart, type FlexibleSchema, type FunctionTool, type HasRequiredKey, type IdGenerator, type ImagePart, type InferSchema, type InferToolContext, type InferToolInput, type InferToolOutput, type InferToolSetContext, type LazySchema, type MaybePromiseLike, type ModelMessage, type ParseResult, type ProviderDefinedTool, type ProviderDefinedToolFactory, type ProviderDefinedToolFactoryWithOutputSchema, type ProviderExecutedTool, type ProviderExecutedToolFactory, type ProviderOptions, type ProviderReference, type ReasoningFilePart, type ReasoningPart, type Resolvable, type ResponseHandler, type Schema, type StreamingToolCallDelta, StreamingToolCallTracker, type StreamingToolCallTrackerOptions, type SystemModelMessage, type TextPart, type Tool, type ToolApprovalRequest, type ToolApprovalResponse, type ToolCall, type ToolCallPart, type ToolContent, type ToolExecuteFunction, type ToolExecutionOptions, type ToolModelMessage, type ToolNameMapping, type ToolNeedsApprovalFunction, type ToolResult, type ToolResultOutput, type ToolResultPart, type ToolSet, type UserContent, type UserModelMessage, VERSION, type ValidationResult, asArray, asSchema, combineHeaders, convertAsyncIteratorToReadableStream, convertBase64ToUint8Array, convertImageModelFileToDataUri, convertInlineFileDataToUint8Array, convertToBase64, convertToFormData, convertUint8ArrayToBase64, createBinaryResponseHandler, createEventSourceResponseHandler, createIdGenerator, createJsonErrorResponseHandler, createJsonResponseHandler, createProviderDefinedToolFactory, createProviderDefinedToolFactoryWithOutputSchema, createProviderExecutedToolFactory, createStatusCodeErrorResponseHandler, createToolNameMapping, delay, detectMediaType, downloadBlob, dynamicTool, executeTool, extractResponseHeaders, filterNullable, generateId, getFromApi, getRuntimeEnvironmentUserAgent, getTopLevelMediaType, injectJsonInstructionIntoMessages, isAbortError, isBuffer, isCustomReasoning, isExecutableTool, isFullMediaType, isNonNullable, isParsableJson, isProviderReference, isUrlSupported, jsonSchema, lazySchema, loadApiKey, loadOptionalSetting, loadSetting, mapReasoningToProviderBudget, mapReasoningToProviderEffort, mediaTypeToExtension, normalizeHeaders, parseJSON, parseJsonEventStream, parseProviderOptions, postFormDataToApi, postJsonToApi, postToApi, readResponseWithSizeLimit, removeUndefinedEntries, resolve, resolveFullMediaType, resolveProviderReference, safeParseJSON, safeValidateTypes, serializeModelOptions, stripFileExtension, tool, validateDownloadUrl, validateTypes, withUserAgentSuffix, withoutTrailingSlash, zodSchema };
|
package/dist/index.js
CHANGED
|
@@ -862,7 +862,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
862
862
|
}
|
|
863
863
|
|
|
864
864
|
// src/version.ts
|
|
865
|
-
var VERSION = true ? "5.0.0-canary.
|
|
865
|
+
var VERSION = true ? "5.0.0-canary.40" : "0.0.0-test";
|
|
866
866
|
|
|
867
867
|
// src/get-from-api.ts
|
|
868
868
|
var getOriginalFetch = () => globalThis.fetch;
|
|
@@ -2481,7 +2481,11 @@ function isSchema(value) {
|
|
|
2481
2481
|
return typeof value === "object" && value !== null && schemaSymbol in value && value[schemaSymbol] === true && "jsonSchema" in value && "validate" in value;
|
|
2482
2482
|
}
|
|
2483
2483
|
function asSchema(schema) {
|
|
2484
|
-
return schema == null ? jsonSchema({
|
|
2484
|
+
return schema == null ? jsonSchema({
|
|
2485
|
+
type: "object",
|
|
2486
|
+
properties: {},
|
|
2487
|
+
additionalProperties: false
|
|
2488
|
+
}) : isSchema(schema) ? schema : "~standard" in schema ? schema["~standard"].vendor === "zod" ? zodSchema(schema) : standardSchema(schema) : schema();
|
|
2485
2489
|
}
|
|
2486
2490
|
function standardSchema(standardSchema2) {
|
|
2487
2491
|
return jsonSchema(
|