Giter VIP home page Giter VIP logo

langchain-assistant's Introduction

LangChain Assistant

"Build your own ChatGPT on Telegram, WhatsApp and Facebook Messenger!"

LangChain Assistant is a versatile chatbot that leverages state-of-the-art Language Models (currently GPT-3, GPT-3.5-Turbo and GPT-4) to interact with users via Telegram, WhatsApp and Facebook Messenger. The primary goal is to keep AI development open, fun, and accessible. LangChain Assistant can handle text messages, voice messages, put stuff in your calendar and even generate images using OpenAI's DALL-E.

Features

  • Communicate with OpenAIs GPT-3, GPT-3.5-Turbo, GPT-4 models via config.py
  • Support for text and voice messages
  • Integration with Telegram, WhatsApp and Facebook Messenger
  • Generate images using OpenAI's DALL-E
  • Add Google Calendar events via Zapier NLA

Roadmap

  • Support gpt4all
  • Support Facebook Messenger
  • Send emails
  • Write and store code ideas
  • Docker support
  • AGI...
  • ... and more!

Get Images from DALL-E

To generate images using OpenAI's DALL-E, include the text '/image' in your chat message. The default image size is "256x256" and can be modified in the config.py file.

Deployment

Try for Free

To deploy LangChain Assistant for free on Replit:

Prerequisites

  • Python 3.7 or higher
  • A Telegram bot token from @BotFather
  • An OpenAI API key
  • A Twilio account with a WhatsApp enabled phone number

Installation

  1. Clone the repository and navigate to the project directory.

  2. Install the required Python packages:

pip install -r requirements.txt

  1. Create a .env file in the project directory and add the following variables:
    TELEGRAM_BOT_TOKEN=
    OPENAI_API_KEY=
    TEMPERATURE_VALUE=
    ACCOUNT_SID= #Twilio
    AUTH_TOKEN= #Twilio
    TWILIO_WHATSAPP_NUMBER = #Twilio sandbox / business number
    FACEBOOK_PAGE_ID = #
    

Setup Telegram

  1. Run the FastAPI server:
uvicorn main:app --reload --port 8000

(when running locally on Windows) 2. Expose the local server using NGROK:

ngrok http 8000
  1. Set up the webhook for your Telegram bot:
  • Replace {YOUR_TOKEN} with your Telegram bot token.
  • Replace {YOUR_WEBHOOK_ENDPOINT} with your NGROK domain followed by /webhook/.
https://api.telegram.org/bot{YOUR_TOKEN}/setWebhook?url={YOUR_WEBHOOK_ENDPOINT}

Setup WhatsApp

  1. Activate the Twilio Sandbox for WhatsApp and obtain the Account SID and Auth Token.

  2. Add the Twilio WhatsApp phone number to your contacts and send a message to join the sandbox.

  3. Update the webhook URL in the Twilio Sandbox settings with your FastAPI server URL.

Setup Facebook Messenger

  • Guide coming soon

For more details, follow the Twilio tutorial: Send and Receive Media Messages with WhatsApp in Python

Facebook Messenger

How to set Google Calendar Event

langchain-assistant's People

Contributors

derek-dv avatar harsh-2811 avatar mortium91 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.