Skip to content
kevanweePublic

About

discord chatbot for sg tort law!

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🐀 Tort Rat

Tort Rat is a CLI-based Discord chatbot developed as a side project for SMU's LAW105: Law of Torts course. It leverages Retrieval-Augmented Generation (RAG) to answer questions about key tort law cases and concepts. Trained on a curated set of case summaries, Tort Rat can:

image

  • 📖 Explain legal doctrines and tests;
  • ⚖️ Address basic hypothetical questions; and
  • 🧠 Provide concise answers to enhance legal understanding.

🛠 Technical Details

  • Built using PostgresML and Python

🚀 Setup

pip install pgml-chat
python -m venv {file_path}

Clone the repository for its ingest folder and .env.example:

git clone https://github.com/kevanwee/tortrat.git

Copy .env.example to .env (which Git ignores) and add the OpenAI API key, PostgresML database link, and Discord bot token:

OPENAI_API_KEY=<>
DATABASE_URL=<>
DISCORD_BOT_TOKEN=<>

📥 Data Ingestion

To ingest data, run:

LOG_LEVEL=DEBUG pgml-chat --root_dir ingest --collection_name tort --stage {file_path/ingest}

🤖 Running the Bot

To start the Discord bot, use:

LOG_LEVEL=ERROR pgml-chat --collection_name tort --chat_completion_model gpt-3.5-turbo --stage chat --chat_interface discord

About

discord chatbot for sg tort law!

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors