- FastAPI installation instructions FastAPI website
- SQLAlchemy installation instructions FastAPI docs
- Pydantic installation instructions Pydantic website
Install FastAPI
$pip install fastapi
Install Uvicorn:
$pip install "uvicorn[standard]"
To run the server - cd/ into the project directory and run the command:
$uvicorn endpoints:app --reload
Install Pydantic:
$pip install pydantic
- API to add custom intents, tags, patterns & responses to AI model.
- API to customize AI text-to-speech responses including: tone, personality, name, voice, etc.
- Modify API endpoints to train model.
- Can be built upon later to add NLP neural net model to games (mini plugin).
Have a look at Postman to checkout the API endpoints. Refer to the endpoints.py
file to view/manage the API endpoints.
Customize the database schema in the database/models.py
file. Add in your own database integrations by replacing the SQLALCHEMY_DATABASE_URL = ''
in the database/database.py
file. Refer to SQLAlchemy documentation for further info based on the database provider you choose.
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
# establish connection database using SQLAlchemy ORM
SQLALCHEMY_DATABASE_URL = ''
engine = create_engine(SQLALCHEMY_DATABASE_URL)
# the database session
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
# base class to create a database model/table
Base = declarative_base()
MIT