InternLM / MindSearch

🔍 An LLM-based Multi-agent Framework of Web Search Engine (like Perplexity.ai Pro and SearchGPT)
https://mindsearch.netlify.app/
Apache License 2.0
4.59k stars 456 forks source link

Pull Request: Integrate .env File Support and Add Backend Usage Example #187

Closed Jiayou-Chao closed 1 week ago

Jiayou-Chao commented 2 weeks ago

Description

This pull request introduces two enhancements to the MindSearch project:

  1. Environment Variables Configuration:

    • Added support for managing environment variables using a .env file.
    • Updated models.py to load environment variables using python-dotenv.
    • Modified GPT-4 and Silicon model configurations to use values from the .env file or defaults.
    • Updated .gitignore to exclude the .env file.
    • Updated requirements.txt to include python-dotenv.
  2. Backend Usage Example:

    • Added backend_example.py to demonstrate how to interact with the backend directly, without using the frontend.

Changes

How to Test

  1. Setup Environment Variables:

    • Rename .env.example to .env and fill in the required values.
  2. Run Backend Example:

    • Ensure the backend is running.
    • Execute python backend_example.py to test direct backend interaction.

Additional Information

Harold-lkk commented 2 weeks ago

Thanks for your contribution, we will review as soon as possible