/** * Amazon Bedrock Converse Stream provider. * * Talks directly to `bedrock-runtime.{region}.amazonaws.com` over HTTPS with * SigV4 signing and decodes the `application/vnd.amazon.eventstream` response. * No `@aws-sdk/*`, no `@smithy/*`, no `proxy-agent`. Proxies are honored via * Bun's native `HTTPS_PROXY` support. */ import type { Effort } from "../model-thinking"; import type { StreamFunction, StreamOptions, ThinkingBudgets, Tool, ToolChoice } from "../types"; export type BedrockThinkingDisplay = "summarized" | "omitted"; export interface BedrockOptions extends StreamOptions { region?: string; profile?: string; toolChoice?: ToolChoice; reasoning?: Effort; thinkingBudgets?: ThinkingBudgets; interleavedThinking?: boolean; /** * Controls how Anthropic model returns thinking content in Bedrock responses. * - `"summarized"`: thinking blocks include human-readable summaries (default here). * - `"omitted"`: thinking content is suppressed; the encrypted signature still * travels back for multi-turn continuity. * * Starting with Anthropic model Opus 4.7 the Anthropic API default is `"omitted"`, which * leaves callers waiting on a silent stream during long reasoning runs (issue * #1373). We default to `"summarized"` so adaptive-thinking models that accept * the field keep producing visible thinking deltas. Older adaptive-thinking * models (Opus 4.6, Sonnet 4.6+) reject the field, so we omit it for them. */ thinkingDisplay?: BedrockThinkingDisplay; } interface WireToolSpec { toolSpec: { name: string; description: string; inputSchema: { json: unknown; }; }; } interface WireToolChoice { auto?: Record; any?: Record; tool?: { name: string; }; } interface WireToolConfig { tools: WireToolSpec[]; toolChoice?: WireToolChoice; } export declare const streamBedrock: StreamFunction<"bedrock-converse-stream">; export declare function stripBedrockForcedToolChoiceForRetry(body: T): T; export declare function convertToolConfig(tools: Tool[] | undefined, toolChoice: BedrockOptions["toolChoice"]): WireToolConfig | undefined; export {};