Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.39 KB

README.md

File metadata and controls

44 lines (33 loc) · 1.39 KB

Backend API

Written in Python with FastAPI.

Getting started

  • To get started, we need to deploy resources to create DynamoDB / Bedrock resource. To deploy, please see Deploy using CDK.
  • Create poetry environment on your local machine
cd backend
python3 -m venv .venv  # Optional (If you don't want to install poetry on your env)
source .venv/bin/activate  # Optional (If you don't want to install poetry on your env)
pip install poetry
poetry install
  • Configure environment variables
export TABLE_NAME=BedrockChatStack-DatabaseConversationTablexxxx
export ACCOUNT=yyyy
export REGION=ap-northeast-1
export BEDROCK_REGION=ap-southeast-2
export DOCUMENT_BUCKET=bedrockchatstack-documentbucketxxxxxxx
export LARGE_MESSAGE_BUCKET=bedrockchatstack-largemessagebucketxxx
export USER_POOL_ID=xxxxxxxxx
export CLIENT_ID=xxxxxxxxx

Launch local server

poetry run uvicorn app.main:app  --reload --host 0.0.0.0 --port 8000

Unit test

poetry run python tests/test_bedrock.py
poetry run python tests/test_repositories/test_conversation.py