import { BedrockActionGroupLambdaEvent, BedrockActionGroupLambdaResponse, Parameter } from '../types/chatbot/bedrock.mjs'; import { SessionDataWithChatUserCustomDataSpreadIn, RecordOrUndef } from '../types/chatbot/chatbot-types.mjs'; import '@aws-sdk/client-bedrock-agent-runtime'; import '@aws-sdk/client-bedrock-agentcore'; /** * Handles an error and returns a BedrockLambdaResponse object. * * If the error is an instance of BedrockLambdaError, it will be returned as is. * Otherwise, it will be converted to a string and returned as a BedrockLambdaError. * * @param error The error to handle. * @returns A BedrockLambdaResponse object. */ declare function handleBedrockError(error: unknown, event: BedrockActionGroupLambdaEvent, sessionAttributes?: SessionDataWithChatUserCustomDataSpreadIn): BedrockActionGroupLambdaResponse; /** * Converter functions for Bedrock parameters. */ declare const converters: Record any>; /** * Converts Bedrock parameters to the correct type. * @param params - The parameters to convert. * @returns A record of parameter names and their converted values. */ declare function convertBedrockParamsToCorrectType(params?: Parameter[]): Record; /** * Normalizes the session attributes, converting the type to T. An empty sessionAttributes object is the * same as undefined. * * Type T is the type of the session attributes. * * @param sessionAttributes The session attributes. * @returns The normalized session attributes. */ declare function normalizeSessionAttributes(sessionAttributes?: SessionDataWithChatUserCustomDataSpreadIn): SessionDataWithChatUserCustomDataSpreadIn | undefined; /** * Creates a BedrockLambdaResponse object. * * Type T is the type of the session attributes. By including the sessionAttributes * parameter, we are telling Bedrock to persist the session attributes for the * duration of the session and they will be passed in on all subsequent calls * using the event.sessionAttributes parameter. * * @param body The body of the response. * @param actionGroup The action group. * @param messageVersion The message version. * @param functionName The function name. * @param sessionAttributes The session attributes. * @param failed Whether the response is a failure. * @returns A BedrockLambdaResponse object. */ declare function createBedrockLambdaResponse(body: string | Record, actionGroup: string, messageVersion: string, functionName: string, sessionAttributes?: SessionDataWithChatUserCustomDataSpreadIn, failed?: boolean): BedrockActionGroupLambdaResponse; export { convertBedrockParamsToCorrectType, converters, createBedrockLambdaResponse, handleBedrockError, normalizeSessionAttributes };