MCPcopy Index your code
hub / github.com/ZhuJD-China/RainbowGPT

github.com/ZhuJD-China/RainbowGPT @0.11

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.11 ↗ · + Follow
184 symbols 1,140 edges 63 files 38 documented · 21%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

RainbowGPT

<a align="center" href="https://github.com/ZhuJD-China/RainbowGPT" target="_blank">
  <img width="20%" height="150"  src="https://github.com/ZhuJD-China/RainbowGPT/blob/master/imgs/logo.jpg"></a>

🌈RainbowAgent Integration Summary:

🎨 Simplified MySQL Management: Mysql Agent UI module offers a powerful, user-friendly interface for seamless database navigation, catering to all skill levels.

📉 Comprehensive Stock Insights: RainbowGPT's Stock Analysis module utilizes advanced tech for a holistic view of market trends, risk assessments, and predictive analytics, empowering users with detailed reports and personalized recommendations.

⚙️ Technological Synergy: Integration of AI Agent proxy, GPT-4, GPT3.5, ChatGlm3, Qwen, Local base-API LLM, ChromaDB vector database, Langchain knowledge base, and Google search engine ensures a cohesive fusion, enhancing adaptability and information flow.

🚀 Innovation Roadmap: RainbowGPT commits to continuous expansion, refining features, and integrating emerging technologies, ensuring users stay at the forefront of AI advancements.

Specify areas for further discussion or features of interest! 🚀✨ Succinct and clear.

Navigate at [cookbook.openai.com]

🦜️🔗 LangChain ⚡ Building applications with LLMs through composability ⚡

🤗 Qwen HF&nbsp&nbsp | &nbsp&nbsp🤖 Qwen ModelScope&nbsp&nbsp | &nbsp&nbsp 📑 Qwen Paper &nbsp&nbsp | &nbsp&nbsp🖥️ Qwen Demo

🤗 Chatglm3 HF Repo • 🤖 Chatglm3 ModelScope • 📃 [GLM@ACL 22] [GitHub] • 📃 [GLM-130B@ICLR 23] [GitHub]

Table of Contents

  1. Getting Started
  2. Environment Setup
  3. API Configuration
  4. Free Use of GPT API
  5. Knowledge Base QA Search Algorithm
  6. BM25 Retrievers
  7. EnsembleRetriever
  8. Common Usage Pattern
  9. RainbowGPT Overview

Getting Started

Environment Setup

  1. Install Required Packages: Make sure your environment is set up, and install the necessary packages using the following command: bash pip install -r requirements.txt Note: If you encounter any issues, ensure that you have the correct dependencies installed.

⚠️Before running RainbowGPT_Agent_ui.py, ensure you move the modified 3rd_modify/langchain/vectorstores/chroma.py file to the Langchain module's library folder and rename it to match the library file. This step is crucial for proper execution. 🌈

API Configuration

Before using the application, follow these steps to configure API-related information in the .env file: 1. OpenAI API Key: - Create an account on OpenAI and obtain your API key. - Open the .env file and set your API key: plaintext OPENAI_API_KEY=YOUR_OPENAI_API_KEY Replace YOUR_OPENAI_API_KEY with the actual API key you obtained from OpenAI. Ensure accuracy to prevent authentication issues.

  1. Local API URL (Qwen examples):
  2. To start a Qwen server with OpenAI-like capabilities, use the following commands: python pip install fastapi uvicorn openai pydantic sse_starlette python Rainbow_utils/get_local_openai_api.py After starting the server, configure the api_base and api_key in your client. Ensure that the configuration follows the specified format. python llm = ChatOpenAI( model_name="Qwen", openai_api_base="http://localhost:8000/v1", openai_api_key="EMPTY", streaming=False, ) ✨ I have already integrated it. Please fill in the corresponding apibase and apikey in UI.

Now your environment is set up, and the API is configured. You are ready to run the application! Feel free to let me know if you have any specific preferences or additional details you'd like to include!

Free Use of GPT API

🌐 We are committed to expanding capacity based on usage and providing the API for free as long as we are not officially sanctioned. If you find this project helpful, please consider giving us a ⭐.

⚠️Due to frequent malicious requests, we no longer offer public free keys directly. Now, you need to use your GitHub account to claim your own free key.

This API Key is used for forwarding API requests. Change the Host to api.chatanywhere.com.cn (preferred for domestic usage) or api.chatanywhere.cn (for international usage, domestic users need a global proxy).

  • 🚀 Apply for a Free API Key in Beta
  • Forwarding Host1: https://api.chatanywhere.com.cn (Domestic relay, lower latency, recommended)
  • Forwarding Host2: https://api.chatanywhere.cn (For international usage, domestic users need a global proxy)
  • Check your balance and usage records (announcements are also posted here): Balance Inquiry and Announcements
  • The forwarding API cannot directly make requests to the official api.openai.com endpoint. Change the request address to api.chatanywhere.com.cn to use it. Most plugins and software can be modified accordingly.

