Skip to content

matankley/declarai-chat-fastapi-streamlit

Repository files navigation

declarai-chat-fastapi-streamlit

View the app

img_1.png

Run with Docker

You can run the app with docker-compose.

This demo is using openai gpt-3.5 mode so make sure to add your openai token to .env file.

Go to .env file and add your openai token

DECLARAI_OPENAI_API_KEY = <your openai key> ###ENTER YOUR OPENAI KEY HERE

Then run the following command

docker-compose up -d

Visit http://localhost:8501/ to view the app

Installation

If you prefer to run the app locally, you can install the dependencies with poetry

poetry install

or with pip

pip install -r requirements.txt

Run

First run the fastapi server

export DECLARAI_OPENAI_API_KEY = <your openai token>
cd app
poetry run uvicorn main:app --reload

(replace poetry with python if you didn't use poetry)

Afterwards, run the streamlit app

poetry run streamlit run streamlit_app.py

Visit http://localhost:8501/ to view the app

About

An example how to build chatbot using declarai for interacting with the language model, fastapi as backend server and streamlit for the GUI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published