mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-01 00:03:29 +00:00
fix:metadata session bug
This commit is contained in:
parent
8acc2dc861
commit
68bfff8e34
50
README.md
50
README.md
@ -55,13 +55,19 @@ DB-GPT is an experimental open-source project that uses localized GPT large mode
|
||||
|
||||
## Demo
|
||||
Run on an RTX 4090 GPU.
|
||||
|
||||

|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
##### Chat Excel
|
||||

|
||||

|
||||
##### Chat Plugin
|
||||

|
||||
##### LLM Management
|
||||

|
||||
##### FastChat && vLLM
|
||||

|
||||
##### Trace
|
||||

|
||||
##### Chat Knowledge
|
||||

|
||||
|
||||
#### Chat with data, and figure charts.
|
||||
|
||||
@ -75,6 +81,29 @@ Run on an RTX 4090 GPU.
|
||||
<img src="./assets/chat_dashboard/chat_dashboard_2.png" width="800px" />
|
||||
</p>
|
||||
|
||||
## Install
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
[**Usage Tutorial**](https://db-gpt.readthedocs.io/en/latest/getting_started/install/deploy/deploy.html)
|
||||
- [**Install**](https://db-gpt.readthedocs.io/en/latest/getting_started/install/deploy/deploy.html)
|
||||
- [**Install Step by Step**](https://db-gpt.readthedocs.io/en/latest/getting_started/install/deploy/deploy.html)
|
||||
- [**Docker Install**](https://db-gpt.readthedocs.io/en/latest/getting_started/install/docker/docker.html)
|
||||
- [**Docker Compose**](https://db-gpt.readthedocs.io/en/latest/getting_started/install/docker_compose/docker_compose.html)
|
||||
- [**How to Use**](https://db-gpt.readthedocs.io/en/latest/getting_started/application/chatdb/chatdb.html)
|
||||
- [**ChatData**](https://db-gpt.readthedocs.io/en/latest/getting_started/application/chatdb/chatdb.html)
|
||||
- [**ChatKnowledge**](https://db-gpt.readthedocs.io/en/latest/getting_started/application/kbqa/kbqa.html)
|
||||
- [**ChatExcel**](https://db-gpt.readthedocs.io/en/latest/getting_started/application/chatexcel/chatexcel.html)
|
||||
- [**Dashboard**](https://db-gpt.readthedocs.io/en/latest/getting_started/application/dashboard/dashboard.html)
|
||||
- [**LLM Management**](https://db-gpt.readthedocs.io/en/latest/getting_started/application/model/model.html)
|
||||
- [**How to Deploy LLM**](https://db-gpt.readthedocs.io/en/latest/getting_started/install/cluster/cluster.html)
|
||||
- [**Standalone**](https://db-gpt.readthedocs.io/en/latest/getting_started/install/cluster/vms/standalone.html)
|
||||
- [**Cluster**](https://db-gpt.readthedocs.io/en/latest/getting_started/install/cluster/vms/index.html)
|
||||
- [**vLLM**](https://db-gpt.readthedocs.io/en/latest/getting_started/install/llm/vllm/vllm.html)
|
||||
- [**FAQ**](https://db-gpt.readthedocs.io/en/latest/getting_started/faq/deploy/deploy_faq.html)
|
||||
|
||||
|
||||
## Features
|
||||
|
||||
@ -187,13 +216,8 @@ The core capabilities mainly consist of the following parts:
|
||||
## Image
|
||||
🌐 [AutoDL Image](https://www.codewithgpu.com/i/eosphoros-ai/DB-GPT/dbgpt)
|
||||
|
||||
## Install
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
[**Installation && Usage Tutorial**](https://db-gpt.readthedocs.io/en/latest/getting_started/install/deploy/deploy.html)
|
||||
|
||||
|
||||
### Language Switching
|
||||
In the .env configuration file, modify the LANGUAGE parameter to switch to different languages. The default is English (Chinese: zh, English: en, other languages to be added later).
|
||||
|
48
README.zh.md
48
README.zh.md
@ -57,9 +57,19 @@ DB-GPT 是一个开源的以数据库为基础的GPT实验项目,使用本地
|
||||
|
||||
示例通过 RTX 4090 GPU 演示
|
||||
|
||||

|
||||
|
||||

|
||||
##### Chat Excel
|
||||

|
||||

|
||||
##### Chat Plugin
|
||||

|
||||
##### LLM Management
|
||||

|
||||
##### FastChat && vLLM
|
||||

|
||||
##### Trace
|
||||

|
||||
##### Chat Knowledge
|
||||

|
||||
|
||||
#### 根据自然语言对话生成分析图表
|
||||
|
||||
@ -103,6 +113,30 @@ DB-GPT 是一个开源的以数据库为基础的GPT实验项目,使用本地
|
||||
<img src="./assets/chat_knowledge_zh.png" width="800px" />
|
||||
</p>
|
||||
|
||||
## 安装
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
[**教程**](https://db-gpt.readthedocs.io/en/latest/getting_started/install/deploy/deploy.html)
|
||||
- [**安装**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/install/deploy/deploy.html)
|
||||
- [**Install Step by Step**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/install/deploy/deploy.html)
|
||||
- [**Docker安装**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/install/docker/docker.html)
|
||||
- [**Docker Compose安装**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/install/docker_compose/docker_compose.html)
|
||||
- [**产品使用手册**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/application/chatdb/chatdb.html)
|
||||
- [**ChatData**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/application/chatdb/chatdb.html)
|
||||
- [**ChatKnowledge**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/application/kbqa/kbqa.html)
|
||||
- [**ChatExcel**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/application/chatexcel/chatexcel.html)
|
||||
- [**Dashboard**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/application/dashboard/dashboard.html)
|
||||
- [**LLM 管理**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/application/model/model.html)
|
||||
- [**如何部署LLM**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/install/cluster/cluster.html)
|
||||
- [**Standalone**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/install/cluster/vms/standalone.html#)
|
||||
- [**Cluster**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/install/cluster/vms/index.html)
|
||||
- [**vLLM**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/install/llm/vllm/vllm.html)
|
||||
- [**FAQ**](https://db-gpt.readthedocs.io/en/latest/getting_started/faq/deploy/deploy_faq.html)
|
||||
|
||||
## 特性一览
|
||||
|
||||
目前我们已经发布了多种关键的特性,这里一一列举展示一下当前发布的能力。
|
||||
@ -215,14 +249,6 @@ DB-GPT基于 [FastChat](https://github.com/lm-sys/FastChat) 构建大模型运
|
||||
|
||||
🌐 [阿里云镜像](http://dbgpt.site/web/#/p/dc4bb97e0bc15302dbf3a5d5571142dd)
|
||||
|
||||
## 安装
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
[**快速开始**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/install/deploy/deploy.html)
|
||||
|
||||
### 多语言切换
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 238 KiB |
@ -20,6 +20,6 @@ class BaseDao(Generic[T]):
|
||||
self._session = session
|
||||
|
||||
def get_session(self):
|
||||
if not self._session:
|
||||
self._session = sessionmaker(bind=self.db_engine)
|
||||
return self._session
|
||||
Session = sessionmaker(autocommit=False, autoflush=False, bind=self._db_engine)
|
||||
session = Session()
|
||||
return session
|
||||
|
@ -28,8 +28,6 @@ class KnowledgeDocumentEntity(Base):
|
||||
gmt_created = Column(DateTime)
|
||||
gmt_modified = Column(DateTime)
|
||||
|
||||
__table_args__ = {"mysql_charset": "utf8mb4"}
|
||||
|
||||
def __repr__(self):
|
||||
return f"KnowledgeDocumentEntity(id={self.id}, doc_name='{self.doc_name}', doc_type='{self.doc_type}', chunk_size='{self.chunk_size}', status='{self.status}', last_sync='{self.last_sync}', content='{self.content}', result='{self.result}', gmt_created='{self.gmt_created}', gmt_modified='{self.gmt_modified}')"
|
||||
|
||||
@ -63,6 +61,7 @@ class KnowledgeDocumentDao(BaseDao):
|
||||
|
||||
def get_knowledge_documents(self, query, page=1, page_size=20):
|
||||
session = self.get_session()
|
||||
print(f"current session:{session}")
|
||||
knowledge_documents = session.query(KnowledgeDocumentEntity)
|
||||
if query.id is not None:
|
||||
knowledge_documents = knowledge_documents.filter(
|
||||
@ -97,6 +96,7 @@ class KnowledgeDocumentDao(BaseDao):
|
||||
|
||||
def get_documents(self, query):
|
||||
session = self.get_session()
|
||||
print(f"current session:{session}")
|
||||
knowledge_documents = session.query(KnowledgeDocumentEntity)
|
||||
if query.id is not None:
|
||||
knowledge_documents = knowledge_documents.filter(
|
||||
|
Loading…
Reference in New Issue
Block a user