@ai-sdk/amazon-bedrock
Advanced tools
Comparing version 0.0.23 to 0.0.24
@@ -148,2 +148,3 @@ "use strict"; | ||
case "content_filtered": | ||
case "guardrail_intervened": | ||
return "content-filter"; | ||
@@ -180,5 +181,6 @@ case "tool_use": | ||
seed, | ||
providerMetadata, | ||
headers | ||
}) { | ||
var _a; | ||
var _a, _b; | ||
const type = mode.type; | ||
@@ -234,3 +236,4 @@ const warnings = []; | ||
}, | ||
messages | ||
messages, | ||
guardrailConfig: (_a = providerMetadata == null ? void 0 : providerMetadata.bedrock) == null ? void 0 : _a.guardrailConfig | ||
}; | ||
@@ -242,3 +245,3 @@ switch (type) { | ||
...baseArgs, | ||
...((_a = toolConfig.tools) == null ? void 0 : _a.length) ? { toolConfig } : {} | ||
...((_b = toolConfig.tools) == null ? void 0 : _b.length) ? { toolConfig } : {} | ||
}; | ||
@@ -281,2 +284,3 @@ } | ||
const { messages: rawPrompt, ...rawSettings } = args; | ||
const providerMetadata = response.trace ? { bedrock: { trace: response.trace } } : void 0; | ||
return { | ||
@@ -302,3 +306,4 @@ text: (_d = (_c = (_b = (_a = response.output) == null ? void 0 : _a.message) == null ? void 0 : _b.content) == null ? void 0 : _c.map((part) => { | ||
rawCall: { rawPrompt, rawSettings }, | ||
warnings: [] | ||
warnings: [], | ||
providerMetadata | ||
}; | ||
@@ -317,2 +322,3 @@ } | ||
}; | ||
let providerMetadata = void 0; | ||
if (!response.stream) { | ||
@@ -372,2 +378,9 @@ throw new Error("No stream found"); | ||
}; | ||
if (value.metadata.trace) { | ||
providerMetadata = { | ||
bedrock: { | ||
trace: value.metadata.trace | ||
} | ||
}; | ||
} | ||
} | ||
@@ -409,3 +422,4 @@ if ((_f = (_e = value.contentBlockDelta) == null ? void 0 : _e.delta) == null ? void 0 : _f.text) { | ||
finishReason, | ||
usage | ||
usage, | ||
providerMetadata | ||
}); | ||
@@ -412,0 +426,0 @@ } |
# @ai-sdk/amazon-bedrock | ||
## 0.0.24 | ||
### Patch Changes | ||
- 01fc6c0: feat (provider/amazon-bedrock): support guardrails | ||
## 0.0.23 | ||
@@ -4,0 +10,0 @@ |
@@ -148,2 +148,3 @@ "use strict"; | ||
case "content_filtered": | ||
case "guardrail_intervened": | ||
return "content-filter"; | ||
@@ -180,5 +181,6 @@ case "tool_use": | ||
seed, | ||
providerMetadata, | ||
headers | ||
}) { | ||
var _a; | ||
var _a, _b; | ||
const type = mode.type; | ||
@@ -234,3 +236,4 @@ const warnings = []; | ||
}, | ||
messages | ||
messages, | ||
guardrailConfig: (_a = providerMetadata == null ? void 0 : providerMetadata.bedrock) == null ? void 0 : _a.guardrailConfig | ||
}; | ||
@@ -242,3 +245,3 @@ switch (type) { | ||
...baseArgs, | ||
...((_a = toolConfig.tools) == null ? void 0 : _a.length) ? { toolConfig } : {} | ||
...((_b = toolConfig.tools) == null ? void 0 : _b.length) ? { toolConfig } : {} | ||
}; | ||
@@ -281,2 +284,3 @@ } | ||
const { messages: rawPrompt, ...rawSettings } = args; | ||
const providerMetadata = response.trace ? { bedrock: { trace: response.trace } } : void 0; | ||
return { | ||
@@ -302,3 +306,4 @@ text: (_d = (_c = (_b = (_a = response.output) == null ? void 0 : _a.message) == null ? void 0 : _b.content) == null ? void 0 : _c.map((part) => { | ||
rawCall: { rawPrompt, rawSettings }, | ||
warnings: [] | ||
warnings: [], | ||
providerMetadata | ||
}; | ||
@@ -317,2 +322,3 @@ } | ||
}; | ||
let providerMetadata = void 0; | ||
if (!response.stream) { | ||
@@ -372,2 +378,9 @@ throw new Error("No stream found"); | ||
}; | ||
if (value.metadata.trace) { | ||
providerMetadata = { | ||
bedrock: { | ||
trace: value.metadata.trace | ||
} | ||
}; | ||
} | ||
} | ||
@@ -409,3 +422,4 @@ if ((_f = (_e = value.contentBlockDelta) == null ? void 0 : _e.delta) == null ? void 0 : _f.text) { | ||
finishReason, | ||
usage | ||
usage, | ||
providerMetadata | ||
}); | ||
@@ -412,0 +426,0 @@ } |
{ | ||
"name": "@ai-sdk/amazon-bedrock", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
120099
1567
22675
11
0