/** * 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. * * A `models.yml` `baseUrl` is the request origin verbatim (VPC endpoint, gateway, …); * only AWS's own regional host is re-pointed at the resolved region. SigV4 unaffected. */ import type { Effort } from "@oh-my-pi/pi-catalog/effort"; import type { StreamFunction, StreamOptions, ThinkingBudgets } from "../types.js"; /** * Resolve the service-model status for an in-stream exception/error code. * Frame headers carry the bare shape name in either camelCase * (`internalServerException`) or PascalCase (`InternalServerException`); both * normalize to the same map key. Unknown shapes default to 400. */ export declare function bedrockStreamExceptionStatus(code: string): number; export type BedrockThinkingDisplay = "summarized" | "omitted"; /** Bedrock guardrail trace verbosity, mirrors the Converse `guardrailConfig.trace` values. */ export type BedrockGuardrailTrace = "enabled" | "disabled" | "enabled_full"; export interface BedrockOptions extends StreamOptions { region?: string; profile?: string; /** Amazon Bedrock API key sent as `Authorization: Bearer`, ahead of SigV4 credential resolution. */ bearerToken?: string; /** * Amazon Bedrock Guardrail id or ARN. When set, the Converse request carries a * `guardrailConfig` so accounts that gate `bedrock:InvokeModel*` on the * `bedrock:GuardrailIdentifier` condition key stop returning an explicit deny. */ guardrailIdentifier?: string; /** Guardrail version to apply. Defaults to `"DRAFT"` when a guardrail is set. */ guardrailVersion?: string; /** Guardrail trace verbosity. Left unset (Bedrock default) unless provided. */ guardrailTrace?: BedrockGuardrailTrace; toolChoice?: "auto" | "any" | "none" | { type: "tool"; name: string; }; reasoning?: Effort; thinkingBudgets?: ThinkingBudgets; interleavedThinking?: boolean; /** * Controls how Claude 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 Claude Opus 4.7 and Claude Fable/Mythos 5 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; /** * Per-request Bedrock invocation-log tags. Merged over `model.requestMetadata` * (per-call entries win on key collision). AWS caps the result at 16 entries; * keys 1-256 chars, values 0-256 chars, both limited to * `[a-zA-Z0-9\s:_@$#=/+,-.]`. Entries outside those limits are dropped. */ requestMetadata?: Record; } export declare const streamBedrock: StreamFunction<"bedrock-converse-stream">;