@oh-my-pi/pi-ai 18.4.5 → 18.4.6
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 +6 -0
- package/package.json +6 -6
- package/src/providers/amazon-bedrock.ts +10 -8
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oh-my-pi/pi-ai",
|
|
3
|
-
"version": "18.4.
|
|
3
|
+
"version": "18.4.6",
|
|
4
4
|
"description": "Unified LLM API with automatic model discovery and provider configuration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -155,11 +155,11 @@
|
|
|
155
155
|
"fmt": "oxfmt --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts'"
|
|
156
156
|
},
|
|
157
157
|
"dependencies": {
|
|
158
|
-
"@oh-my-pi/omptype": "18.4.
|
|
159
|
-
"@oh-my-pi/pi-catalog": "18.4.
|
|
160
|
-
"@oh-my-pi/pi-natives": "18.4.
|
|
161
|
-
"@oh-my-pi/pi-utils": "18.4.
|
|
162
|
-
"@oh-my-pi/pi-wire": "18.4.
|
|
158
|
+
"@oh-my-pi/omptype": "18.4.6",
|
|
159
|
+
"@oh-my-pi/pi-catalog": "18.4.6",
|
|
160
|
+
"@oh-my-pi/pi-natives": "18.4.6",
|
|
161
|
+
"@oh-my-pi/pi-utils": "18.4.6",
|
|
162
|
+
"@oh-my-pi/pi-wire": "18.4.6"
|
|
163
163
|
},
|
|
164
164
|
"devDependencies": {
|
|
165
165
|
"@types/bun": "^1.3.14"
|
|
@@ -459,14 +459,16 @@ export const streamBedrock: StreamFunction<"bedrock-converse-stream"> = (
|
|
|
459
459
|
? (options.anthropicPrefixMismatchBehavior ?? "drop_block")
|
|
460
460
|
: undefined;
|
|
461
461
|
|
|
462
|
-
//
|
|
463
|
-
//
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
462
|
+
// Some models (Opus/Sonnet 5.5) reject forced tool use outright; keep the
|
|
463
|
+
// tools offered under `auto` and leave thinking intact.
|
|
464
|
+
const forcedChoice = toolConfig?.toolChoice?.any || toolConfig?.toolChoice?.tool;
|
|
465
|
+
if (toolConfig && forcedChoice && !model.compat.supportsForcedToolChoice) {
|
|
466
|
+
toolConfig = { ...toolConfig, toolChoice: { auto: {} } };
|
|
467
|
+
} else if (toolConfig && forcedChoice && additionalModelRequestFields) {
|
|
468
|
+
// Bedrock rejects thinking + forced tool_choice. Fable's adaptive
|
|
469
|
+
// thinking cannot be disabled, so downgrade its forced choice instead.
|
|
470
|
+
if (prefixMismatchBehavior) toolConfig = { ...toolConfig, toolChoice: { auto: {} } };
|
|
471
|
+
else additionalModelRequestFields = undefined;
|
|
470
472
|
}
|
|
471
473
|
if (prefixMismatchBehavior) {
|
|
472
474
|
additionalModelRequestFields = applyBedrockThinkingBinding(
|