INNER CODE UNIT · JavaScript

HTTPError

serverless/aws-ai-stack · ai-chat-api/handler.js:19

class HTTPError extends Error {
  constructor(statusCode, message) {
    super(message);
    this.statusCode = statusCode;
  }
}

/**
 * Initialize the AWS SDK Dynamo Doc Client.
 */
const USAGE_TABLE_NAME = process.env.USAGE_TABLE_NAME;
const dynamoDbClient = new DynamoDBClient();
const dynamoDbDocClient = DynamoDBDocumentClient.from(dynamoDbClient);

/**
 * Defines the zod schema for the input payload to pass on to AWS Bedrock's
 * model. This is passed to the ConverseStreamCommand as a part of the user
 * input.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…