Method 1

import openai
openai.api_base = "https://api.chatanywhere.com.cn/v1"
# openai.api_base = "https://api.chatanywhere.cn/v1"

Method 2 (Use if Method 1 doesn't work) Modify the environment variable OPENAI_API_BASE. Search for how to change environment variables on your specific system. If changes to the environment variable don't take effect, restart your system.

OPENAI_API_BASE=https://api.chatanywhere.com.cn/v1
or OPENAI_API_BASE=https://api.chatanywhere.cn/v1

Open Source gpt_academic Locate the config.py file and modify the API_URL_REDIRECT configuration to the following:

API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "https://api.chatanywhere.com.cn/v1/chat/completions"}
# API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "https://api.chatanywhere.cn/v1/chat/completions"}

The free API Key has a limit of 60 requests per hour per IP address and Key. If you use multiple keys under the same IP, the total hourly request limit for all keys cannot exceed 60. Similarly, if you use a single key across multiple IPs, the hourly request limit for that key cannot exceed 60.

Knowledge Base QA Search Algorithm

🧠 The knowledge base QA search algorithm optimizes document retrieval through context compression. Leveraging the query context, it strategically reduces document content using a document compressor, enhancing retrieval efficiency by returning only information relevant to the query. The ensemble of retrievers combines diverse results, creating a synergy that elevates overall performance.

BM25 Retrievers

  • BM25-based Retriever: Specialized in efficiently locating relevant documents based on keywords, making it particularly effective for sparse retrieval.
  • Embedding Similarity Retriever: Utilizes embedding vectors for document and query embedding, excelling in identifying relevant documents through semantic similarity. This retriever is well-suited for dense retrieval scenarios.

EnsembleRetriever

🚀EnsembleRetriever is a powerful retrieval mechanism that combines the strengths of various retrievers. It takes a list of retrievers as input, integrates their results using the get_relevant_documents() methods, and reranks the outcomes using the Reciprocal Rank Fusion algorithm.

By leveraging the diverse strengths of different algorithms, EnsembleRetriever achieves superior performance compared to individual retrievers.

Common Usage Pattern

🔄 The most effective use of the Knowledge Base QA Search involves combining a sparse retriever (e.g., BM25) with a dense retriever (e.g., embedding similarity). This "hybrid search" optimally utilizes the complementary strengths of both retrievers for comprehensive Knowledge.

📊 Explore the Stock Analysis module and unlock valuable insights for your investment decisions! 🚀 #StockAnalysis #RainbowGPT #AIInvesting

RainbowGPT Overview

👋 Retrieval Search 📚 SQL Agent
⚡🌐 Web Scraping Summarization 🤖 Chatbots

🤗 Rainbow Agent UI WebScraping

📊 StockGPT Analysis StockGPT

SQL_Agent UI SQL_Agent

Star History Chart

🚀 Explore the diverse capabilities of RainbowGPT and leverage its powerful modules for your projects! 🌈✨

🌟 Contributors

langchain contributors

Core symbols most depended-on inside this repo

get
called by 33
3rd_modify/langchain/vectorstores/chroma.py
format
called by 10
examples/LangChain_demo/CustomLLMagent.py
from_documents
called by 7
3rd_modify/langchain/vectorstores/chroma.py
from_texts
called by 4
3rd_modify/langchain/vectorstores/chroma.py
tool_wrapper_for_qwen
called by 4
Qwen_Agent/Qwen_Agent_langchain_tools.py
main
called by 4
Qwen_Agent/Qwen_Agent_langchain_tools.py
filter_chinese_english_punctuation
called by 4
Rainbow_utils/get_tokens_cal_filter.py
_results_to_docs_and_scores
called by 3
3rd_modify/langchain/vectorstores/chroma.py

Shape

Function 89
Method 65
Class 28
Route 2

Languages

Python100%

Modules by API surface

3rd_modify/langchain/vectorstores/chroma.py25 symbols
Rainbow_utils/get_local_openai_api.py22 symbols
Stock_Agent/StockGPTAnalysis_ui.py10 symbols
RainbowChromadb_option_ui.py9 symbols
Chatglm3_Agent/ChatGLM3.py9 symbols
examples/Agent_Actions_V1.0_.py8 symbols
RainbowGPT_Agent_ui.py8 symbols
Qwen_Agent/Qwen_Agent_langchain_tools.py8 symbols
Rainbow_utils/get_google_result.py7 symbols
examples/LangChain_demo/Custom_agent_with_tool_retrieval.py6 symbols
SQL_Agent/csv&xlsx2mysql-ui.py6 symbols
examples/LangChain_demo/agent_Running Agent as an Iterator.py5 symbols

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add RainbowGPT \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page