import { PrivacyConfig } from "../core/privacy.js";
import { AmplitudeOrAI } from "../types.js";
import { BaseAIProvider } from "./base.js";

//#region src/providers/bedrock.d.ts

declare const BEDROCK_AVAILABLE: boolean;
declare const _BedrockModule: Record<string, unknown> | null;
interface BedrockOptions {
  amplitude: AmplitudeOrAI;
  client: unknown;
  privacyConfig?: PrivacyConfig | null;
  /** Pass the `@aws-sdk/client-bedrock-runtime` module directly to bypass `tryRequire` (required in bundler environments). */
  bedrockModule?: unknown;
}
declare class Bedrock extends BaseAIProvider {
  private _client;
  private _bedrockMod;
  constructor(options: BedrockOptions);
  converse(params: Record<string, unknown>): Promise<unknown>;
  converseStream(params: Record<string, unknown>): Promise<unknown>;
  invokeModel(params: Record<string, unknown>): Promise<unknown>;
  invokeModelWithResponseStream(params: Record<string, unknown>): Promise<unknown>;
  get client(): unknown;
  private _wrapInvokeModelStream;
  private _wrapConverseStream;
}
declare function extractBedrockResponse(response: unknown): {
  text: string;
  inputTokens?: number;
  outputTokens?: number;
  totalTokens?: number;
  cacheReadTokens?: number;
  cacheWriteTokens?: number;
  stopReason?: string;
  toolCalls: Array<Record<string, unknown>>;
  systemPrompt?: string;
  temperature?: number;
  topP?: number;
  maxOutputTokens?: number;
};
interface BedrockInvokeModelExtract {
  text: string;
  inputTokens?: number;
  outputTokens?: number;
  totalTokens?: number;
  stopReason?: string;
  systemPrompt?: string;
  temperature?: number;
  topP?: number;
  maxOutputTokens?: number;
}
/**
 * Parse an InvokeModel response across the common Bedrock model families
 * (Anthropic, Amazon Nova/Titan, Meta Llama, Cohere, Mistral). Defensive:
 * an unrecognized family yields empty text rather than mis-parsed data.
 */
declare function extractBedrockInvokeModelResponse(modelId: string, requestBody: Record<string, unknown> | undefined, responseBody: Record<string, unknown> | undefined): BedrockInvokeModelExtract;
/**
 * Extract a single streaming delta from a decoded InvokeModel chunk. Returns
 * incremental text plus terminal usage/stop-reason when present.
 */
declare function extractBedrockInvokeModelStreamDelta(modelId: string, chunk: Record<string, unknown>): {
  text: string;
  stopReason?: string;
  inputTokens?: number;
  outputTokens?: number;
};
//#endregion
export { BEDROCK_AVAILABLE, Bedrock, BedrockOptions, _BedrockModule, extractBedrockInvokeModelResponse, extractBedrockInvokeModelStreamDelta, extractBedrockResponse };
//# sourceMappingURL=bedrock.d.ts.map