Skip to content

imrobintomar/AI-Therapist-Chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

🤖 AI Therapist Chatbot

A supportive and empathetic AI-powered chatbot built with OpenAI's GPT-3.5 that acts as a therapeutic conversation partner. The chatbot provides a safe, non-judgmental space for users to express their thoughts and feelings.

🌟 Features

  • Empathetic conversation partner
  • Real-time responses
  • Chat history maintenance
  • Clean and intuitive UI using Gradio
  • Supportive and non-judgmental interaction
  • Secure API integration with OpenAI

🛠️ Technologies Used

  • Python 3.11.5
  • OpenAI GPT-3.5
  • Gradio (UI Framework)
  • Jupyter Notebook
  • OpenAI API

📋 Prerequisites

Before running this project, make sure you have:

  1. Python 3.11+ installed
  2. OpenAI API key
  3. OpenAI organization key
  4. Required Python packages installed

⚙️ Installation

  1. Clone the repository:
git clone https://github.com/yourusername/ai-therapist-chatbot.git
cd ai-therapist-chatbot
  1. Install required packages:
pip install -r requirements.txt
  1. Set up your environment variables:

    • Create a .env file in the root directory
    • Add your OpenAI API key:
      OPENAI_API_KEY=your_api_key_here
      
  2. Update the organization key in the notebook:

openai.organization = "your-organization-key"

🚀 Usage

  1. Start Jupyter Notebook:
jupyter notebook
  1. Open chat_bot_custom.ipynb

  2. Run all cells in the notebook

  3. The Gradio interface will launch at http://127.0.0.1:7861

  4. Start chatting with your AI therapist!

💡 How It Works

The chatbot uses three main components:

  1. OpenAI Integration: Connects to GPT-3.5 for generating responses
def ai_response(query):
    completion = openai.ChatCompletion.create(
        model="gpt-3.5-turbo",
        messages=[...]
    )
  1. Chat History: Maintains conversation context
def create_ui(query, past):
    output = ai_response(query)
    past.append((query, output))
    return None, past
  1. Gradio UI: Provides the user interface
with gr.Blocks(theme=gr.themes.Glass()) as demo:
    gr.Markdown("<h1><center>Your AI Therapist</center></h1>")
    chatbot = gr.Chatbot()
    msg = gr.Textbox(placeholder="Write your message here")

⚠️ Important Notes

  • This is a prototype and should not replace professional medical advice or therapy
  • Keep your API keys secure and never commit them to version control
  • The chatbot's responses are generated by AI and should be treated as such
  • Monitor your API usage to manage costs

🔒 Privacy & Security

  • No conversation data is stored permanently
  • Chat history is maintained only during the active session
  • API keys should be stored as environment variables
  • Use HTTPS when deploying to production

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License

👥 Support

For support, please open an issue in the GitHub repository or contact me @ Itsrobintomar@gmail.com.

About

A supportive and empathetic AI-powered chatbot built with OpenAI's GPT-3.5 that acts as a therapeutic conversation partner. The chatbot provides a safe, non-judgmental space for users to express their thoughts and feelings.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors