mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-01 01:04:43 +00:00
Add: config
This commit is contained in:
72
.env.template
Normal file
72
.env.template
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
#*******************************************************************#
|
||||||
|
#** DB-GPT - GENERAL SETTINGS **#
|
||||||
|
#*******************************************************************#
|
||||||
|
## DISABLED_COMMAND_CATEGORIES - The list of categories of commands that are disabled. Each of the below are an option:
|
||||||
|
## pilot.commands.query_execute
|
||||||
|
|
||||||
|
## For example, to disable coding related features, uncomment the next line
|
||||||
|
# DISABLED_COMMAND_CATEGORIES=
|
||||||
|
|
||||||
|
|
||||||
|
#*******************************************************************#
|
||||||
|
#*** LLM PROVIDER ***#
|
||||||
|
#*******************************************************************#
|
||||||
|
|
||||||
|
# TEMPERATURE=0
|
||||||
|
|
||||||
|
#*******************************************************************#
|
||||||
|
#** LLM MODELS **#
|
||||||
|
#*******************************************************************#
|
||||||
|
|
||||||
|
## SMART_LLM_MODEL - Smart language model (Default: vicuna-13b)
|
||||||
|
## FAST_LLM_MODEL - Fast language model (Default: chatglm-6b)
|
||||||
|
# SMART_LLM_MODEL=vicuna-13b
|
||||||
|
# FAST_LLM_MODEL=chatglm-6b
|
||||||
|
|
||||||
|
|
||||||
|
### EMBEDDINGS
|
||||||
|
## EMBEDDING_MODEL - Model to use for creating embeddings
|
||||||
|
## EMBEDDING_TOKENIZER - Tokenizer to use for chunking large inputs
|
||||||
|
## EMBEDDING_TOKEN_LIMIT - Chunk size limit for large inputs
|
||||||
|
# EMBEDDING_MODEL=all-MiniLM-L6-v2
|
||||||
|
# EMBEDDING_TOKENIZER=all-MiniLM-L6-v2
|
||||||
|
# EMBEDDING_TOKEN_LIMIT=8191
|
||||||
|
|
||||||
|
|
||||||
|
#*******************************************************************#
|
||||||
|
#** DATABASE SETTINGS **#
|
||||||
|
#*******************************************************************#
|
||||||
|
DB_SETTINGS_MYSQL_USER=root
|
||||||
|
DB_SETTINGS_MYSQL_PASSWORD=password
|
||||||
|
DB_SETTINGS_MYSQL_HOST=localhost
|
||||||
|
DB_SETTINGS_MYSQL_PORT=3306
|
||||||
|
|
||||||
|
|
||||||
|
### MILVUS
|
||||||
|
## MILVUS_ADDR - Milvus remote address (e.g. localhost:19530)
|
||||||
|
## MILVUS_USERNAME - username for your Milvus database
|
||||||
|
## MILVUS_PASSWORD - password for your Milvus database
|
||||||
|
## MILVUS_SECURE - True to enable TLS. (Default: False)
|
||||||
|
## Setting MILVUS_ADDR to a `https://` URL will override this setting.
|
||||||
|
## MILVUS_COLLECTION - Milvus collection, change it if you want to start a new memory and retain the old memory.
|
||||||
|
# MILVUS_ADDR=localhost:19530
|
||||||
|
# MILVUS_USERNAME=
|
||||||
|
# MILVUS_PASSWORD=
|
||||||
|
# MILVUS_SECURE=
|
||||||
|
# MILVUS_COLLECTION=dbgpt
|
||||||
|
|
||||||
|
#*******************************************************************#
|
||||||
|
#** ALLOWLISTED PLUGINS **#
|
||||||
|
#*******************************************************************#
|
||||||
|
|
||||||
|
#ALLOWLISTED_PLUGINS - Sets the listed plugins that are allowed (Example: plugin1,plugin2,plugin3)
|
||||||
|
#DENYLISTED_PLUGINS - Sets the listed plugins that are not allowed (Example: plugin1,plugin2,plugin3)
|
||||||
|
ALLOWLISTED_PLUGINS=
|
||||||
|
DENYLISTED_PLUGINS=
|
||||||
|
|
||||||
|
|
||||||
|
#*******************************************************************#
|
||||||
|
#** CHAT PLUGIN SETTINGS **#
|
||||||
|
#*******************************************************************#
|
||||||
|
# CHAT_MESSAGES_ENABLED - Enable chat messages (Default: False)
|
||||||
|
# CHAT_MESSAGES_ENABLED=False
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -131,5 +131,5 @@ dmypy.json
|
|||||||
.pyre/
|
.pyre/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
logs
|
logs
|
||||||
|
nltk_data
|
||||||
.vectordb
|
.vectordb
|
@@ -36,6 +36,10 @@ The Generated SQL is runable.
|
|||||||
|
|
||||||
<img src="https://github.com/csunny/DB-GPT/blob/main/asserts/DB_QA.png" margin-left="auto" margin-right="auto" width="600">
|
<img src="https://github.com/csunny/DB-GPT/blob/main/asserts/DB_QA.png" margin-left="auto" margin-right="auto" width="600">
|
||||||
|
|
||||||
|
基于默认内置知识库QA
|
||||||
|
|
||||||
|
<img src="https://github.com/csunny/DB-GPT/blob/main/asserts/VectorDBQA.png" width="600" margin-left="auto" margin-right="auto" >
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
1. First you need to install python requirements.
|
1. First you need to install python requirements.
|
||||||
```
|
```
|
||||||
@@ -79,6 +83,7 @@ python webserver.py
|
|||||||
|
|
||||||
总的来说,它是一个用于数据库的复杂且创新的AI工具。如果您对如何在工作中使用或实施DB-GPT有任何具体问题,请联系我, 我会尽力提供帮助, 同时也欢迎大家参与到项目建设中, 做一些有趣的事情。
|
总的来说,它是一个用于数据库的复杂且创新的AI工具。如果您对如何在工作中使用或实施DB-GPT有任何具体问题,请联系我, 我会尽力提供帮助, 同时也欢迎大家参与到项目建设中, 做一些有趣的事情。
|
||||||
|
|
||||||
|
# Contribute
|
||||||
|
[Contribute](https://github.com/csunny/DB-GPT/blob/main/CONTRIBUTING)
|
||||||
# Licence
|
# Licence
|
||||||
[MIT](https://github.com/csunny/DB-GPT/blob/main/LICENSE)
|
[MIT](https://github.com/csunny/DB-GPT/blob/main/LICENSE)
|
BIN
asserts/VectorDBQA.png
Normal file
BIN
asserts/VectorDBQA.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 560 KiB |
@@ -57,11 +57,11 @@ dependencies:
|
|||||||
- sentence-transformers
|
- sentence-transformers
|
||||||
- umap-learn
|
- umap-learn
|
||||||
- notebook
|
- notebook
|
||||||
- gradio==3.24.1
|
- gradio==3.23
|
||||||
- gradio-client==0.0.8
|
- gradio-client==0.0.8
|
||||||
- wandb
|
- wandb
|
||||||
- fschat=0.1.10
|
- fschat==0.1.10
|
||||||
- llama-index=0.5.27
|
- llama-index==0.5.27
|
||||||
- pymysql
|
- pymysql
|
||||||
- unstructured==0.6.3
|
- unstructured==0.6.3
|
||||||
- pytesseract==0.3.10
|
- pytesseract==0.3.10
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import os
|
||||||
|
from typing import List
|
||||||
from auto_gpt_plugin_template import AutoGPTPluginTemplate
|
from auto_gpt_plugin_template import AutoGPTPluginTemplate
|
||||||
from pilot.singleton import Singleton
|
from pilot.singleton import Singleton
|
||||||
|
|
||||||
@@ -8,7 +10,53 @@ class Config(metaclass=Singleton):
|
|||||||
"""Configuration class to store the state of bools for different scripts access"""
|
"""Configuration class to store the state of bools for different scripts access"""
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""Initialize the Config class"""
|
"""Initialize the Config class"""
|
||||||
pass
|
|
||||||
|
# TODO change model_config there
|
||||||
|
|
||||||
|
self.debug_mode = False
|
||||||
|
self.skip_reprompt = False
|
||||||
|
|
||||||
|
self.plugins_dir = os.getenv("PLUGINS_DIR", "plugins")
|
||||||
|
self.plugins = List[AutoGPTPluginTemplate] = []
|
||||||
|
self.temperature = float(os.getenv("TEMPERATURE", 0.7))
|
||||||
|
|
||||||
|
|
||||||
# TODO change model_config there
|
# User agent header to use when making HTTP requests
|
||||||
|
# Some websites might just completely deny request with an error code if
|
||||||
|
# no user agent was found.
|
||||||
|
self.user_agent = os.getenv(
|
||||||
|
"USER_AGENT",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36"
|
||||||
|
" (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36",
|
||||||
|
)
|
||||||
|
|
||||||
|
# milvus or zilliz cloud configuration
|
||||||
|
self.milvus_addr = os.getenv("MILVUS_ADDR", "localhost:19530")
|
||||||
|
self.milvus_username = os.getenv("MILVUS_USERNAME")
|
||||||
|
self.milvus_password = os.getenv("MILVUS_PASSWORD")
|
||||||
|
self.milvus_collection = os.getenv("MILVUS_COLLECTION", "dbgpt")
|
||||||
|
self.milvus_secure = os.getenv("MILVUS_SECURE") == "True"
|
||||||
|
|
||||||
|
plugins_allowlist = os.getenv("ALLOWLISTED_PLUGINS")
|
||||||
|
if plugins_allowlist:
|
||||||
|
self.plugins_allowlist = plugins_allowlist.split(",")
|
||||||
|
else:
|
||||||
|
self.plugins_allowlist = []
|
||||||
|
|
||||||
|
plugins_denylist = os.getenv("DENYLISTED_PLUGINS")
|
||||||
|
if plugins_denylist:
|
||||||
|
self.plugins_denylist = []
|
||||||
|
|
||||||
|
def set_debug_mode(self, value: bool) -> None:
|
||||||
|
"""Set the debug mode value"""
|
||||||
|
self.debug_mode = value
|
||||||
|
|
||||||
|
def set_plugins(self, value: list) -> None:
|
||||||
|
"""Set the plugins value. """
|
||||||
|
self.plugins = value
|
||||||
|
|
||||||
|
def set_templature(self, value: int) -> None:
|
||||||
|
"""Set the temperature value."""
|
||||||
|
self.temperature = value
|
||||||
|
|
||||||
|
|
@@ -37,7 +37,7 @@ ISDEBUG = False
|
|||||||
|
|
||||||
DB_SETTINGS = {
|
DB_SETTINGS = {
|
||||||
"user": "root",
|
"user": "root",
|
||||||
"password": "aa123456",
|
"password": "aa12345678",
|
||||||
"host": "localhost",
|
"host": "localhost",
|
||||||
"port": 3306
|
"port": 3306
|
||||||
}
|
}
|
@@ -47,11 +47,11 @@ pycocoevalcap
|
|||||||
sentence-transformers
|
sentence-transformers
|
||||||
umap-learn
|
umap-learn
|
||||||
notebook
|
notebook
|
||||||
gradio==3.24.1
|
gradio==3.23
|
||||||
gradio-client==0.0.8
|
gradio-client==0.0.8
|
||||||
wandb
|
wandb
|
||||||
fschat=0.1.10
|
fschat==0.1.10
|
||||||
llama-index=0.5.27
|
llama-index==0.5.27
|
||||||
pymysql
|
pymysql
|
||||||
unstructured==0.6.3
|
unstructured==0.6.3
|
||||||
pytesseract==0.3.10
|
pytesseract==0.3.10
|
Reference in New Issue
Block a user