/streamlit_langchain

Langchain Project via Streamlit by using Gemini and OpenAI

Primary LanguagePython

LangChain - Conversational AI with Gemini and OpenAI

LangChain is a conversational AI application that leverages the power of the Gemini and OpenAI models to provide users with an interactive chat experience. Users can ask questions and receive answers based on the context provided by uploaded PDF documents.

image

Features

  • Multi-Model Support: LangChain supports both the Gemini and OpenAI models for conversational AI.
  • PDF Document Integration: Users can upload PDF documents to provide context for the conversation.
  • Interactive Chat Interface: Users can ask questions and receive immediate responses within the application.
  • Conversation History: All user queries and responses are logged, allowing users to review past interactions.
  • Export to CSV: Users can export conversation logs to CSV format for further analysis.

Getting Started

To run the LangChain application locally, follow these steps:

  1. Clone this repository to your local machine.
  2. Install the required dependencies by running pip install -r requirements.txt.
  3. Run the application using Streamlit: streamlit run langchain_app.py.
  4. Set up your environment variables:
    • OPENAI_API_KEY: Your OpenAI API key (required for OpenAI model).
    • GOOGLE_API_KEY: Your Google API key (required for Gemini model).
  5. Upload PDF documents and start asking questions!

Usage

Once the LangChain application is running, follow these steps to use it:

  1. Upload PDF documents using the file uploader on the sidebar.
  2. Select the model you want to use (Gemini or OpenAI) from the sidebar radio button.
  3. Enter your API keys for the selected model in the respective text inputs.
  4. Type your question in the text input field and press Enter or click the "Submit & Process" button.
  5. View the conversation history and download it as a CSV file from the sidebar.

Feedback

We welcome any feedback or suggestions for improving LangChain! Feel free to open an issue on GitHub or contact us directly.

Links

Contributors