This repository contains a serverless application built with AWS CDK, Hono, and Zod. The application serves as a proxy for Bedrock, providing a chat interface and handling various chat-related requests and responses.
To install the dependencies, run:
npm install
To start the development server, run:
npm run dev
The project is organized as follows:
lambda/bedrock-proxy/src/
: Contains the source code for the Lambda functions and related schemas.lib/
: Contains the AWS CDK constructs and stack definitions.
The project uses Zod for schema validation. The schemas are defined in the lambda/bedrock-proxy/src/schema
directory.
The response schemas are defined in lambda/bedrock-proxy/src/schema/response/chat.ts
:
The request schemas are defined in lambda/bedrock-proxy/src/schema/request/chat.ts
:
The API endpoints are defined in lambda/bedrock-proxy/src/api/chat.ts
:
- Method: POST
- Description: Handles chat completions.
- Request Body: Validated against
ChatRequestSchema
. - Response: Returns a chat response.
To deploy the project, run:
npm run deploy
This will build the project, create a zip file, and update the Lambda function code.