Skip to content

Latest commit

 

History

History
 
 

backend

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 virtual environment on your local machine
cd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r ./requirements.txt
  • Configure environment variables
export TABLE_NAME=BedrockChatStack-DatabaseConversationTablexxxx
export ACCOUNT=yyyy
export REGION=ap-northeast-1
export BEDROCK_REGION=us-east-1

Launch local server

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

Unit test

python tests/test_bedrock.py
python tests/repositories/test_conversation.py
python tests/repositories/test_custom_bot.py
python tests/usecases/test_bot.py
python tests/usecases/test_chat.py