fredliubojin / langchain_gradio

LiveQuery GPT-4: chatbot with GPT-4-powered convos & Google-powered real-time search
84 stars 25 forks source link

🚀 LiveQuery GPT-4: chatbot with GPT-4-powered convos & Google-powered real-time search

Welcome to the LiveQuery GPT-4 project! 🎉 This is a simple chatbot powered by OpenAI's GPT-4, LangChain framework, Gradio, and Google Custom Search API. It utlizes LangChain's ReAct Agent to enable GTP-4 based chat to have access to live Google search results.

Conversation Example

UI

Screenshot

LangChain reasoning for the same conversation

Screenshot

Features & Roadmap 💡

Installation

  1. Clone this repository:

    git clone https://github.com/yourusername/gpt-4-langchain-conversational-assistant.git
  2. Install the required packages:

    pip install -r requirements.txt
  3. Create a Google Programmable Search engine and copy the ID.

  4. Enable the Custom Search API in your GCP console, and create a GCP API key here.

  5. Create a .env file with all environment variables needed:

    OPENAI_API_KEY="your_openai_api_key"
    GOOGLE_CSE_ID="your_google_programable_search_id"
    GOOGLE_API_KEY="your_gcp_api_key"

Usage

  1. Run the server:
    python run_chatbot.py
  2. Open the Gradio interface in your web browser at http://127.0.0.1:7860

Contributing

We would love for you to contribute to this project! 🤗 If you have any ideas, suggestions, or improvements, please feel free to submit a pull request or open an issue.