Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lailak918/tthcm

Tư Tưởng Hồ Chí Minh Chatbot
https://github.com/lailak918/tthcm

astradb chainlit genai-chatbot langchain vectorsearch

Last synced: 15 days ago
JSON representation

Tư Tưởng Hồ Chí Minh Chatbot

Awesome Lists containing this project

README

        

# Tư Tưởng Hồ Chí Minh Chatbot

This repository contains a chatbot project designed to assist users in learning about **Tư tưởng Hồ Chí Minh** (Ho Chi Minh's ideology). The chatbot provides interactive features for both **learning** and **quiz-based assessments** to test users' knowledge on the subject.

## Features

- **Learn**: Users can explore key concepts and philosophies related to Hồ Chí Minh's ideology.
- **Quiz**: Test your knowledge with interactive multiple-choice quizzes based on the content.

## Prerequisites

Make sure the following software is installed on your system:
- Docker
- Docker Compose

## Getting Started

### 1. Prepare environment variables

The project requires specific environment variables for services such as database connection, authentication, and external APIs. First, create a `.env` file in the `app/` directory:

```bash
cd app/
touch .env
```

Add the following content to the `.env` file, replacing the placeholders with your actual values:

```
ASTRADB_APPLICATION_TOKEN=AstraCS:
ASTRADB_API_URL=https://.apps.astra.datastax.com
EMBEDDINGS_TOKENS=
POSTGRES_DATABASE_URL=
CHAINLIT_AUTH_SECRET=
OPENAI_API_KEY=sk-proj-
CHAINLIT_CUSTOM_AUTH=true
LANGCHAIN_TRACING_V2=true
LANGCHAIN_ENDPOINT="https://api.smith.langchain.com"
LANGCHAIN_API_KEY=
LANGCHAIN_PROJECT="TTHCM"
OAUTH_GOOGLE_CLIENT_ID=
OAUTH_GOOGLE_CLIENT_SECRET=
CHAINLIT_URL=
```

### 2. Build and run the project

Once the `.env` file is ready, use Docker Compose to build and run the chatbot:

```bash
docker compose up -d --build
```

This command will build and run the required services in the background.

### 3. Access the chatbot

After the services have started, you can access the chatbot via the URL specified in the `CHAINLIT_URL` environment variable.

## Environment Variables

- `ASTRADB_APPLICATION_TOKEN`: Token for connecting to AstraDB.
- `ASTRADB_API_URL`: AstraDB API endpoint URL.
- `EMBEDDINGS_TOKENS`: Tokens for embeddings services.
- `POSTGRES_DATABASE_URL`: PostgreSQL database URL.
- `CHAINLIT_AUTH_SECRET`: Secret for Chainlit authentication.
- `OPENAI_API_KEY`: API key for OpenAI services.
- `CHAINLIT_CUSTOM_AUTH`: Set to `true` for custom Chainlit authentication.
- `LANGCHAIN_TRACING_V2`: Enable LangChain tracing.
- `LANGCHAIN_ENDPOINT`: LangChain API URL.
- `LANGCHAIN_API_KEY`: API key for LangChain.
- `LANGCHAIN_PROJECT`: LangChain project name, e.g., "TTHCM".
- `OAUTH_GOOGLE_CLIENT_ID`: Google OAuth client ID for user authentication.
- `OAUTH_GOOGLE_CLIENT_SECRET`: Google OAuth client secret.
- `CHAINLIT_URL`: The URL where the chatbot will be accessible.

## Notes

- Ensure the environment variables are set correctly for the chatbot to function.
- To stop the services, run:

```bash
docker compose down
```

## License

This project is licensed under the [GNU Affero General Public License v3.0](LICENSE).