update dbgpt online version

This commit is contained in:
xuyuan23
2023-11-27 12:56:56 +08:00
360 changed files with 17482 additions and 3296 deletions

View File

@@ -23,6 +23,15 @@ WEB_SERVER_PORT=7860
#*******************************************************************#
# LLM_MODEL, see /pilot/configs/model_config.LLM_MODEL_CONFIG
LLM_MODEL=vicuna-13b-v1.5
## LLM model path, by default, DB-GPT will read the model path from LLM_MODEL_CONFIG based on the LLM_MODEL.
## Of course you can specify your model path according to LLM_MODEL_PATH
## In DB-GPT, the priority from high to low to read model path:
## 1. environment variable with key: {LLM_MODEL}_MODEL_PATH (Avoid multi-model conflicts)
## 2. environment variable with key: MODEL_PATH
## 3. environment variable with key: LLM_MODEL_PATH
## 4. the config in /pilot/configs/model_config.LLM_MODEL_CONFIG
# LLM_MODEL_PATH=/app/models/vicuna-13b-v1.5
# LLM_PROMPT_TEMPLATE=vicuna_v1.1
MODEL_SERVER=http://127.0.0.1:8000
LIMIT_MODEL_CONCURRENCY=5
MAX_POSITION_EMBEDDINGS=4096
@@ -46,6 +55,17 @@ QUANTIZE_8bit=True
## Model path
# llama_cpp_model_path=/data/models/TheBloke/vicuna-13B-v1.5-GGUF/vicuna-13b-v1.5.Q4_K_M.gguf
### LLM cache
## Enable Model cache
# MODEL_CACHE_ENABLE=True
## The storage type of model cache, now supports: memory, disk
# MODEL_CACHE_STORAGE_TYPE=disk
## The max cache data in memory, we always store cache data in memory fist for high speed.
# MODEL_CACHE_MAX_MEMORY_MB=256
## The dir to save cache data, this configuration is only valid when MODEL_CACHE_STORAGE_TYPE=disk
## The default dir is pilot/data/model_cache
# MODEL_CACHE_STORAGE_DISK_DIR=
#*******************************************************************#
#** EMBEDDING SETTINGS **#
#*******************************************************************#
@@ -84,6 +104,7 @@ LOCAL_DB_TYPE=sqlite
# LOCAL_DB_PASSWORD=aa12345678
# LOCAL_DB_HOST=127.0.0.1
# LOCAL_DB_PORT=3306
# LOCAL_DB_NAME=dbgpt
### This option determines the storage location of conversation records. The default is not configured to the old version of duckdb. It can be optionally db or file (if the value is db, the database configured by LOCAL_DB will be used)
#CHAT_HISTORY_STORE_TYPE=db

126
CODE_OF_CONDUCT Normal file
View File

@@ -0,0 +1,126 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[INSERT CONTACT METHOD].
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
*Community Impact*: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
*Consequence*: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
*Community Impact*: A violation through a single incident or series of
actions.
*Consequence*: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
*Community Impact*: A serious violation of community standards, including
sustained inappropriate behavior.
*Consequence*: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
*Community Impact*: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
*Consequence*: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

173
README.md
View File

@@ -13,9 +13,6 @@
<a href="https://github.com/eosphoros-ai/DB-GPT">
<img alt="forks" src="https://img.shields.io/github/forks/eosphoros-ai/db-gpt?style=social" />
</a>
<a href="https://opensource.org/licenses/MIT">
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
</a>
<a href="https://opensource.org/licenses/MIT">
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
</a>
@@ -25,8 +22,8 @@
<a href="https://github.com/eosphoros-ai/DB-GPT/issues">
<img alt="Open Issues" src="https://img.shields.io/github/issues-raw/eosphoros-ai/DB-GPT" />
</a>
<a href="https://discord.gg/vqBrcV7Nd">
<img alt="Discord" src="https://dcbadge.vercel.app/api/server/vqBrcV7Nd?compact=true&style=flat" />
<a href="https://discord.gg/nASQyBjvY">
<img alt="Discord" src="https://dcbadge.vercel.app/api/server/nASQyBjvY?compact=true&style=flat" />
</a>
<a href="https://codespaces.new/eosphoros-ai/DB-GPT">
<img alt="Open in GitHub Codespaces" src="https://github.com/codespaces/badge.svg" />
@@ -34,17 +31,27 @@
</p>
[**简体中文**](README.zh.md) |[**Discord**](https://discord.gg/vqBrcV7Nd) |[**Documents**](https://db-gpt.readthedocs.io/en/latest/)|[**Wechat**](https://github.com/eosphoros-ai/DB-GPT/blob/main/README.zh.md#%E8%81%94%E7%B3%BB%E6%88%91%E4%BB%AC)|[**Community**](https://github.com/eosphoros-ai/community)
[**简体中文**](README.zh.md) | [**Discord**](https://discord.gg/nASQyBjvY) | [**Documents**](https://db-gpt.readthedocs.io/en/latest/) | [**Wechat**](https://github.com/eosphoros-ai/DB-GPT/blob/main/README.zh.md#%E8%81%94%E7%B3%BB%E6%88%91%E4%BB%AC) | [**Community**](https://github.com/eosphoros-ai/community)
</div>
## What is DB-GPT?
DB-GPT is an experimental open-source project that uses localized GPT large models to interact with your data and environment. With this solution, you can be assured that there is no risk of data leakage, and your data is 100% private and secure.
DB-GPT is an open-source framework designed for the realm of large language models (LLMs) within the database field. Its primary purpose is to provide infrastructure that simplifies and streamlines the development of database-related applications. This is accomplished through the development of various technical capabilities, including:
1. **SMMF(Service-oriented Multi-model Management Framework)**
2. **Text2SQL Fine-tuning**
3. **RAG(Retrieval Augmented Generation) framework and optimization**
4. **Data-Driven Agents framework collaboration**
5. **GBI(Generative Business intelligence)**
DB-GPT simplifies the creation of these applications based on large language models (LLMs) and databases.
In the era of Data 3.0, enterprises and developers can take the ability to create customized applications with minimal coding, which harnesses the power of large language models (LLMs) and databases.
## Contents
- [install](#install)
- [demo](#demo)
- [Install](#install)
- [Demo](#demo)
- [introduction](#introduction)
- [features](#features)
- [contribution](#contribution)
@@ -54,19 +61,11 @@ DB-GPT is an experimental open-source project that uses localized GPT large mode
[DB-GPT Youtube Video](https://www.youtube.com/watch?v=f5_g0OObZBQ)
## Demo
Run on an RTX 4090 GPU.
##### Chat Data
![chatdata](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/1f77079e-d018-4eee-982b-9b6a66bf1063)
##### Chat Excel
![excel](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/0474d220-2a9f-449f-a940-92c8a25af390)
##### Chat Plugin
![auto_plugin_new](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/7d95c347-f4b7-4fb6-8dd2-c1c02babaa56)
##### LLM Management
![llm_manage](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/501d6b3f-c4ce-4197-9a6f-f016f8150a11)
##### FastChat && vLLM
![vllm](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/0c9475d2-45ee-4573-aa5a-814f7fd40213)
##### Trace
![trace_new](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/69bd14b8-14d0-4ca9-9cb7-6cef44a2bc93)
##### Chat Knowledge
![kbqa_new](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/72266a48-edef-4c6d-88c6-fbb1a24a6c3e)
![excel](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/3044e83b-a71e-41fe-a1e2-98e479e0ab59)
## Install
![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white)
@@ -75,8 +74,8 @@ Run on an RTX 4090 GPU.
![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white)
[**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)
- [**Install**](https://db-gpt.readthedocs.io/en/latest/getting_started/install/deploy.html)
- [**Install Step by Step**](https://db-gpt.readthedocs.io/en/latest/getting_started/install/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)
@@ -96,52 +95,47 @@ Run on an RTX 4090 GPU.
## Features
Currently, we have released multiple key features, which are listed below to demonstrate our current capabilities:
- Private KBQA & data processing
At present, we have introduced several key features to showcase our current capabilities:
- **Private Domain Q&A & Data Processing**
The DB-GPT project offers a range of features to enhance knowledge base construction and enable efficient storage and retrieval of both structured and unstructured data. These include built-in support for uploading multiple file formats, the ability to integrate plug-ins for custom data extraction, and unified vector storage and retrieval capabilities for managing large volumes of information.
The DB-GPT project offers a range of functionalities designed to improve knowledge base construction and enable efficient storage and retrieval of both structured and unstructured data. These functionalities include built-in support for uploading multiple file formats, the ability to integrate custom data extraction plug-ins, and unified vector storage and retrieval capabilities for effectively managing large volumes of information.
- Multiple data sources & visualization
- **Multi-Data Source & GBI(Generative Business intelligence)**
The DB-GPT project facilitates seamless natural language interaction with diverse data sources, including Excel, databases, and data warehouses. It simplifies the process of querying and retrieving information from these sources, empowering users to engage in intuitive conversations and gain insights. Moreover, DB-GPT supports the generation of analytical reports, providing users with valuable data summaries and interpretations.
- **Multi-Agents&Plugins**
It offers support for custom plug-ins to perform various tasks and natively integrates the Auto-GPT plug-in model. The Agents protocol adheres to the Agent Protocol standard.
- **Automated Fine-tuning text2SQL**
We've also developed an automated fine-tuning lightweight framework centred on large language models (LLMs), Text2SQL datasets, LoRA/QLoRA/Pturning, and other fine-tuning methods. This framework simplifies Text-to-SQL fine-tuning, making it as straightforward as an assembly line process. [DB-GPT-Hub](https://github.com/eosphoros-ai/DB-GPT-Hub)
- **SMMF(Service-oriented Multi-model Management Framework)**
We offer extensive model support, including dozens of large language models (LLMs) from both open-source and API agents, such as LLaMA/LLaMA2, Baichuan, ChatGLM, Wenxin, Tongyi, Zhipu, and many more.
The DB-GPT project enables seamless natural language interaction with various data sources, including Excel, databases, and data warehouses. It facilitates effortless querying and retrieval of information from these sources, allowing users to engage in intuitive conversations and obtain insights. Additionally, DB-GPT supports the generation of analysis reports, providing users with valuable summaries and interpretations of the data.
- Multi-Agents&Plugins
Supports custom plug-ins to perform tasks, natively supports the Auto-GPT plug-in model, and the Agents protocol adopts the Agent Protocol standard
- Fine-tuning text2SQL
An automated fine-tuning lightweight framework built around large language models, Text2SQL data sets, LoRA/QLoRA/Pturning and other fine-tuning methods, making TextSQL fine-tuning as convenient as an assembly line. [DB-GPT-Hub](https://github.com/eosphoros-ai/DB-GPT-Hub)
- Multi LLMs Support, Supports multiple large language models, currently supporting
Massive model support, including dozens of large language models such as open source and API agents. Such as LLaMA/LLaMA2, Baichuan, ChatGLM, Wenxin, Tongyi, Zhipu, etc.
- [Vicuna](https://huggingface.co/Tribbiani/vicuna-13b)
- [vicuna-13b-v1.5](https://huggingface.co/lmsys/vicuna-13b-v1.5)
- [LLama2](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf)
- [baichuan2-13b](https://huggingface.co/baichuan-inc)
- [baichuan-7B](https://huggingface.co/baichuan-inc/baichuan-7B)
- [baichuan2-13b](https://huggingface.co/baichuan-inc/Baichuan2-13B-Chat)
- [baichuan2-7b](https://huggingface.co/baichuan-inc/Baichuan2-7B-Chat)
- [chatglm-6b](https://huggingface.co/THUDM/chatglm-6b)
- [chatglm2-6b](https://huggingface.co/THUDM/chatglm2-6b)
- [chatglm3-6b](https://huggingface.co/THUDM/chatglm3-6b)
- [falcon-40b](https://huggingface.co/tiiuae/falcon-40b)
- [internlm-chat-7b](https://huggingface.co/internlm/internlm-chat-7b)
- [Qwen-7B-Chat/Qwen-14B-Chat](https://huggingface.co/Qwen/)
- [RWKV-4-Raven](https://huggingface.co/BlinkDL/rwkv-4-raven)
- [CAMEL-13B-Combined-Data](https://huggingface.co/camel-ai/CAMEL-13B-Combined-Data)
- [dolly-v2-12b](https://huggingface.co/databricks/dolly-v2-12b)
- [h2ogpt-gm-oasst1-en-2048-open-llama-7b](https://huggingface.co/h2oai/h2ogpt-gm-oasst1-en-2048-open-llama-7b)
- [fastchat-t5-3b-v1.0](https://huggingface.co/lmsys/fastchat-t5)
- [mpt-7b-chat](https://huggingface.co/mosaicml/mpt-7b-chat)
- [gpt4all-13b-snoozy](https://huggingface.co/nomic-ai/gpt4all-13b-snoozy)
- [Nous-Hermes-13b](https://huggingface.co/NousResearch/Nous-Hermes-13b)
- [codet5p-6b](https://huggingface.co/Salesforce/codet5p-6b)
- [guanaco-33b-merged](https://huggingface.co/timdettmers/guanaco-33b-merged)
- [WizardLM-13B-V1.0](https://huggingface.co/WizardLM/WizardLM-13B-V1.0)
- [WizardLM/WizardCoder-15B-V1.0](https://huggingface.co/WizardLM/WizardCoder-15B-V1.0)
- [Llama2-Chinese-13b-Chat](https://huggingface.co/FlagAlpha/Llama2-Chinese-13b-Chat)
- [OpenLLaMa OpenInstruct](https://huggingface.co/VMware/open-llama-7b-open-instruct)
etc.
- [internlm-chat-20b](https://huggingface.co/internlm/internlm-chat-20b)
- [qwen-7b-chat](https://huggingface.co/Qwen/Qwen-7B-Chat)
- [qwen-14b-chat](https://huggingface.co/Qwen/Qwen-14B-Chat)
- [wizardlm-13b](https://huggingface.co/WizardLM/WizardLM-13B-V1.2)
- [orca-2-7b](https://huggingface.co/microsoft/Orca-2-7b)
- [orca-2-13b](https://huggingface.co/microsoft/Orca-2-13b)
- [openchat_3.5](https://huggingface.co/openchat/openchat_3.5)
- [zephyr-7b-alpha](https://huggingface.co/HuggingFaceH4/zephyr-7b-alpha)
- [mistral-7b-instruct-v0.1](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1)
- [Yi-34B-Chat](https://huggingface.co/01-ai/Yi-34B-Chat)
- Support API Proxy LLMs
- [x] [ChatGPT](https://api.openai.com/)
@@ -149,16 +143,16 @@ Currently, we have released multiple key features, which are listed below to dem
- [x] [Wenxin](https://cloud.baidu.com/product/wenxinworkshop?track=dingbutonglan)
- [x] [ChatGLM](http://open.bigmodel.cn/)
- Privacy and security
- **Privacy and Security**
The privacy and security of data are ensured through various technologies such as privatized large models and proxy desensitization.
We ensure the privacy and security of data through the implementation of various technologies, including privatized large models and proxy desensitization.
- Support Datasources
| DataSource | support | Notes |
| ------------------------------------------------------------------------------ | ----------- | ------------------------------------------- |
| [MySQL](https://www.mysql.com/) | Yes | |
| [PostgresSQL](https://www.postgresql.org/) | Yes | |
| [PostgreSQL](https://www.postgresql.org/) | Yes | |
| [Spark](https://github.com/apache/spark) | Yes | |
| [DuckDB](https://github.com/duckdb/duckdb) | Yes | |
| [Sqlite](https://github.com/sqlite/sqlite) | Yes | |
@@ -177,43 +171,37 @@ Currently, we have released multiple key features, which are listed below to dem
| [StarRocks](https://github.com/StarRocks/starrocks) | No | TODO |
## Introduction
Is the architecture of the entire DB-GPT shown in the following figure:
The architecture of DB-GPT is shown in the following figure:
<p align="center">
<img src="./assets/DB-GPT.png" width="800" />
</p>
The core capabilities mainly consist of the following parts:
1. Multi-Models: Support multi-LLMs, such as LLaMA/LLaMA2CodeLLaMAChatGLM, QWenVicuna and proxy model ChatGPTBaichuan、tongyi、wenxin etc
2. Knowledge Based QA: You can perform high-quality intelligent Q&A based on local documents such as pdf, word, excel and other data.
3. Embedding: Unified data vector storage and indexing, Embed data as vectors and store them in vector databases, providing content similarity search.
4. Multi-Datasources: Used to connect different modules and data sources to achieve data flow and interaction.
5. Multi-Agents: Provides Agent and plugin mechanisms, allowing users to customize and enhance the system's behavior.
6. Privacy & Secure: You can be assured that there is no risk of data leakage, and your data is 100% private and secure.
7. Text2SQL: We enhance the Text-to-SQL performance by applying Supervised Fine-Tuning (SFT) on large language models
### RAG-IN-Action
<p align="center">
<img src="./assets/RAG-IN-ACTION.jpg" width="800px" />
</p>
The core capabilities primarily consist of the following components:
1. Multi-Models: We support multiple Large Language Models (LLMs) such as LLaMA/LLaMA2, CodeLLaMA, ChatGLM, QWen, Vicuna, and proxy models like ChatGPT, Baichuan, Tongyi, Wenxin, and more.
2. Knowledge-Based QA: Our system enables high-quality intelligent Q&A based on local documents such as PDFs, Word documents, Excel files, and other data sources.
3. Embedding: We offer unified data vector storage and indexing. Data is embedded as vectors and stored in vector databases, allowing for content similarity search.
4. Multi-Datasources: This feature connects different modules and data sources, facilitating data flow and interaction.
5. Multi-Agents: Our platform provides Agent and plugin mechanisms, empowering users to customize and enhance the system's behaviour.
6. Privacy & Security: Rest assured that there is no risk of data leakage, and your data is 100% private and secure.
7. Text2SQL: We enhance Text-to-SQL performance through Supervised Fine-Tuning (SFT) applied to Large Language Models (LLMs).
### SubModule
- [DB-GPT-Hub](https://github.com/eosphoros-ai/DB-GPT-Hub) Text-to-SQL performance by applying Supervised Fine-Tuning (SFT) on large language models.
- [DB-GPT-Plugins](https://github.com/eosphoros-ai/DB-GPT-Plugins) DB-GPT Plugins, Can run autogpt plugin directly
- [DB-GPT-Hub](https://github.com/eosphoros-ai/DB-GPT-Hub) Text-to-SQL workflow with high performance by applying Supervised Fine-Tuning (SFT) on Large Language Models (LLMs).
- [DB-GPT-Plugins](https://github.com/eosphoros-ai/DB-GPT-Plugins) DB-GPT Plugins that can run Auto-GPT plugin directly
- [DB-GPT-Web](https://github.com/eosphoros-ai/DB-GPT-Web) ChatUI for DB-GPT
## Image
🌐 [AutoDL Image](https://www.codewithgpu.com/i/eosphoros-ai/DB-GPT/dbgpt)
### 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).
## Contribution
- Please run `black .` before submitting the code. contributing guidelines, [how to contribution](https://github.com/csunny/DB-GPT/blob/main/CONTRIBUTING.md)
- Please run `black .` before submitting the code.
- To check detailed guidelines for new contributions, please refer [how to contribute](https://github.com/csunny/DB-GPT/blob/main/CONTRIBUTING.md)
## RoadMap
@@ -224,7 +212,7 @@ The core capabilities mainly consist of the following parts:
### KBQA RAG optimization
- [x] Multi Documents
- [x] PDF
- [x] Excel, csv
- [x] Excel, CSV
- [x] Word
- [x] Text
- [x] MarkDown
@@ -235,7 +223,7 @@ The core capabilities mainly consist of the following parts:
- [ ] Graph Database
- [ ] Neo4j Graph
- [ ] Nebula Graph
- [x] Multi Vector Database
- [x] Multi-Vector Database
- [x] Chroma
- [x] Milvus
- [x] Weaviate
@@ -254,7 +242,7 @@ The core capabilities mainly consist of the following parts:
- Multi Datasource Support
- [x] MySQL
- [x] PostgresSQL
- [x] PostgreSQL
- [x] Spark
- [x] DuckDB
- [x] Sqlite
@@ -310,18 +298,7 @@ The core capabilities mainly consist of the following parts:
- [x] ChatGLM2
- SFT Accuracy
As of October 10, 2023, by fine-tuning an open-source model of 13 billion parameters using this project, the execution accuracy on the Spider evaluation dataset has surpassed that of GPT-4!
| name | Execution Accuracy | reference |
| ----------------------------------| ------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
| **GPT-4** | **0.762** | [numbersstation-eval-res](https://www.numbersstation.ai/post/nsql-llama-2-7b) |
| ChatGPT | 0.728 | [numbersstation-eval-res](https://www.numbersstation.ai/post/nsql-llama-2-7b) |
| **CodeLlama-13b-Instruct-hf_lora**| **0.789** | sft train by our this project,only used spider train dataset ,the same eval way in this project with lora SFT |
| CodeLlama-13b-Instruct-hf_qlora | 0.774 | sft train by our this project,only used spider train dataset ,the same eval way in this project with qlora and nf4,bit4 SFT |
| wizardcoder | 0.610 | [text-to-sql-wizardcoder](https://github.com/cuplv/text-to-sql-wizardcoder/tree/main) |
| CodeLlama-13b-Instruct-hf | 0.556 | eval in this project default param |
| llama2_13b_hf_lora_best | 0.744 | sft train by our this project,only used spider train dataset ,the same eval way in this project |
As of October 10, 2023, through the fine-tuning of an open-source model with 13 billion parameters using this project, we have achieved execution accuracy on the Spider dataset that surpasses even GPT-4!
[More Information about Text2SQL finetune](https://github.com/eosphoros-ai/DB-GPT-Hub)
@@ -330,8 +307,8 @@ As of October 10, 2023, by fine-tuning an open-source model of 13 billion parame
The MIT License (MIT)
## Contact Information
We are working on building a community, if you have any ideas about building the community, feel free to contact us.
[![](https://dcbadge.vercel.app/api/server/vqBrcV7Nd?compact=true&style=flat)](https://discord.gg/vqBrcV7Nd)
We are working on building a community, if you have any ideas for building the community, feel free to contact us.
[![](https://dcbadge.vercel.app/api/server/nASQyBjvY?compact=true&style=flat)](https://discord.gg/nASQyBjvY)
<p align="center">
<img src="./assets/wechat.jpg" width="300px" />

View File

@@ -22,24 +22,21 @@
<a href="https://github.com/eosphoros-ai/DB-GPT/issues">
<img alt="Open Issues" src="https://img.shields.io/github/issues-raw/csunny/DB-GPT" />
</a>
<a href="https://discord.gg/vqBrcV7Nd">
<img alt="Discord" src="https://dcbadge.vercel.app/api/server/vqBrcV7Nd?compact=true&style=flat" />
<a href="https://discord.gg/nASQyBjvY">
<img alt="Discord" src="https://dcbadge.vercel.app/api/server/nASQyBjvY?compact=true&style=flat" />
</a>
<a href="https://codespaces.new/eosphoros-ai/DB-GPT">
<img alt="Open in GitHub Codespaces" src="https://github.com/codespaces/badge.svg" />
</a>
</p>
[**English**](README.md)|[**Discord**](https://discord.gg/vqBrcV7Nd)|[**文档**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/)|[**微信**](https://github.com/csunny/DB-GPT/blob/main/README.zh.md#%E8%81%94%E7%B3%BB%E6%88%91%E4%BB%AC)|[**社区**](https://github.com/eosphoros-ai/community)
[**English**](README.md)|[**Discord**](https://discord.gg/nASQyBjvY)|[**文档**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/)|[**微信**](https://github.com/csunny/DB-GPT/blob/main/README.zh.md#%E8%81%94%E7%B3%BB%E6%88%91%E4%BB%AC)|[**社区**](https://github.com/eosphoros-ai/community)
</div>
## DB-GPT 是什么?
DB-GPT是一个开源的数据库领域大模型框架。目的是构建大模型领域的基础设施通过开发多模型管理、Text2SQL效果优化、RAG框架以及优化、Multi-Agents框架协作等多种技术能力让围绕数据库构建大模型应用更简单更方便。
随着大模型的发布迭代大模型变得越来越智能在使用大模型的过程当中遇到极大的数据安全与隐私挑战。在利用大模型能力的过程中我们的私密数据跟环境需要掌握自己的手里完全可控避免任何的数据隐私泄露以及安全风险。基于此我们发起了DB-GPT项目为所有以数据库为基础的场景构建一套完整的私有大模型解决方案。 此方案因为支持本地部署,所以不仅仅可以应用于独立私有环境,而且还可以根据业务模块独立部署隔离,让大模型的能力绝对私有、安全、可控。我们的愿景是让围绕数据库构建大模型应用更简单,更方便
DB-GPT 是一个开源的以数据库为基础的GPT实验项目使用本地化的GPT大模型与您的数据和环境进行交互无数据泄露风险100% 私密
数据3.0 时代,基于模型、数据库,企业/开发者可以用更少的代码搭建自己的专属应用
## 目录
@@ -55,23 +52,13 @@ DB-GPT 是一个开源的以数据库为基础的GPT实验项目使用本地
## 效果演示
示例通过 RTX 4090 GPU 演示
##### Chat Data
![chatdata](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/1f77079e-d018-4eee-982b-9b6a66bf1063)
##### Chat Excel
![excel](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/0474d220-2a9f-449f-a940-92c8a25af390)
#### Chat Plugin
![auto_plugin_new](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/7d95c347-f4b7-4fb6-8dd2-c1c02babaa56)
#### LLM Management
![llm_manage](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/501d6b3f-c4ce-4197-9a6f-f016f8150a11)
#### FastChat && vLLM
![vllm](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/0c9475d2-45ee-4573-aa5a-814f7fd40213)
#### Trace
![trace_new](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/69bd14b8-14d0-4ca9-9cb7-6cef44a2bc93)
#### Chat Knowledge
![kbqa_new](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/72266a48-edef-4c6d-88c6-fbb1a24a6c3e)
![excel](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/3044e83b-a71e-41fe-a1e2-98e479e0ab59)
#### 根据自然语言对话生成分析图表
<p align="left">
<img src="./assets/chat_excel/chat_excel_6.png" width="800px" />
</p>
@@ -80,10 +67,6 @@ DB-GPT 是一个开源的以数据库为基础的GPT实验项目使用本地
<img src="./assets/dashboard.png" width="800px" />
</p>
<p align="left">
<img src="./assets/chat_dashboard/chat_dashboard_2.png" width="800px" />
</p>
## 安装
![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white)
@@ -91,80 +74,74 @@ DB-GPT 是一个开源的以数据库为基础的GPT实验项目使用本地
![macOS](https://img.shields.io/badge/mac%20os-000000?style=for-the-badge&logo=macos&logoColor=F0F0F0)
![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white)
[**教程**](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)
- [**Chat Agent**](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/getting_started/application/chatagent/chatagent.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)
[**教程**](https://www.yuque.com/eosphoros/dbgpt-docs/bex30nsv60ru0fmx)
- [**快速开始**](https://www.yuque.com/eosphoros/dbgpt-docs/ew0kf1plm0bru2ga)
- [**源码安装**](https://www.yuque.com/eosphoros/dbgpt-docs/urh3fcx8tu0s9xmb)
- [**Docker安装**](https://www.yuque.com/eosphoros/dbgpt-docs/glf87qg4xxcyrp89)
- [**Docker Compose安装**](https://www.yuque.com/eosphoros/dbgpt-docs/wwdu11e0v5nkfzin)
- [**产品使用手册**](https://www.yuque.com/eosphoros/dbgpt-docs/tkspdd0tcy2vlnu4)
- [**数据对话**](https://www.yuque.com/eosphoros/dbgpt-docs/gd9hbhi1dextqgbz)
- [**知识库**](https://www.yuque.com/eosphoros/dbgpt-docs/ycyz3d9b62fccqxh)
- [**ChatExcel**](https://www.yuque.com/eosphoros/dbgpt-docs/prugoype0xd2g4bb)
- [**数据库对话**](https://www.yuque.com/eosphoros/dbgpt-docs/wswpv3zcm2c9snmg)
- [**报表分析**](https://www.yuque.com/eosphoros/dbgpt-docs/vsv49p33eg4p5xc1)
- [**插件**](https://www.yuque.com/eosphoros/dbgpt-docs/pom41m7oqtdd57hm)
- [**如何部署模型服务**](https://www.yuque.com/eosphoros/dbgpt-docs/vubxiv9cqed5mc6o)
- [**单机部署**](https://www.yuque.com/eosphoros/dbgpt-docs/kwg1ed88lu5fgawb)
- [**集群部署**](https://www.yuque.com/eosphoros/dbgpt-docs/gmbp9619ytyn2v1s)
- [**vLLM**](https://www.yuque.com/eosphoros/dbgpt-docs/bhy9igdvanx1uluf)
- [**如何Debug**](https://db-gpt.readthedocs.io/en/latest/getting_started/observability.html)
- [**FAQ**](https://db-gpt.readthedocs.io/en/latest/getting_started/faq/deploy/deploy_faq.html)
## 特性一览
目前我们已经发布了多种关键的特性,这里一一列举展示一下当前发布的能力。
- 私域问答&数据处理
- **私域问答&数据处理&RAG**
支持内置、多文件格式上传、插件自抓取等方式自定义构建知识库,对海量结构化,非结构化数据做统一向量存储与检索
- 多数据源&可视化
- **多数据源&GBI**
支持自然语言与Excel、数据库、数仓等多种数据源交互并支持分析报告。
- 自动化微调
- **自动化微调**
围绕大语言模型、Text2SQL数据集、LoRA/QLoRA/Pturning等微调方法构建的自动化微调轻量框架, 让TextSQL微调像流水线一样方便。详见: [DB-GPT-Hub](https://github.com/eosphoros-ai/DB-GPT-Hub)
- Multi-Agents&Plugins
- **Data-Driven Multi-Agents&Plugins**
支持自定义插件执行任务原生支持Auto-GPT插件模型Agents协议采用Agent Protocol标准
- 多模型支持与管理
- **多模型支持与管理**
海量模型支持包括开源、API代理等几十种大语言模型。如LLaMA/LLaMA2、Baichuan、ChatGLM、文心、通义、智谱等。当前已支持如下模型:
海量模型支持包括开源、API代理等几十种大语言模型。如LLaMA/LLaMA2、Baichuan、ChatGLM、文心、通义、智谱等。
- 支持多种大语言模型, 当前已支持如下模型:
- [Vicuna](https://huggingface.co/Tribbiani/vicuna-13b)
- [vicuna-13b-v1.5](https://huggingface.co/lmsys/vicuna-13b-v1.5)
- [LLama2](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf)
- [baichuan2-13b](https://huggingface.co/baichuan-inc)
- [baichuan-7B](https://huggingface.co/baichuan-inc/baichuan-7B)
- [baichuan2-13b](https://huggingface.co/baichuan-inc/Baichuan2-13B-Chat)
- [baichuan2-7b](https://huggingface.co/baichuan-inc/Baichuan2-7B-Chat)
- [chatglm-6b](https://huggingface.co/THUDM/chatglm-6b)
- [chatglm2-6b](https://huggingface.co/THUDM/chatglm2-6b)
- [chatglm3-6b](https://huggingface.co/THUDM/chatglm3-6b)
- [falcon-40b](https://huggingface.co/tiiuae/falcon-40b)
- [internlm-chat-7b](https://huggingface.co/internlm/internlm-chat-7b)
- [Qwen-7B-Chat/Qwen-14B-Chat](https://huggingface.co/Qwen/)
- [RWKV-4-Raven](https://huggingface.co/BlinkDL/rwkv-4-raven)
- [CAMEL-13B-Combined-Data](https://huggingface.co/camel-ai/CAMEL-13B-Combined-Data)
- [dolly-v2-12b](https://huggingface.co/databricks/dolly-v2-12b)
- [h2ogpt-gm-oasst1-en-2048-open-llama-7b](https://huggingface.co/h2oai/h2ogpt-gm-oasst1-en-2048-open-llama-7b)
- [fastchat-t5-3b-v1.0](https://huggingface.co/lmsys/fastchat-t5)
- [mpt-7b-chat](https://huggingface.co/mosaicml/mpt-7b-chat)
- [gpt4all-13b-snoozy](https://huggingface.co/nomic-ai/gpt4all-13b-snoozy)
- [Nous-Hermes-13b](https://huggingface.co/NousResearch/Nous-Hermes-13b)
- [codet5p-6b](https://huggingface.co/Salesforce/codet5p-6b)
- [guanaco-33b-merged](https://huggingface.co/timdettmers/guanaco-33b-merged)
- [WizardLM-13B-V1.0](https://huggingface.co/WizardLM/WizardLM-13B-V1.0)
- [WizardLM/WizardCoder-15B-V1.0](https://huggingface.co/WizardLM/WizardCoder-15B-V1.0)
- [Llama2-Chinese-13b-Chat](https://huggingface.co/FlagAlpha/Llama2-Chinese-13b-Chat)
- [OpenLLaMa OpenInstruct](https://huggingface.co/VMware/open-llama-7b-open-instruct)
- [internlm-chat-20b](https://huggingface.co/internlm/internlm-chat-20b)
- [qwen-7b-chat](https://huggingface.co/Qwen/Qwen-7B-Chat)
- [qwen-14b-chat](https://huggingface.co/Qwen/Qwen-14B-Chat)
- [wizardlm-13b](https://huggingface.co/WizardLM/WizardLM-13B-V1.2)
- [orca-2-7b](https://huggingface.co/microsoft/Orca-2-7b)
- [orca-2-13b](https://huggingface.co/microsoft/Orca-2-13b)
- [openchat_3.5](https://huggingface.co/openchat/openchat_3.5)
- [zephyr-7b-alpha](https://huggingface.co/HuggingFaceH4/zephyr-7b-alpha)
- [mistral-7b-instruct-v0.1](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1)
- [Yi-34B-Chat](https://huggingface.co/01-ai/Yi-34B-Chat)
- 支持在线代理模型
- [x] [ChatGPT](https://api.openai.com/)
- [x] [Tongyi](https://www.aliyun.com/product/dashscope)
- [x] [Wenxin](https://cloud.baidu.com/product/wenxinworkshop?track=dingbutonglan)
- [x] [ChatGLM](http://open.bigmodel.cn/)
- 隐私安全
- **隐私安全**
通过私有化大模型、代理脱敏等多种技术保障数据的隐私安全。
@@ -192,22 +169,23 @@ DB-GPT 是一个开源的以数据库为基础的GPT实验项目使用本地
| [StarRocks](https://github.com/StarRocks/starrocks) | No | TODO |
## 架构方案
DB-GPT基于 [FastChat](https://github.com/lm-sys/FastChat) 构建大模型运行环境。此外我们通过LangChain提供私域知识库问答能力。同时我们支持插件模式, 在设计上原生支持Auto-GPT插件。我们的愿景是让围绕数据库和LLM构建应用程序更加简便和便捷。
整个DB-GPT的架构如下图所示
<p align="center">
<img src="./assets/DB-GPT_zh.png" width="800px" />
</p>
核心能力主要有以下几个部分
1. 多模型支持多LLM如LLaMA/LLaMA2、CodeLLaMA、ChatGLM、QWen、Vicuna以及代理模型ChatGPT、Baichuan、tongyi、wenxin等
2. 私域知识库问答: 可以根据本地文档如pdf、word、excel等数据进行高质量的智能问答。
3. 统一数据向量存储和索引: 将数据嵌入为向量并存储在向量数据库中,提供内容相似性搜索
4. 多数据源: 用于连接不同的模块和数据源,实现数据的流动和交互。
5. Agent与插件: 提供Agent和插件机制使得用户可以自定义并增强系统的行为。
6. 隐私和安全: 您可以放心没有数据泄露的风险您的数据100%私密和安全。
7. Text2SQL: 我们通过在大型语言模型监督微调SFT来增强文本到SQL的性能
核心能力主要有以下几个部分:
- **RAG(Retrieval Augmented Generation)**RAG是当下落地实践最多也是最迫切的领域DB-GPT目前已经实现了一套基于RAG的框架用户可以基于DB-GPT的RAG能力构建知识类应用。
- **GBI**生成式BI是DB-GPT项目的核心能力之一为构建企业报表分析、业务洞察提供基础的数智化技术保障
- **Fine-tune框架**: 模型微调是任何一个企业在垂直、细分领域落地不可或缺的能力DB-GPT提供了完整的微调框架实现与DB-GPT项目的无缝打通在最近的微调中基于spider的准确率已经做到了82.5%
- **数据驱动的Multi-Agents框架**: DB-GPT提供了数据驱动的自进化微调框架目标是可以持续基于数据做决策与执行。
- **数据工厂**: 数据工厂主要是在大模型时代,做可信知识、数据的清洗加工。
- **数据源**: 对接各类数据源实现生产业务数据无缝对接到DB-GPT核心能力。
### RAG生产落地实践架构
<p align="center">
@@ -345,16 +323,6 @@ The MIT License (MIT)
- SFT模型准确率
截止20231010我们利用本项目基于开源的13B大小的模型微调后在Spider的评估集上的执行准确率已经超越GPT-4!
| 模型名称 | 执行准确率 | 说明 |
| ----------------------------------| ------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
| **GPT-4** | **0.762** | [numbersstation-eval-res](https://www.numbersstation.ai/post/nsql-llama-2-7b) |
| ChatGPT | 0.728 | [numbersstation-eval-res](https://www.numbersstation.ai/post/nsql-llama-2-7b) |
| **CodeLlama-13b-Instruct-hf_lora**| **0.789** | sft train by our this project,only used spider train dataset ,the same eval way in this project with lora SFT |
| CodeLlama-13b-Instruct-hf_qlora | 0.774 | sft train by our this project,only used spider train dataset ,the same eval way in this project with qlora and nf4,bit4 SFT |
| wizardcoder | 0.610 | [text-to-sql-wizardcoder](https://github.com/cuplv/text-to-sql-wizardcoder/tree/main) |
| CodeLlama-13b-Instruct-hf | 0.556 | eval in this project default param |
| llama2_13b_hf_lora_best | 0.744 | sft train by our this project,only used spider train dataset ,the same eval way in this project |
[More Information about Text2SQL finetune](https://github.com/eosphoros-ai/DB-GPT-Hub)
## 联系我们

View File

@@ -1,18 +0,0 @@
CREATE DATABASE history;
use history;
CREATE TABLE `chat_feed_back` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`conv_uid` varchar(128) DEFAULT NULL COMMENT '会话id',
`conv_index` int(4) DEFAULT NULL COMMENT '第几轮会话',
`score` int(1) DEFAULT NULL COMMENT '评分',
`ques_type` varchar(32) DEFAULT NULL COMMENT '用户问题类别',
`question` longtext DEFAULT NULL COMMENT '用户问题',
`knowledge_space` varchar(128) DEFAULT NULL COMMENT '知识库',
`messages` longtext DEFAULT NULL COMMENT '评价详情',
`user_name` varchar(128) DEFAULT NULL COMMENT '评价人',
`gmt_created` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_conv` (`conv_uid`,`conv_index`),
KEY `idx_conv` (`conv_uid`,`conv_index`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 COMMENT='用户评分反馈表';

View File

@@ -1,5 +1,15 @@
CREATE DATABASE knowledge_management;
use knowledge_management;
-- You can change `dbgpt` to your actual metadata database name in your `.env` file
-- eg. `LOCAL_DB_NAME=dbgpt`
CREATE DATABASE IF NOT EXISTS dbgpt;
use dbgpt;
-- For alembic migration tool
CREATE TABLE `alembic_version` (
version_num VARCHAR(32) NOT NULL,
CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
);
CREATE TABLE `knowledge_space` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'auto increment id',
`name` varchar(100) NOT NULL COMMENT 'knowledge space name',
@@ -26,6 +36,7 @@ CREATE TABLE `knowledge_document` (
`content` LONGTEXT NOT NULL COMMENT 'knowledge embedding sync result',
`result` TEXT NULL COMMENT 'knowledge content',
`vector_ids` LONGTEXT NULL COMMENT 'vector_ids',
`summary` LONGTEXT NULL COMMENT 'knowledge summary',
`gmt_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'created time',
`gmt_modified` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'update time',
PRIMARY KEY (`id`),
@@ -45,6 +56,102 @@ CREATE TABLE `document_chunk` (
KEY `idx_document_id` (`document_id`) COMMENT 'index:document_id'
) ENGINE=InnoDB AUTO_INCREMENT=100001 DEFAULT CHARSET=utf8mb4 COMMENT='knowledge document chunk detail';
CREATE TABLE `connect_config` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'autoincrement id',
`db_type` varchar(255) NOT NULL COMMENT 'db type',
`db_name` varchar(255) NOT NULL COMMENT 'db name',
`db_path` varchar(255) DEFAULT NULL COMMENT 'file db path',
`db_host` varchar(255) DEFAULT NULL COMMENT 'db connect host(not file db)',
`db_port` varchar(255) DEFAULT NULL COMMENT 'db cnnect port(not file db)',
`db_user` varchar(255) DEFAULT NULL COMMENT 'db user',
`db_pwd` varchar(255) DEFAULT NULL COMMENT 'db password',
`comment` text COMMENT 'db comment',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_db` (`db_name`),
KEY `idx_q_db_type` (`db_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT 'Connection confi';
CREATE TABLE `chat_history` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'autoincrement id',
`conv_uid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Conversation record unique id',
`chat_mode` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Conversation scene mode',
`summary` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Conversation record summary',
`user_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'interlocutor',
`messages` text COLLATE utf8mb4_unicode_ci COMMENT 'Conversation details',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT 'Chat history';
CREATE TABLE `chat_feed_back` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`conv_uid` varchar(128) DEFAULT NULL COMMENT 'Conversation ID',
`conv_index` int(4) DEFAULT NULL COMMENT 'Round of conversation',
`score` int(1) DEFAULT NULL COMMENT 'Score of user',
`ques_type` varchar(32) DEFAULT NULL COMMENT 'User question category',
`question` longtext DEFAULT NULL COMMENT 'User question',
`knowledge_space` varchar(128) DEFAULT NULL COMMENT 'Knowledge space name',
`messages` longtext DEFAULT NULL COMMENT 'The details of user feedback',
`user_name` varchar(128) DEFAULT NULL COMMENT 'User name',
`gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'created time',
`gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'update time',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_conv` (`conv_uid`,`conv_index`),
KEY `idx_conv` (`conv_uid`,`conv_index`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 COMMENT='User feedback table';
CREATE TABLE `my_plugin` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'autoincrement id',
`tenant` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'user tenant',
`user_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'user code',
`user_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'user name',
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'plugin name',
`file_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'plugin package file name',
`type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'plugin type',
`version` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'plugin version',
`use_count` int DEFAULT NULL COMMENT 'plugin total use count',
`succ_count` int DEFAULT NULL COMMENT 'plugin total success count',
`gmt_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'plugin install time',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='User plugin table';
CREATE TABLE `plugin_hub` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'autoincrement id',
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'plugin name',
`description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'plugin description',
`author` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'plugin author',
`email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'plugin author email',
`type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'plugin type',
`version` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'plugin version',
`storage_channel` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'plugin storage channel',
`storage_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'plugin download url',
`download_param` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'plugin download param',
`gmt_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'plugin upload time',
`installed` int DEFAULT NULL COMMENT 'plugin already installed count',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Plugin Hub table';
CREATE TABLE `prompt_manage` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`chat_scene` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Chat scene',
`sub_chat_scene` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Sub chat scene',
`prompt_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Prompt type: common or private',
`prompt_name` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'prompt name',
`content` longtext COLLATE utf8mb4_unicode_ci COMMENT 'Prompt content',
`user_name` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'User name',
`gmt_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'created time',
`gmt_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'update time',
PRIMARY KEY (`id`),
UNIQUE KEY `prompt_name_uiq` (`prompt_name`),
KEY `gmt_created_idx` (`gmt_created`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Prompt management table';
CREATE DATABASE EXAMPLE_1;
use EXAMPLE_1;
CREATE TABLE `users` (

View File

@@ -1,16 +0,0 @@
CREATE DATABASE prompt_management;
use prompt_management;
CREATE TABLE `prompt_manage` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`chat_scene` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '场景',
`sub_chat_scene` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '子场景',
`prompt_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '类型: common or private',
`prompt_name` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'prompt的名字',
`content` longtext COLLATE utf8mb4_unicode_ci COMMENT 'prompt的内容',
`user_name` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户名',
`gmt_created` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `prompt_name_uiq` (`prompt_name`),
KEY `gmt_created_idx` (`gmt_created`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='prompt管理表';

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 KiB

After

Width:  |  Height:  |  Size: 133 KiB

View File

@@ -28,7 +28,9 @@ WORKDIR /app
# RUN pip3 install -i $PIP_INDEX_URL ".[all]"
RUN pip3 install --upgrade pip -i $PIP_INDEX_URL \
&& pip3 install -i $PIP_INDEX_URL ".[$DB_GPT_INSTALL_MODEL]"
&& pip3 install -i $PIP_INDEX_URL ".[$DB_GPT_INSTALL_MODEL]" \
# install openai for proxyllm
&& pip3 install -i $PIP_INDEX_URL ".[openai]"
RUN (if [ "${LANGUAGE}" = "zh" ]; \
# language is zh, download zh_core_web_sm from github

View File

@@ -7,6 +7,16 @@ services:
restart: unless-stopped
networks:
- dbgptnet
api-server:
image: eosphorosai/dbgpt:latest
command: dbgpt start apiserver --controller_addr http://controller:8000
restart: unless-stopped
depends_on:
- controller
networks:
- dbgptnet
ports:
- 8100:8100/tcp
llm-worker:
image: eosphorosai/dbgpt:latest
command: dbgpt start worker --model_name vicuna-13b-v1.5 --model_path /app/models/vicuna-13b-v1.5 --port 8001 --controller_addr http://controller:8000

View File

@@ -1,3 +1,8 @@
A chat between a curious user and an artificial intelligence assistant, who very familiar with database related knowledge.
The assistant gives helpful, detailed, professional and polite answers to the user's questions. 基于以下已知的信息, 专业、简要的回答用户的问题,
如果无法从提供的内容中获取答案, 请说: "知识库中提供的内容不足以回答此问题" 禁止胡乱编造, 回答的时候最好按照1.2.3.点进行总结。
已知内容:
OceanBase 数据库OceanBase Database是一款完全自研的企业级原生分布式数据库在普通硬件上实现金融级高可用首创“三地五中心”城市级故障自动无损容灾新标准刷新 TPC-C 标准测试,单集群规模超过 1500 节点,具有云原生、强一致性、高度兼容 Oracle/MySQL 等特性。
核心特性
@@ -203,4 +208,7 @@ OceanBase 数据库是多租户的数据库系统,一个集群内可包含多
创建租户前,需首先确定租户的资源配置、使用资源范围等。租户创建的通用流程如下:
资源配置是描述资源池的配置信息,用来描述资源池中每个资源单元可用的 CPU、内存、存储空间和 IOPS 等的规格。修改资源配置可动态调整资源单元的规格。这里需要注意,资源配置指定的是对应资源单元能够提供的服务能力,而不是资源单元的实时负载。 创建资源配置的示例语句如下:
资源配置是描述资源池的配置信息,用来描述资源池中每个资源单元可用的 CPU、内存、存储空间和 IOPS 等的规格。修改资源配置可动态调整资源单元的规格。这里需要注意,资源配置指定的是对应资源单元能够提供的服务能力,而不是资源单元的实时负载。 创建资源配置的示例语句如下:
问题:
请你基于上述内容对 OceanBase 的介绍进行总结不少于2000字。

View File

@@ -0,0 +1,219 @@
import random
import string
import os
import pymysql
from typing import List
import pymysql.cursors
from datetime import datetime, timedelta
# At first you need to create an test database which called dbgpt_test;
# you can use next command to create.
# CREATE DATABASE IF NOT EXISTS dbgpt_test CHARACTER SET utf8;
def build_table(connection):
connection.cursor().execute(
"""CREATE TABLE user (
id INT(11) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
name VARCHAR(50) NOT NULL COMMENT '用户名',
email VARCHAR(50) NOT NULL COMMENT '电子邮件',
mobile CHAR(11) NOT NULL COMMENT '手机号码',
gender VARCHAR(20) COMMENT '性别',
birth DATE COMMENT '出生日期',
country VARCHAR(20) COMMENT '国家',
city VARCHAR(20) COMMENT '城市',
create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (id),
UNIQUE KEY uk_email (email)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户信息表';"""
)
connection.cursor().execute(
"""CREATE TABLE transaction_order (
id INT(11) NOT NULL AUTO_INCREMENT COMMENT '订单ID',
order_no CHAR(20) NOT NULL COMMENT '订单编号',
product_name VARCHAR(50) NOT NULL COMMENT '产品名称',
product_category VARCHAR(20) COMMENT '产品分类',
amount DECIMAL(10, 2) NOT NULL COMMENT '订单金额',
pay_status VARCHAR(20) COMMENT '付款状态',
user_id INT(11) NOT NULL COMMENT '用户ID',
user_name VARCHAR(50) COMMENT '用户名',
create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (id),
UNIQUE KEY uk_order_no (order_no),
KEY idx_user_id (user_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='交易订单表';"""
)
def user_build(names: List, country: str, grander: str = "Male") -> List:
countries = ["China", "US", "India", "Indonesia", "Pakistan"] # 国家列表
cities = {
"China": ["Beijing", "Shanghai", "Guangzhou", "Shenzhen", "Hangzhou"],
"US": ["New York", "Los Angeles", "Chicago", "Houston", "Phoenix"],
"India": ["Mumbai", "Delhi", "Bangalore", "Hyderabad", "Chennai"],
"Indonesia": ["Jakarta", "Surabaya", "Medan", "Bandung", "Makassar"],
"Pakistan": ["Karachi", "Lahore", "Faisalabad", "Rawalpindi", "Multan"],
}
users = []
for i in range(1, len(names) + 1):
if grander == "Male":
id = int(str(countries.index(country) + 1) + "10") + i
else:
id = int(str(countries.index(country) + 1) + "20") + i
name = names[i - 1]
email = f"{name}@example.com"
mobile = "".join(random.choices(string.digits, k=10))
gender = grander
birth = f"19{random.randint(60, 99)}-{random.randint(1, 12):02d}-{random.randint(1, 28):02d}"
country = country
city = random.choice(cities[country])
now = datetime.now()
year = now.year
start = datetime(year, 1, 1)
end = datetime(year, 12, 31)
random_date = start + timedelta(days=random.randint(0, (end - start).days))
random_time = datetime.combine(random_date, datetime.min.time()) + timedelta(
seconds=random.randint(0, 24 * 60 * 60 - 1)
)
random_datetime_str = random_time.strftime("%Y-%m-%d %H:%M:%S")
create_time = random_datetime_str
users.append(
(
id,
name,
email,
mobile,
gender,
birth,
country,
city,
create_time,
create_time,
)
)
return users
def gnerate_all_users(cursor):
users = []
users_f = ["ZhangWei", "LiQiang", "ZhangSan", "LiSi"]
users.extend(user_build(users_f, "China", "Male"))
users_m = ["Hanmeimei", "LiMeiMei", "LiNa", "ZhangLi", "ZhangMing"]
users.extend(user_build(users_m, "China", "Female"))
users1_f = ["James", "John", "David", "Richard"]
users.extend(user_build(users1_f, "US", "Male"))
users1_m = ["Mary", "Patricia", "Sarah"]
users.extend(user_build(users1_m, "US", "Female"))
users2_f = ["Ravi", "Rajesh", "Ajay", "Arjun", "Sanjay"]
users.extend(user_build(users2_f, "India", "Male"))
users2_m = ["Priya", "Sushma", "Pooja", "Swati"]
users.extend(user_build(users2_m, "India", "Female"))
for user in users:
cursor.execute(
"INSERT INTO user (id, name, email, mobile, gender, birth, country, city, create_time, update_time) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
user,
)
return users
def gnerate_all_orders(users, cursor):
orders = []
orders_num = 200
categories = ["Clothing", "Food", "Home Appliance", "Mother and Baby", "Travel"]
categories_product = {
"Clothing": ["T-shirt", "Jeans", "Skirt", "Other"],
"Food": ["Snack", "Fruit"],
"Home Appliance": ["Refrigerator", "Television", "Air conditioner"],
"Mother and Baby": ["Diapers", "Milk Powder", "Stroller", "Toy"],
"Travel": ["Tent", "Fishing Rod", "Bike", "Rawalpindi", "Multan"],
}
for i in range(1, orders_num + 1):
id = i
order_no = "".join(random.choices(string.ascii_uppercase, k=3)) + "".join(
random.choices(string.digits, k=10)
)
product_category = random.choice(categories)
product_name = random.choice(categories_product[product_category])
amount = round(random.uniform(0, 10000), 2)
pay_status = random.choice(["SUCCESS", "FAILD", "CANCEL", "REFUND"])
user_id = random.choice(users)[0]
user_name = random.choice(users)[1]
now = datetime.now()
year = now.year
start = datetime(year, 1, 1)
end = datetime(year, 12, 31)
random_date = start + timedelta(days=random.randint(0, (end - start).days))
random_time = datetime.combine(random_date, datetime.min.time()) + timedelta(
seconds=random.randint(0, 24 * 60 * 60 - 1)
)
random_datetime_str = random_time.strftime("%Y-%m-%d %H:%M:%S")
create_time = random_datetime_str
order = (
id,
order_no,
product_category,
product_name,
amount,
pay_status,
user_id,
user_name,
create_time,
)
cursor.execute(
"INSERT INTO transaction_order (id, order_no, product_name, product_category, amount, pay_status, user_id, user_name, create_time) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
order,
)
if __name__ == "__main__":
connection = pymysql.connect(
host=os.getenv("DB_HOST", "127.0.0.1"),
port=int(
os.getenv("DB_PORT", 3306),
),
user=os.getenv("DB_USER", "root"),
password=os.getenv("DB_PASSWORD", "aa12345678"),
database=os.getenv("DB_DATABASE", "dbgpt_test"),
charset="utf8mb4",
ssl_ca=None,
)
build_table(connection)
connection.commit()
cursor = connection.cursor()
users = gnerate_all_users(cursor)
connection.commit()
gnerate_all_orders(users, cursor)
connection.commit()
cursor.execute("SELECT * FROM user")
data = cursor.fetchall()
print(data)
cursor.execute("SELECT count(*) FROM transaction_order")
data = cursor.fetchall()
print("orders:" + str(data))
cursor.close()
connection.close()

928
docs/_static/css/custom.css vendored Normal file
View File

@@ -0,0 +1,928 @@
/* override default colors used in the Sphinx theme */
:root {
--tabs-color-label-active: #0475DE;
--tabs-color-label-hover: #0475DE;
--buttons-color-blue: #0475DE;
--tabs-color-label-inactive: #9E9E9E;
--tabs-color-overline: #e0e0e0;
--tabs-color-underline: #e0e0e0;
--border-color-gray: #e0e0e0;
--background-color-light-gray:#fafafa;
--background-color-disabled: #9E9E9E;
--pst-color-link: 4, 117, 222;
--pst-color-primary: 4, 117, 222;
--pst-color-text-secondary: #616161;
--blue: #0475DE;
--sidebar-top: 5em;
}
/* Remove flicker for announcement top bar replacement */
.header-item.announcement {
background-color: white;
color: white;
padding: 0;
}
/* Make the book theme secondary nav stick below the new main top nav */
.header-article {
top: 58px;
z-index: 900 !important;
}
.toctree-l1.has-children {
font-weight: bold;
}
.toctree-l2 {
font-weight: normal;
}
div.navbar-brand-box {
padding-top: 4em;
}
td p {
margin-left: 0.75rem;
}
table.longtable.table.autosummary {
table-layout: fixed;
}
.table.autosummary td {
width: 100%;
}
tr.row-odd {
background-color: #f9fafb;
}
/* For Algolia search box
* overflow-y: to flow-over horizontally into main content
* height: to prevent topbar overlap
*/
#site-navigation {
overflow-y: auto;
height: calc(100vh - var(--sidebar-top));
position: sticky;
top: var(--sidebar-top) !important;
}
/* Center the algolia search bar*/
#search-input {
text-align: center;
}
.algolia-autocomplete {
width: 100%;
margin: auto;
}
/* Hide confusing "<-" back arrow in navigation for larger displays */
@media (min-width: 768px) {
#navbar-toggler {
display: none;
}
}
/* Make navigation scrollable on mobile, by making algolia not overflow */
@media (max-width: 768px) {
#site-navigation {
overflow-y: scroll;
}
.algolia-autocomplete .ds-dropdown-menu{
min-width: 250px;
}
}
/* sphinx-panels overrides the content width to 1140 for large displays.*/
@media (min-width: 1200px) {
.container, .container-lg, .container-md, .container-sm, .container-xl {
max-width: 1400px !important;
}
}
.bottom-right-promo-banner {
position: fixed;
bottom: 100px;
right: 20px;
width: 270px;
}
@media (max-width: 1500px) {
.bottom-right-promo-banner {
display: none;
}
}
@media screen and (max-width: 767px) {
.remove-mobile {
display: none;
}
}
@media screen and (max-width: 767px) {
.row-2-column {
flex-direction: column;
margin-top: 20px;
}
}
/* Make Algolia search box scrollable */
.algolia-autocomplete .ds-dropdown-menu {
height: 60vh !important;
overflow-y: scroll !important;
}
.bd-sidebar__content {
overflow-y: unset !important;
}
.bd-sidebar__top {
display: flex;
flex-direction: column;
}
.bd-sidebar li {
position: relative;
word-wrap: break-word;
}
nav.bd-links {
flex: 1;
}
nav.bd-links::-webkit-scrollbar-thumb {
background-color: #ccc;
}
nav.bd-links::-webkit-scrollbar {
width: 5px;
}
dt:target, span.highlighted {
background-color: white;
}
div.sphx-glr-bigcontainer {
display: inline-block;
width: 100%;
}
td.tune-colab,
th.tune-colab {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
/* Adjustment to Sphinx Book Theme */
.table td {
/* Remove row spacing on the left */
padding-left: 0;
}
.table thead th {
/* Remove row spacing on the left */
padding-left: 0;
}
img.inline-figure {
/* Override the display: block for img */
display: inherit !important;
}
#version-warning-banner {
/* Make version warning clickable */
z-index: 1;
margin-left: 0;
/* 20% is for ToC rightbar */
/* 2 * 1.5625em is for horizontal margins */
width: calc(100% - 20% - 2 * 1.5625em);
}
/* allow scrollable images */
.figure {
max-width: 100%;
overflow-x: auto;
}
img.horizontal-scroll {
max-width: none;
}
.clear-both {
clear: both;
min-height: 100px;
margin-top: 15px;
}
.buttons-float-left {
width: 150px;
float: left;
}
.buttons-float-right {
width: 150px;
float: right;
}
.card-body {
padding: 0.5rem !important;
}
/* custom css for pre elements */
pre {
/* Wrap code blocks instead of horizontal scrolling. */
white-space: pre-wrap;
box-shadow: none;
border-color: var(--border-color-gray);
background-color: var(--background-color-light-gray);
border-radius:0.25em;
}
/* notebook formatting */
.cell .cell_output {
max-height: 250px;
overflow-y: auto;
font-weight: bold;
}
/* Yellow doesn't render well on light background */
.cell .cell_output pre .-Color-Yellow {
color: #785840;
}
/* Newlines (\a) and spaces (\20) before each parameter */
.sig-param::before {
content: "\a\20\20\20\20";
white-space: pre;
}
/* custom css for outlined buttons */
.btn-outline-info:hover span, .btn-outline-primary:hover span {
color: #fff;
}
.btn-outline-info, .btn-outline-primary{
border-color: var(--buttons-color-blue);
}
.btn-outline-info:hover, .btn-outline-primary:hover{
border-color: var(--buttons-color-blue);
background-color: var(--buttons-color-blue);
}
.btn-outline-info.active:not(:disabled):not(.disabled), .btn-outline-info:not(:disabled):not(.disabled):active, .show>.btn-outline-info.dropdown-toggle {
border-color: var(--buttons-color-blue);
background-color: var(--buttons-color-blue);
color: #fff;
}
.btn-info, .btn-info:hover, .btn-info:focus {
border-color: var(--buttons-color-blue);
background-color: var(--buttons-color-blue);
}
.btn-info:hover{
opacity: 90%;
}
.btn-info:disabled{
border-color: var(--background-color-disabled);
background-color: var(--background-color-disabled);
opacity: 100%;
}
.btn-info.active:not(:disabled):not(.disabled), .btn-info:not(:disabled):not(.disabled):active, .show>.btn-info.dropdown-toggle {
border-color: var(--buttons-color-blue);
background-color: var(--buttons-color-blue);
}
.topnav {
background-color: white;
border-bottom: 1px solid rgba(0, 0, 0, .1);
display: flex;
align-items: center;
}
/* Content wrapper for the unified nav link / menus */
.top-nav-content {
max-width: 1400px;
width: 100%;
margin-left: auto;
margin-right: auto;
padding: 0 1.5rem;
display: flex;
align-items: center;
justify-content: space-between;
}
@media (max-width: 900px) {
/* If the window is too small, hide the custom sticky navigation bar at the top of the page.
Also make the pydata-sphinx-theme nav bar, which usually sits below the top nav bar, stick
to the top of the page.
*/
.top-nav-content {
display: none;
}
div.header-article.row.sticky-top.noprint {
position: sticky;
top: 0;
}
}
/* Styling the links and menus in the top nav */
.top-nav-content a {
text-decoration: none;
color: black;
font-size: 17px;
}
.top-nav-content a:hover {
color: #007bff;
}
/* The left part are the links and menus */
.top-nav-content > .left {
display: flex;
white-space: nowrap;
}
.top-nav-content .left > * {
margin-right: 8px;
}
.top-nav-content .left > a,
.top-nav-content .left > .menu > a {
text-align: center;
padding: 14px 16px;
border-bottom: 2px solid white;
}
.top-nav-content .menu:hover > a,
.top-nav-content .left > a:hover {
border-bottom: 2px solid #007bff;
}
/* Special styling for the Ray logo */
.top-nav-content .left > a.ray-logo {
width: 90px;
padding: 10px 0;
}
.top-nav-content .left > a.ray-logo:hover {
border-bottom: 2px solid white;
}
/* Styling the dropdown menus */
.top-nav-content .menu {
display: flex;
}
.top-nav-content .menu > a > .down-caret {
margin-left: 8px;
}
.top-nav-content .menu > ul {
display: none;
}
.top-nav-content > button.try-anyscale > span {
margin: 0 12px;
}
.top-nav-content .menu:hover > ul {
display: flex;
flex-direction: column;
align-items: flex-start;
box-shadow: 0 5px 15px 0 rgb(0 0 0 / 10%);
padding: 15px;
width: 330px;
position: absolute;
z-index: 2000;
background-color: white;
top: 58px;
}
.top-nav-content .menu:hover > ul > li {
list-style: none;
padding: 5px 0;
}
.top-nav-content .menu:hover > ul > li span {
display: block;
}
.top-nav-content .menu:hover > ul > li span.secondary {
color: #787878;
}
/* Styling the "Try Anyscale" button */
.top-nav-content > button.try-anyscale {
float: right;
border-radius: 6px;
background-color: #e7f2fa;
padding-left: 12px;
padding-right: 12px;
margin-left: 12px;
height: 40px;
border: none;
white-space: nowrap;
}
@media (max-width: 1000px) {
.top-nav-content > button.try-anyscale {
display: none;
}
}
/* custom css for tabs*/
.tabbed-set>label,.tabbed-set>label:hover {
border-bottom: 1px solid var(--border-color-gray);
color:var(--tabs-color-label-inactive);
font-weight: 500;
}
.tabbed-set>input:checked+label{
border-bottom: 0.125em solid;
color:var(--tabs-color-label-active);
}
.tabbed-label{
margin-bottom:0;
}
/* custom css for jupyter cells */
div.cell div.cell_input{
border: 1px var(--border-color-gray) solid;
background-color: var(--background-color-light-gray);
border-radius:0.25em;
border-left-color: var(--green);
border-left-width: medium;
}
/* custom css for table */
table {
border-color: var(--border-color-gray);
}
/* custom css for topic component */
div.topic{
border: 1px solid var(--border-color-gray);
border-radius:0.25em;
}
.topic {
background-color: var(--background-color-light-gray);
}
/* custom css for card component */
.card{
border-color: var(--border-color-gray);
}
.card-footer{
background-color: var(--background-color-light-gray);
border-top-color: var(--border-color-gray);
}
/* custom css for section navigation component */
.bd-toc nav>.nav {
border-left-color: var(--border-color-gray);
}
/* custom css for up and down arrows in collapsible cards */
details.dropdown .summary-up, details.dropdown .summary-down {
top: 1em;
}
/* remove focus border in collapsible admonition buttons */
.toggle.admonition button.toggle-button:focus {
outline: none;
}
/* custom css for shadow class */
.shadow {
box-shadow: 0 0.2rem 0.5rem rgb(0 0 0 / 5%), 0 0 0.0625rem rgb(0 0 0 / 10%) !important;
}
/* custom css for text area */
textarea {
border-color: var(--border-color-gray);
}
/* custom css for footer */
footer {
margin-top: 1rem;
padding:1em 0;
border-top-color: var(--border-color-gray);
}
.footer p{
color: var(--pst-color-text-secondary);
}
/* Make the hover color of tag/gallery buttons differ from "active" */
.tag.btn-outline-primary:hover {
background-color: rgba(20, 99, 208, 0.62) !important;
}
span.rst-current-version > span.fa.fa-book {
/* Move the book icon away from the top right
* corner of the version flyout menu */
margin: 10px 0px 0px 5px;
}
/*Extends the docstring signature box.*/
.rst-content dl:not(.docutils) dt {
display: block;
padding: 10px;
word-wrap: break-word;
padding-right: 100px;
}
/*Lists in an admonition note do not have awkward whitespace below.*/
.rst-content .admonition-note .section ul {
margin-bottom: 0;
}
/*Properties become blue (classmethod, staticmethod, property)*/
.rst-content dl dt em.property {
color: #2980b9;
text-transform: uppercase;
}
.rst-content .section ol p,
.rst-content .section ul p {
margin-bottom: 0;
}
/* Adjustment to Version block */
.rst-versions {
z-index: 1200 !important;
}
.image-header {
display: flex;
flex-direction: row;
align-items: center;
padding-left: 16px;
padding-right:16px;
gap: 16px;
}
.info-box {
box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.05);
border-radius: 8px;
padding: 20px;
}
.info-box:hover{
box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.1);
}
.no-underline{
text-decoration: none;
}
.no-underline:hover{
text-decoration: none;
}
.icon-hover:hover{
height: 30px ;
width: 30px;
}
.info-box-2 {
background-color: #F9FAFB;
border-radius: 8px;
padding-right: 16px;
padding-left: 16px;
padding-bottom: 24px;
padding-top: 4px;
}
.bold-link {
color: #000000 !important;
font-weight: 600;
}
.community-box {
border: 1px solid #D2DCE6;
border-radius: 8px;
display: flex;
margin-bottom: 16px;
}
.community-box:hover {
box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.05);
text-decoration: none;
}
.community-box p {
margin-top: 1rem !important;
}
.tab-pane pre {
margin: 0;
padding: 0;
max-height: 252px;
overflow-y: auto;
}
.grid-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px,1fr));
grid-gap: 16px;
}
.grid-item {
padding: 20px;
}
.nav-pills {
background-color: #F9FAFB;
color: #000000;
padding: 8px;
border-bottom:none;
border-radius: 8px;
}
.nav-pills .nav-link.active {
background-color: #FFFFFF !important;
box-shadow: 0px 3px 14px 2px rgba(3,28,74,0.12);
border-radius: 8px;
padding: 20px;
color: #000000;
font-weight: 500;
}
.searchDiv {
width: 100%;
position: relative;
display: block;
}
.searchTerm {
width: 80%;
border: 2px solid var(--blue);
padding: 5px;
height: 45px;
border-radius: 5px;
outline: none;
}
.searchButton {
width: 40px;
height: 45px;
border: 1px solid var(--blue);
background: var(--blue);
color: #fff;
border-radius: 5px;
cursor: pointer;
font-size: 20px;
}
/*Resize the wrap to see the search bar change!*/
.searchWrap {
width: 100%;
position: relative;
margin: 15px;
top: 50%;
left: 50%;
transform: translate(-50%, -10%);
text-align: center;
}
.sd-card {
border: none !important;
}
.tag {
margin-bottom: 5px;
font-size: small;
}
/* Override float positioning of next-prev buttons so that
they take up space normally, and we can put other stuff at
the bottom of the page. */
.prev-next-area {
display: flex;
flex-direction: row;
}
.prev-next-area a.left-prev {
margin-right: auto;
width: fit-content;
float: none;
}
.prev-next-area a.right-next {
margin-left: auto;
width: fit-content;
float: none;
}
/* CSAT widgets */
#csat-inputs {
display: flex;
flex-direction: row;
align-items: center;
}
.csat-hidden {
display: none !important;
}
#csat-feedback-label {
color: #000;
font-weight: 500;
}
.csat-button {
margin-left: 16px;
padding: 8px 16px 8px 16px;
border-radius: 4px;
border: 1px solid #D2DCE6;
background: #FFF;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
cursor: pointer;
width: 85px;
}
#csat-textarea-group {
display: flex;
flex-direction: column;
}
#csat-submit {
margin-left: auto;
font-weight: 700;
border: none;
margin-top: 12px;
cursor: pointer;
}
#csat-feedback-received {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.csat-button-active {
border: 1px solid #000;
}
.csat-icon {
margin-right: 4px;
}
footer.col.footer {
display: flex;
flex-direction: row;
}
footer.col.footer > p {
margin-left: auto;
}
#csat {
min-width: 60%;
}
#csat-textarea {
resize: none;
}
/* Ray Assistant */
.container-xl.blurred {
filter: blur(5px);
}
.chat-widget {
position: fixed;
bottom: 10px;
right: 10px;
z-index: 1000;
}
.chat-popup {
display: none;
position: fixed;
top: 20%;
left: 50%;
transform: translate(-50%, -20%);
width: 50%;
height: 70%;
background-color: white;
border: 1px solid #ccc;
border-radius: 10px;
box-shadow: 0 5px 10px rgba(0,0,0,0.1);
z-index: 1001;
max-height: 1000px;
overflow: hidden;
padding-bottom: 40px;
}
.chatFooter {
position: absolute;
bottom: 0;
right: 0;
width: 100%;
background-color: #f8f9fa;
}
#openChatBtn {
background-color: #000;
color: #fff;
width: 70px;
height: 70px;
border-radius: 10px;
border: none;
display: flex;
align-items: center;
justify-content: center;
}
#closeChatBtn {
border: none;
background-color: transparent;
color: #000;
font-size: 1.2em;
}
#closeChatBtn:hover {
color: #888;
}
.chatHeader {
display: flex;
justify-content: space-between;
align-items: center;
}
.chatContentContainer {
padding: 15px;
max-height: calc(100% - 80px);
overflow-y: auto;
}
.chatContentContainer input {
margin-top: 10px;
margin-bottom: 10px;
}
#result{
padding: 15px;
border-radius: 10px;
margin-top: 10px;
margin-bottom: 10px;
background-color: #f8f9fa;
max-height: calc(100% - 20px);
overflow-y: auto;
}
.chatContentContainer textarea {
flex-grow: 1;
min-width: 50px;
max-height: 40px;
resize: none;
}
.searchBtn {
white-space: nowrap;
}
.input-group {
display: flex;
align-items: stretch;
}
/* Kapa Ask AI button */
#kapa-widget-container figure {
padding: 0 !important;
}
.mantine-Modal-root figure {
padding: 0 !important;
}
@font-face {
font-family: "Linux Biolinum Keyboard";
src: url(../fonts/LinBiolinum_Kah.ttf);
}
.keys {
font-family: "Linux Biolinum Keyboard", sans-serif;
}
.bd-article-container h1, .bd-article-container h2, .bd-article-container h3, .bd-article-container h4, .bd-article-container h5, .bd-article-container p.caption {
color: black;
}

218
docs/_static/css/examples.css vendored Normal file
View File

@@ -0,0 +1,218 @@
#site-navigation {
width: 330px !important;
border-right: none;
margin-left: 32px;
overflow-y: auto;
max-height: calc(100vh - var(--sidebar-top));
position: sticky;
top: var(--sidebar-top) !important;
z-index: 1000;
}
#site-navigation h5 {
font-size: 16px;
font-weight: 600;
color: #000;
}
#site-navigation h6 {
font-size: 14px;
font-weight: 600;
color: #000;
text-transform: uppercase;
}
/* Hide the default sidebar content */
#site-navigation > div.bd-sidebar__content {
display: none;
}
#site-navigation > div.rtd-footer-container {
display: none;
}
.searchDiv {
margin-bottom: 2em;
}
#searchInput {
width: 100%;
color: #5F6469;
border: 1px solid #D2DCE6;
height: 50px;
border-radius: 4px;
background-color: #F9FAFB;
background-image: url("data:image/svg+xml,%3Csvg width='25' height='25' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='Systems / search-line' clip-path='url(%23clip0_1_150)'%3E%3Crect width='24' height='24' transform='translate(0.398529 0.0546875)' fill='%23F9FAFB'/%3E%3Cg id='Group'%3E%3Cpath id='Vector' d='M18.4295 16.6717L22.7125 20.9537L21.2975 22.3687L17.0155 18.0857C15.4223 19.3629 13.4405 20.0576 11.3985 20.0547C6.43053 20.0547 2.39853 16.0227 2.39853 11.0547C2.39853 6.08669 6.43053 2.05469 11.3985 2.05469C16.3665 2.05469 20.3985 6.08669 20.3985 11.0547C20.4014 13.0967 19.7068 15.0784 18.4295 16.6717ZM16.4235 15.9297C17.6926 14.6246 18.4014 12.8751 18.3985 11.0547C18.3985 7.18669 15.2655 4.05469 11.3985 4.05469C7.53053 4.05469 4.39853 7.18669 4.39853 11.0547C4.39853 14.9217 7.53053 18.0547 11.3985 18.0547C13.219 18.0576 14.9684 17.3488 16.2735 16.0797L16.4235 15.9297V15.9297Z' fill='%238C9196'/%3E%3C/g%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_1_150'%3E%3Crect width='24' height='24' fill='white' transform='translate(0.398529 0.0546875)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A");
background-repeat: no-repeat;
background-position-x: 0.5em;
background-position-y: center;
background-size: 1.5em;
padding-left: 3em;
}
#searchInput::placeholder {
color: #5F6469;
opacity: 1;
}
.tag {
margin-bottom: 5px;
font-size: small;
color: #000000;
border: 1px solid #D2DCE6;
border-radius: 14px;
display: flex;
flex-direction: row;
align-items: center;
width: fit-content;
gap: 1em;
}
.tag.btn-outline-primary {
color: #000000;
padding: 3px 12px 3px 12px;
line-height: 20px;
}
.tag-btn-wrapper {
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 1em;
}
div.sd-container-fluid.docutils > div {
gap: var(--ray-example-gallery-gap-y) var(--ray-example-gallery-gap-x);
display: grid;
grid-template-columns: 1fr;
}
/* Reflow to a 2-column format for normal screens */
@media screen and (min-width: 768px) {
div.sd-container-fluid.docutils > div {
grid-template-columns: 1fr 1fr;
}
}
div.gallery-item {
width: auto;
}
div.gallery-item > div.sd-card {
border-radius: 8px;
box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.05) !important;
}
/* Example gallery "Tutorial" title */
div.sd-card-title > span.sd-bg-success.sd-bg-text-success {
color: #2F80ED !important;
font-weight: 500;
background: linear-gradient(180deg, rgba(25, 177, 226, 0.2) 0%, rgba(0, 109, 255, 0.2) 100%);
background-color: initial !important;
}
/* Example gallery "Code example" title */
div.sd-card-title > span.sd-bg-secondary.sd-bg-text-secondary {
color: #219653 !important;
font-weight: 500;
background: linear-gradient(180deg, rgba(29, 151, 108, 0.2) 0%, rgba(0, 226, 147, 0.2) 100%);
background-color: initial !important;
}
/* Example gallery "Blog" title */
div.sd-card-title > span.sd-bg-primary.sd-bg-text-primary {
color: #F2994A !important;
font-weight: 500;
background: linear-gradient(180deg, rgba(255, 230, 5, 0.2) 0%, rgba(255, 185, 80, 0.2) 100%);
background-color: initial !important;
}
/* Example gallery "Video" title */
div.sd-card-title > span.sd-bg-warning.sd-bg-text-warning {
color: #EB5757 !important;
font-weight: 500;
background: linear-gradient(180deg, rgba(150, 7, 7, 0.2) 0%, rgba(255, 115, 115, 0.2) 100%);
background-color: initial !important;
}
/* Example gallery "Course" title */
div.sd-card-title > span.sd-bg-info.sd-bg-text-info {
color: #7A64FF !important;
font-weight: 500;
background: linear-gradient(180deg, rgba(53, 25, 226, 0.2) 0%, rgba(183, 149, 255, 0.2) 100%);
background-color: initial !important;
}
div.sd-card-body > p.sd-card-text > a {
text-align: initial;
}
div.sd-card-body > p.sd-card-text > a > span {
color: rgb(81, 81, 81);
}
#main-content {
max-width: 100%;
}
#noMatches {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
#noMatchesInnerContent {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
#noMatches.hidden,.gallery-item.hidden {
display: none !important;
}
.btn-primary {
color: #004293;
background: rgba(61, 138, 233, 0.20);
padding: 3px 12px 3px 12px;
border: 1px solid #D2DCE6;
}
button.try-anyscale {
background-color: initial !important;
width: fit-content;
padding: 0 !important;
margin-left: auto !important;
float: initial !important;
}
button.try-anyscale > svg {
display: none;
}
button.try-anyscale > i {
display: none;
}
button.try-anyscale > span {
margin: 0;
text-decoration-line: underline;
font-weight: 500;
color: #000;
}
.top-nav-content {
justify-content: initial;
}
/* Hide nav bar that has github, fullscreen, and print icons */
div.header-article.row.sticky-top.noprint {
display: none !important;
}
/* Hide the footer with 'prev article' and 'next article' buttons */
.footer-article.hidden {
display: none !important;
}

108
docs/_static/css/termynal.css vendored Normal file
View File

@@ -0,0 +1,108 @@
/**
* termynal.js
*
* @author Ines Montani <ines@ines.io>
* @version 0.0.1
* @license MIT
*/
:root {
--color-bg: #252a33;
--color-text: #eee;
--color-text-subtle: #a2a2a2;
}
[data-termynal] {
width: auto;
max-width: 100%;
background: var(--color-bg);
color: var(--color-text);
font-size: 18px;
font-family: 'Fira Mono', Consolas, Menlo, Monaco, 'Courier New', Courier, monospace;
border-radius: 4px;
padding: 75px 45px 35px;
position: relative;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
[data-termynal]:before {
content: '';
position: absolute;
top: 15px;
left: 15px;
display: inline-block;
width: 15px;
height: 15px;
border-radius: 50%;
/* A little hack to display the window buttons in one pseudo element. */
background: #d9515d;
-webkit-box-shadow: 25px 0 0 #f4c025, 50px 0 0 #3ec930;
box-shadow: 25px 0 0 #f4c025, 50px 0 0 #3ec930;
}
[data-termynal]:after {
content: 'bash';
position: absolute;
color: var(--color-text-subtle);
top: 5px;
left: 0;
width: 100%;
text-align: center;
}
[data-ty] {
display: block;
line-height: 2;
}
[data-ty]:before {
/* Set up defaults and ensure empty lines are displayed. */
content: '';
display: inline-block;
vertical-align: middle;
}
[data-ty="input"]:before,
[data-ty-prompt]:before {
margin-right: 0.75em;
color: var(--color-text-subtle);
}
[data-ty="input"]:before {
content: '$';
}
[data-ty][data-ty-prompt]:before {
content: attr(data-ty-prompt);
}
[data-ty-cursor]:after {
content: attr(data-ty-cursor);
font-family: monospace;
margin-left: 0.5em;
-webkit-animation: blink 1s infinite;
animation: blink 1s infinite;
}
a[data-terminal-control] {
text-align: right;
display: block;
color: #aebbff;
}
/* Cursor animation */
@-webkit-keyframes blink {
50% {
opacity: 0;
}
}
@keyframes blink {
50% {
opacity: 0;
}
}

23
docs/_static/css/use_cases.css vendored Normal file
View File

@@ -0,0 +1,23 @@
.query-param-ref-wrapper {
display: flex;
justify-content: center;
align-items: center;
border: 1px solid #8C9196;
border-radius: 8px;
}
.example-gallery-link {
padding: 1em 2em 1em 2em;
text-decoration: none !important;
color: black !important;
display: flex;
align-items: center;
}
/* Shooting star icon next to gallery links */
a.example-gallery-link::before {
content: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='Group'%3E%3Cpath id='Vector' d='M15.199 9.945C14.7653 9.53412 14.4863 8.98641 14.409 8.394L14.006 5.311L11.276 6.797C10.7511 7.08302 10.1436 7.17943 9.55597 7.07L6.49997 6.5L7.06997 9.556C7.1794 10.1437 7.08299 10.7511 6.79697 11.276L5.31097 14.006L8.39397 14.409C8.98603 14.4865 9.53335 14.7655 9.94397 15.199L12.082 17.456L13.418 14.649C13.6744 14.1096 14.1087 13.6749 14.648 13.418L17.456 12.082L15.199 9.945ZM15.224 15.508L13.011 20.158C12.9691 20.2459 12.9065 20.3223 12.8285 20.3806C12.7505 20.4389 12.6594 20.4774 12.5633 20.4926C12.4671 20.5079 12.3686 20.4995 12.2764 20.4682C12.1842 20.4369 12.101 20.3836 12.034 20.313L8.49197 16.574C8.39735 16.4742 8.27131 16.41 8.13497 16.392L3.02797 15.724C2.93149 15.7113 2.83954 15.6753 2.76006 15.6191C2.68058 15.563 2.61596 15.4883 2.57177 15.4016C2.52758 15.3149 2.50514 15.2187 2.5064 15.1214C2.50765 15.0241 2.53256 14.9285 2.57897 14.843L5.04097 10.319C5.10642 10.198 5.12831 10.0582 5.10297 9.923L4.15997 4.86C4.14207 4.76417 4.14778 4.66541 4.17662 4.57229C4.20546 4.47916 4.25656 4.39446 4.3255 4.32553C4.39444 4.25659 4.47913 4.20549 4.57226 4.17665C4.66539 4.14781 4.76414 4.14209 4.85997 4.16L9.92297 5.103C10.0582 5.12834 10.198 5.10645 10.319 5.041L14.843 2.579C14.9286 2.53257 15.0242 2.50769 15.1216 2.50648C15.219 2.50528 15.3152 2.52781 15.4019 2.57211C15.4887 2.61641 15.5633 2.68116 15.6194 2.76076C15.6755 2.84036 15.7114 2.93242 15.724 3.029L16.392 8.135C16.4099 8.27134 16.4742 8.39737 16.574 8.492L20.313 12.034C20.3836 12.101 20.4369 12.1842 20.4682 12.2765C20.4995 12.3687 20.5079 12.4671 20.4926 12.5633C20.4774 12.6595 20.4389 12.7505 20.3806 12.8285C20.3223 12.9065 20.2459 12.9691 20.158 13.011L15.508 15.224C15.3835 15.2832 15.2832 15.3835 15.224 15.508ZM16.021 17.435L17.435 16.021L21.678 20.263L20.263 21.678L16.021 17.435Z' fill='black'/%3E%3C/g%3E%3C/svg%3E%0A");
display: flex;
align-items: center;
margin-right: 0.5em;
}

View File

@@ -14,7 +14,7 @@ project = "DB-GPT"
copyright = "2023, csunny"
author = "csunny"
version = "👏👏 0.4.0"
version = "👏👏 0.4.2"
html_title = project + " " + version
# -- General configuration ---------------------------------------------------
@@ -30,10 +30,24 @@ extensions = [
"myst_nb",
"sphinx_copybutton",
"sphinx_panels",
"sphinx_tabs.tabs",
"IPython.sphinxext.ipython_console_highlighting",
"sphinx.ext.autosectionlabel",
]
source_suffix = [".ipynb", ".html", ".md", ".rst"]
myst_enable_extensions = [
"dollarmath",
"amsmath",
"deflist",
"html_admonition",
"html_image",
"colon_fence",
"smartquotes",
"replacements",
]
# autodoc_pydantic_model_show_json = False
# autodoc_pydantic_field_list_validators = False
# autodoc_pydantic_config_members = False
@@ -53,8 +67,18 @@ locales_dirs = ["./locales/"]
gettext_compact = False
gettext_uuid = True
def setup(app):
app.add_css_file("css/custom.css")
app.add_css_file("css/examples.css")
app.add_css_file("css/termynal.css")
# app.add_css_file("css/use_cases.css")
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = "furo"
html_theme = "sphinx_book_theme"
html_static_path = ["_static"]

View File

@@ -4,6 +4,12 @@ ChatData generates SQL from natural language and executes it. ChatDB involves co
Database, including metadata about databases, tables, and
fields.![db plugins demonstration](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/d8bfeee9-e982-465e-a2b8-1164b673847e)
```{admonition} The LLM (Language Model) suitable for the ChatData scene is
* chatgpt3.5.
* chatgpt4.
* Vicuna-v1.5.
```
### 1.Choose Datasource
If you are using DB-GPT for the first time, you need to add a data source and set the relevant connection information

View File

@@ -3,6 +3,11 @@ ChatExcel
![db plugins demonstration](https://github.com/eosphoros-ai/DB-GPT/assets/13723926/4113ac15-83c2-4350-86c0-5fc795677abd)
ChatExcel uses natural language to analyze and query Excel data.![db plugins demonstration](../../../../assets/chat_excel/chat_excel_1.png)
```{admonition} The LLM (Language Model) suitable for the ChatExcel scene is
* chatgpt3.5.
* chatgpt4.
```
### 1.Select And Upload Excel or CSV File
Select your excel or csv file to upload and start the conversation.
```{tip}

View File

@@ -4,6 +4,11 @@ The purpose of the DB-GPT Dashboard is to empower data analysts with efficiency.
technology, allowing business analysts to perform self-service analysis directly using natural language and gain
insights into their respective areas of business.
```{admonition} The LLM (Language Model) suitable for the Dashboard scene is
* chatgpt3.5.
* chatgpt4.
```
```{note} Dashboard now support Datasource Type
* Mysql
* Sqlite

View File

@@ -100,8 +100,49 @@ pip install --use-pep517 fschat
```
##### Q9: alembic.util.exc.CommandError: Target database is not up to date.
delete files in `DB-GPT/pilot/meta_data/alembic/versions/` and reboot.
delete files in `DB-GPT/pilot/meta_data/alembic/versions/` and restart.
```commandline
rm -rf DB-GPT/pilot/meta_data/alembic/versions/*
rm -rf DB-GPT/pilot/meta_data/alembic/dbgpt.db
```
##### Q10: How to store DB-GPT metadata into my database
In version 0.4.0, the metadata module of the DB-GPT application has been refactored. All metadata tables will now be automatically saved in the 'dbgpt' database, based on the database type specified in the `.env` file. If you would like to retain the existing data, it is recommended to use a data migration tool to transfer the database table information to the 'dbgpt' database. Additionally, you can change the default database name 'dbgpt' in your `.env` file.
```commandline
### SQLite database (Current default database)
#LOCAL_DB_PATH=data/default_sqlite.db
#LOCAL_DB_TYPE=sqlite
### Mysql database
LOCAL_DB_TYPE=mysql
LOCAL_DB_USER=root
LOCAL_DB_PASSWORD=aa12345678
LOCAL_DB_HOST=127.0.0.1
LOCAL_DB_PORT=3306
# You can change it to your actual metadata database name
LOCAL_DB_NAME=dbgpt
### This option determines the storage location of conversation records. The default is not configured to the old version of duckdb. It can be optionally db or file (if the value is db, the database configured by LOCAL_DB will be used)
CHAT_HISTORY_STORE_TYPE=db
```
##### Q11: pymysql.err.OperationalError: (1142, "ALTER command denied to user '{you db user}'@'{you db host}' for table '{some table name}'")
In version 0.4.0, DB-GPT use migration tool alembic to migrate metadata. If the database user does not have DDL permissions, this error will be reported. You can solve this problem by importing the metadata information separately.
1. Use a privileged user to execute DDL sql file
```bash
mysql -h127.0.0.1 -uroot -paa12345678 < ./assets/schema/knowledge_management.sql
```
2. Run DB-GPT webserver with `--disable_alembic_upgrade`
```bash
python pilot/server/dbgpt_server.py --disable_alembic_upgrade
```
or
```bash
dbgpt start webserver --disable_alembic_upgrade
```

View File

@@ -72,7 +72,7 @@ $ mysql -h127.0.0.1 -uroot -paa12345678 < ./assets/schema/knowledge_management.s
##### Q6:when pull from 0.4.0, I found historical knowledge document disappeared
In version 0.4.0, the metadata module of the DB-GPT application has been refactored. All metadata tables will now be automatically saved in the 'dbgpt' database, based on the database type specified in the .env file. If you would like to retain the existing data, it is recommended to use a data migration tool to transfer the database table information to the 'dbgpt' database.
In version 0.4.0, the metadata module of the DB-GPT application has been refactored. All metadata tables will now be automatically saved in the 'dbgpt' database, based on the database type specified in the `.env` file. If you would like to retain the existing data, it is recommended to use a data migration tool to transfer the database table information to the 'dbgpt' database. Additionally, you can change the default database name 'dbgpt' in your `.env` file.
```{tip}
old database:knowledge_management;
@@ -89,5 +89,6 @@ LOCAL_DB_USER=root
LOCAL_DB_PASSWORD=aa12345678
LOCAL_DB_HOST=127.0.0.1
LOCAL_DB_PORT=3306
```
# You can change it to your actual metadata database name
LOCAL_DB_NAME=dbgpt
```

View File

@@ -1,6 +1,6 @@
LLM USE FAQ
==================================
##### Q1:how to use openai chatgpt service
##### Q1: how to use openai chatgpt service
change your LLM_MODEL in `.env`
````shell
LLM_MODEL=proxyllm
@@ -15,7 +15,7 @@ PROXY_SERVER_URL=https://api.openai.com/v1/chat/completions
make sure your openapi API_KEY is available
##### Q2 What difference between `python dbgpt_server --light` and `python dbgpt_server`
##### Q2: What difference between `python dbgpt_server --light` and `python dbgpt_server`
```{note}
* `python dbgpt_server --light` dbgpt_server does not start the llm service. Users can deploy the llm service separately by using `python llmserver`, and dbgpt_server accesses the llm service through set the LLM_SERVER environment variable in .env. The purpose is to allow for the separate deployment of dbgpt's backend service and llm service.
@@ -35,7 +35,7 @@ python pilot/server/dbgpt_server.py --light
```
##### Q3 How to use MultiGPUs
##### Q3: How to use MultiGPUs
DB-GPT will use all available gpu by default. And you can modify the setting `CUDA_VISIBLE_DEVICES=0,1` in `.env` file
to use the specific gpu IDs.
@@ -52,7 +52,7 @@ CUDA_VISIBLE_DEVICES=3,4,5,6 python3 pilot/server/dbgpt_server.py
You can modify the setting `MAX_GPU_MEMORY=xxGib` in `.env` file to configure the maximum memory used by each GPU.
##### Q4 Not Enough Memory
##### Q4: Not Enough Memory
DB-GPT supported 8-bit quantization and 4-bit quantization.
@@ -60,9 +60,9 @@ You can modify the setting `QUANTIZE_8bit=True` or `QUANTIZE_4bit=True` in `.env
Llama-2-70b with 8-bit quantization can run with 80 GB of VRAM, and 4-bit quantization can run with 48 GB of VRAM.
Note: you need to install the latest dependencies according to [requirements.txt](https://github.com/eosphoros-ai/DB-GPT/blob/main/requirements.txt).
Note: you need to install the quantization dependencies with `pip install -e ".[quantization]"`
##### Q5 How to Add LLM Service dynamic local mode
##### Q5: How to Add LLM Service dynamic local mode
Now DB-GPT through multi-llm service switch, so how to add llm service dynamic,
@@ -75,7 +75,7 @@ eg: dbgpt model start --model_name chatglm2-6b --model_path /root/DB-GPT/models/
chatgpt
eg: dbgpt model start --model_name chatgpt_proxyllm --model_path chatgpt_proxyllm --proxy_api_key ${OPENAI_KEY} --proxy_server_url {OPENAI_URL}
```
##### Q6 How to Add LLM Service dynamic in remote mode
##### Q6: How to Add LLM Service dynamic in remote mode
If you deploy llm service in remote machine instance, and you want to add model service to dbgpt server to manage
use dbgpt start worker and set --controller_addr.
@@ -88,13 +88,13 @@ eg: dbgpt start worker --model_name vicuna-13b-v1.5 \
```
##### Q7 dbgpt command not found
##### Q7: dbgpt command not found
```commandline
pip install -e "pip install -e ".[default]"
```
##### Q8 When starting the worker_manager on a cloud server and registering it with the controller, it is noticed that the worker's exposed IP is a private IP instead of a public IP, which leads to the inability to access the service.
##### Q8: When starting the worker_manager on a cloud server and registering it with the controller, it is noticed that the worker's exposed IP is a private IP instead of a public IP, which leads to the inability to access the service.
```commandline
@@ -103,4 +103,14 @@ pip install -e "pip install -e ".[default]"
automatically determined
```
##### Q9: How to customize model path and prompt template
DB-GPT will read the model path from `pilot.configs.model_config.LLM_MODEL_CONFIG` based on the `LLM_MODEL`.
Of course, you can use the environment variable `LLM_MODEL_PATH` to specify the model path and `LLM_PROMPT_TEMPLATE` to specify your model prompt template.
```
LLM_MODEL=vicuna-13b-v1.5
LLM_MODEL_PATH=/app/models/vicuna-13b-v1.5
# LLM_PROMPT_TEMPLATE=vicuna_v1.1
```

View File

@@ -18,7 +18,7 @@ DB-GPT product is a Web application that you can chat database, chat knowledge,
:name: deploy
:hidden:
./install/deploy/deploy.md
./install/deploy.rst
./install/docker/docker.md
./install/docker_compose/docker_compose.md
./install/cluster/cluster.rst

View File

@@ -77,3 +77,4 @@ By analyzing this information, we can identify performance bottlenecks in model
./vms/standalone.md
./vms/index.md
./openai.md

View File

@@ -0,0 +1,51 @@
OpenAI-Compatible RESTful APIs
==================================
(openai-apis-index)=
### Install Prepare
You must [deploy DB-GPT cluster](https://db-gpt.readthedocs.io/en/latest/getting_started/install/cluster/vms/index.html) first.
### Launch Model API Server
```bash
dbgpt start apiserver --controller_addr http://127.0.0.1:8000 --api_keys EMPTY
```
By default, the Model API Server starts on port 8100.
### Validate with cURL
#### List models
```bash
curl http://127.0.0.1:8100/api/v1/models \
-H "Authorization: Bearer EMPTY" \
-H "Content-Type: application/json"
```
#### Chat completions
```bash
curl http://127.0.0.1:8100/api/v1/chat/completions \
-H "Authorization: Bearer EMPTY" \
-H "Content-Type: application/json" \
-d '{"model": "vicuna-13b-v1.5", "messages": [{"role": "user", "content": "hello"}]}'
```
### Validate with OpenAI Official SDK
#### Chat completions
```python
import openai
openai.api_key = "EMPTY"
openai.api_base = "http://127.0.0.1:8100/api/v1"
model = "vicuna-13b-v1.5"
completion = openai.ChatCompletion.create(
model=model,
messages=[{"role": "user", "content": "hello"}]
)
# print the completion
print(completion.choices[0].message.content)
```

View File

@@ -0,0 +1,425 @@
.. _installation:
Installation From Source
==============
To get started, install DB-GPT with the following steps.
1.Preparation
-----------------
**Download DB-GPT**
.. code-block:: shell
git clone https://github.com/eosphoros-ai/DB-GPT.git
**Install Miniconda**
We use Sqlite as default database, so there is no need for database installation. If you choose to connect to other databases, you can follow our tutorial for installation and configuration.
For the entire installation process of DB-GPT, we use the miniconda3 virtual environment. Create a virtual environment and install the Python dependencies.
`How to install Miniconda <https://docs.conda.io/en/latest/miniconda.html>`_
.. code-block:: shell
python>=3.10
conda create -n dbgpt_env python=3.10
conda activate dbgpt_env
# it will take some minutes
pip install -e ".[default]"
.. code-block:: shell
cp .env.template .env
2.Deploy LLM Service
-----------------
DB-GPT can be deployed on servers with low hardware requirements or on servers with high hardware requirements.
If you are low hardware requirements you can install DB-GPT by Using third-part LLM REST API Service OpenAI, Azure, tongyi.
.. tip::
As our project has the ability to achieve OpenAI performance of over 85%,
.. note::
Notice make sure you have install git-lfs
centos:yum install git-lfs
ubuntu:apt-get install git-lfs
macos:brew install git-lfs
.. tabs::
.. tab:: OpenAI
Installing Dependencies
.. code-block::
pip install -e ".[openai]"
Download embedding model
.. code-block:: shell
cd DB-GPT
mkdir models and cd models
#### embedding model
git clone https://huggingface.co/GanymedeNil/text2vec-large-chinese
or
git clone https://huggingface.co/moka-ai/m3e-large
Configure LLM_MODEL, PROXY_API_URL and API_KEY in `.env` file
.. code-block:: shell
LLM_MODEL=chatgpt_proxyllm
PROXY_API_KEY={your-openai-sk}
PROXY_SERVER_URL=https://api.openai.com/v1/chat/completions
.. tip::
Make sure your .env configuration is not overwritten
.. tab:: Vicuna
`Vicuna-v1.5 <https://huggingface.co/lmsys/vicuna-13b-v1.5>`_ based on llama-2 has been released, we recommend you set `LLM_MODEL=vicuna-13b-v1.5` to try this model)
.. list-table:: vicuna-v1.5 hardware requirements
:widths: 50 50 50
:header-rows: 1
* - Model
- Quantize
- VRAM Size
* - vicuna-7b-v1.5
- 4-bit
- 8 GB
* - vicuna-7b-v1.5
- 8-bit
- 12 GB
* - vicuna-13b-v1.5
- 4-bit
- 12 GB
* - vicuna-13b-v1.5
- 8-bit
- 20 GB
.. code-block:: shell
cd DB-GPT
mkdir models and cd models
#### embedding model
git clone https://huggingface.co/GanymedeNil/text2vec-large-chinese
or
git clone https://huggingface.co/moka-ai/m3e-large
#### llm model, if you use openai or Azure or tongyi llm api service, you don't need to download llm model
git clone https://huggingface.co/lmsys/vicuna-13b-v1.5
The model files are large and will take a long time to download.
**Configure LLM_MODEL in `.env` file**
.. code-block:: shell
LLM_MODEL=vicuna-13b-v1.5
.. tab:: Baichuan
.. list-table:: Baichuan hardware requirements
:widths: 50 50 50
:header-rows: 1
* - Model
- Quantize
- VRAM Size
* - baichuan-7b
- 4-bit
- 8 GB
* - baichuan-7b
- 8-bit
- 12 GB
* - baichuan-13b
- 4-bit
- 12 GB
* - baichuan-13b
- 8-bit
- 20 GB
.. code-block:: shell
cd DB-GPT
mkdir models and cd models
#### embedding model
git clone https://huggingface.co/GanymedeNil/text2vec-large-chinese
or
git clone https://huggingface.co/moka-ai/m3e-large
#### llm model
git clone https://huggingface.co/baichuan-inc/Baichuan2-7B-Chat
or
git clone https://huggingface.co/baichuan-inc/Baichuan2-13B-Chat
The model files are large and will take a long time to download.
**Configure LLM_MODEL in `.env` file**
please rename Baichuan path to "baichuan2-13b" or "baichuan2-7b"
.. code-block:: shell
LLM_MODEL=baichuan2-13b
.. tab:: ChatGLM
.. code-block:: shell
cd DB-GPT
mkdir models and cd models
#### embedding model
git clone https://huggingface.co/GanymedeNil/text2vec-large-chinese
or
git clone https://huggingface.co/moka-ai/m3e-large
#### llm model
git clone https://huggingface.co/THUDM/chatglm2-6b
The model files are large and will take a long time to download.
**Configure LLM_MODEL in `.env` file**
please rename chatglm model path to "chatglm2-6b"
.. code-block:: shell
LLM_MODEL=chatglm2-6b
.. tab:: Other LLM API
Download embedding model
.. code-block:: shell
cd DB-GPT
mkdir models and cd models
#### embedding model
git clone https://huggingface.co/GanymedeNil/text2vec-large-chinese
or
git clone https://huggingface.co/moka-ai/m3e-large
Now DB-GPT support LLM REST API TYPE:
.. note::
* OpenAI
* Azure
* Aliyun tongyi
* Baidu wenxin
* Zhipu
* Baichuan
* Bard
Configure LLM_MODEL and PROXY_API_URL and API_KEY in `.env` file
.. code-block:: shell
#OpenAI
LLM_MODEL=chatgpt_proxyllm
PROXY_API_KEY={your-openai-sk}
PROXY_SERVER_URL=https://api.openai.com/v1/chat/completions
#Azure
LLM_MODEL=chatgpt_proxyllm
PROXY_API_KEY={your-azure-sk}
PROXY_API_BASE=https://{your domain}.openai.azure.com/
PROXY_API_TYPE=azure
PROXY_SERVER_URL=xxxx
PROXY_API_VERSION=2023-05-15
PROXYLLM_BACKEND=gpt-35-turbo
#Aliyun tongyi
LLM_MODEL=tongyi_proxyllm
TONGYI_PROXY_API_KEY={your-tongyi-sk}
PROXY_SERVER_URL={your_service_url}
## Baidu wenxin
LLM_MODEL=wenxin_proxyllm
PROXY_SERVER_URL={your_service_url}
WEN_XIN_MODEL_VERSION={version}
WEN_XIN_API_KEY={your-wenxin-sk}
WEN_XIN_SECRET_KEY={your-wenxin-sct}
## Zhipu
LLM_MODEL=zhipu_proxyllm
PROXY_SERVER_URL={your_service_url}
ZHIPU_MODEL_VERSION={version}
ZHIPU_PROXY_API_KEY={your-zhipu-sk}
## Baichuan
LLM_MODEL=bc_proxyllm
PROXY_SERVER_URL={your_service_url}
BAICHUN_MODEL_NAME={version}
BAICHUAN_PROXY_API_KEY={your-baichuan-sk}
BAICHUAN_PROXY_API_SECRET={your-baichuan-sct}
## bard
LLM_MODEL=bard_proxyllm
PROXY_SERVER_URL={your_service_url}
# from https://bard.google.com/ f12-> application-> __Secure-1PSID
BARD_PROXY_API_KEY={your-bard-token}
.. tip::
Make sure your .env configuration is not overwritten
.. tab:: llama.cpp
DB-GPT already supports `llama.cpp <https://github.com/ggerganov/llama.cpp>`_ via `llama-cpp-python <https://github.com/abetlen/llama-cpp-python>`_ .
**Preparing Model Files**
To use llama.cpp, you need to prepare a gguf format model file, and there are two common ways to obtain it, you can choose either:
**1. Download a pre-converted model file.**
Suppose you want to use `Vicuna 13B v1.5 <https://huggingface.co/lmsys/vicuna-13b-v1.5>`_ , you can download the file already converted from `TheBloke/vicuna-13B-v1.5-GGUF <https://huggingface.co/TheBloke/vicuna-13B-v1.5-GGUF>`_ , only one file is needed. Download it to the `models` directory and rename it to `ggml-model-q4_0.gguf`.
.. code-block::
wget https://huggingface.co/TheBloke/vicuna-13B-v1.5-GGUF/resolve/main/vicuna-13b-v1.5.Q4_K_M.gguf -O models/ggml-model-q4_0.gguf
**2. Convert It Yourself**
You can convert the model file yourself according to the instructions in `llama.cpp#prepare-data--run <https://github.com/ggerganov/llama.cpp#prepare-data--run>`_ , and put the converted file in the models directory and rename it to `ggml-model-q4_0.gguf`.
**Installing Dependencies**
llama.cpp is an optional dependency in DB-GPT, and you can manually install it using the following command:
.. code-block::
pip install -e ".[llama_cpp]"
**3.Modifying the Configuration File**
Next, you can directly modify your `.env` file to enable llama.cpp.
.. code-block::
LLM_MODEL=llama-cpp
llama_cpp_prompt_template=vicuna_v1.1
Then you can run it according to `Run <https://db-gpt.readthedocs.io/en/latest/getting_started/install/deploy/deploy.html#run>`_
**More Configurations**
In DB-GPT, the model configuration can be done through `{model name}_{config key}`.
.. list-table:: More Configurations
:widths: 50 50 50
:header-rows: 1
* - Environment Variable Key
- Default
- Description
* - llama_cpp_prompt_template
- None
- Prompt template name, now support: zero_shot, vicuna_v1.1,alpaca,llama-2,baichuan-chat,internlm-chat, If None, the prompt template is automatically determined from model path。
* - llama_cpp_model_path
- None
- Model path
* - llama_cpp_n_gpu_layers
- 1000000000
- Number of layers to offload to the GPU, Set this to 1000000000 to offload all layers to the GPU. If your GPU VRAM is not enough, you can set a low number, eg: 10
* - llama_cpp_n_threads
- None
- Number of threads to use. If None, the number of threads is automatically determined
* - llama_cpp_n_batch
- 512
- Maximum number of prompt tokens to batch together when calling llama_eval
* - llama_cpp_n_gqa
- None
- Grouped-query attention. Must be 8 for llama-2 70b.
* - llama_cpp_rms_norm_eps
- 5e-06
- 5e-6 is a good value for llama-2 models.
* - llama_cpp_cache_capacity
- None
- Maximum cache capacity. Examples: 2000MiB, 2GiB
* - llama_cpp_prefer_cpu
- False
- If a GPU is available, it will be preferred by default, unless prefer_cpu=False is configured.
.. tab:: vllm
vLLM is a fast and easy-to-use library for LLM inference and serving.
**Running vLLM**
**1.Installing Dependencies**
vLLM is an optional dependency in DB-GPT, and you can manually install it using the following command:
.. code-block::
pip install -e ".[vllm]"
**2.Modifying the Configuration File**
Next, you can directly modify your .env file to enable vllm.
.. code-block::
LLM_MODEL=vicuna-13b-v1.5
MODEL_TYPE=vllm
You can view the models supported by vLLM `here <https://vllm.readthedocs.io/en/latest/models/supported_models.html#supported-models>`_
Then you can run it according to `Run <https://db-gpt.readthedocs.io/en/latest/getting_started/install/deploy/deploy.html#run>`_
3.Prepare sql example(Optional)
-----------------
**(Optional) load examples into SQLite**
.. code-block:: shell
bash ./scripts/examples/load_examples.sh
On windows platform:
.. code-block:: shell
.\scripts\examples\load_examples.bat
4.Run db-gpt server
-----------------
.. code-block:: shell
python pilot/server/dbgpt_server.py
**Open http://localhost:5000 with your browser to see the product.**

View File

@@ -77,7 +77,7 @@ macos:brew install git-lfs
```
##### Download LLM Model and Embedding Model
If you use OpenAI llm service, see [LLM Use FAQ](https://db-gpt.readthedocs.io/en/latest/getting_started/faq/llm/llm_faq.html)
If you use OpenAI llm service, see [How to Use LLM REST API](https://db-gpt.readthedocs.io/en/latest/getting_started/install/llm/proxyllm/proxyllm.html)
```{tip}
If you use openai or Axzure or tongyi llm api service, you don't need to download llm model.

View File

@@ -6,7 +6,9 @@ LLM Model Name, see /pilot/configs/model_config.LLM_MODEL_CONFIG
* LLM_MODEL=vicuna-13b
MODEL_SERVER_ADDRESS
* MODEL_SERVER=http://127.0.0.1:8000
LIMIT_MODEL_CONCURRENCY
* LIMIT_MODEL_CONCURRENCY=5
@@ -59,11 +61,11 @@ Embedding Chunk size, default 500
Embedding Chunk Overlap, default 100
* KNOWLEDGE_CHUNK_OVERLAP=100
embeding recall top k,5
embedding recall top k,5
* KNOWLEDGE_SEARCH_TOP_SIZE=5
embeding recall max token ,2000
embedding recall max token ,2000
* KNOWLEDGE_SEARCH_MAX_TOKEN=5
```
@@ -84,21 +86,6 @@ embeding recall max token ,2000
* WEAVIATE_URL=https://kt-region-m8hcy0wc.weaviate.network
```
```{admonition} Vector Store SETTINGS
#### Chroma
* VECTOR_STORE_TYPE=Chroma
#### MILVUS
* VECTOR_STORE_TYPE=Milvus
* MILVUS_URL=127.0.0.1
* MILVUS_PORT=19530
* MILVUS_USERNAME
* MILVUS_PASSWORD
* MILVUS_SECURE=
#### WEAVIATE
* WEAVIATE_URL=https://kt-region-m8hcy0wc.weaviate.network
```
```{admonition} Multi-GPU Setting
See https://developer.nvidia.com/blog/cuda-pro-tip-control-gpu-visibility-cuda_visible_devices/
If CUDA_VISIBLE_DEVICES is not configured, all available gpus will be used

View File

@@ -28,6 +28,7 @@ Multi LLMs Support, Supports multiple large language models, currently supportin
:name: llama_cpp
:hidden:
./proxyllm/proxyllm.md
./llama/llama_cpp.md
./quantization/quantization.md
./vllm/vllm.md

View File

@@ -0,0 +1,78 @@
Proxy LLM API
==================================
Now DB-GPT supports connect LLM service through proxy rest api.
LLM rest api now supports
```{note}
* OpenAI
* Azure
* Aliyun tongyi
* Baidu wenxin
* Zhipu
* Baichuan
* Bard
```
### How to Integrate LLM rest API, like OpenAI, Azure, tongyi, wenxin llm api service?
update your `.env` file
```commandline
#OpenAI
LLM_MODEL=chatgpt_proxyllm
PROXY_API_KEY={your-openai-sk}
PROXY_SERVER_URL=https://api.openai.com/v1/chat/completions
#Azure
LLM_MODEL=chatgpt_proxyllm
PROXY_API_KEY={your-azure-sk}
PROXY_API_BASE=https://{your domain}.openai.azure.com/
PROXY_API_TYPE=azure
PROXY_SERVER_URL=xxxx
PROXY_API_VERSION=2023-05-15
PROXYLLM_BACKEND=gpt-35-turbo
#Aliyun tongyi
LLM_MODEL=tongyi_proxyllm
TONGYI_PROXY_API_KEY={your-tongyi-sk}
PROXY_SERVER_URL={your_service_url}
## Baidu wenxin
LLM_MODEL=wenxin_proxyllm
PROXY_SERVER_URL={your_service_url}
WEN_XIN_MODEL_VERSION={version}
WEN_XIN_API_KEY={your-wenxin-sk}
WEN_XIN_SECRET_KEY={your-wenxin-sct}
## Zhipu
LLM_MODEL=zhipu_proxyllm
PROXY_SERVER_URL={your_service_url}
ZHIPU_MODEL_VERSION={version}
ZHIPU_PROXY_API_KEY={your-zhipu-sk}
## Baichuan
LLM_MODEL=bc_proxyllm
PROXY_SERVER_URL={your_service_url}
BAICHUN_MODEL_NAME={version}
BAICHUAN_PROXY_API_KEY={your-baichuan-sk}
BAICHUAN_PROXY_API_SECRET={your-baichuan-sct}
## bard
LLM_MODEL=bard_proxyllm
PROXY_SERVER_URL={your_service_url}
# from https://bard.google.com/ f12-> application-> __Secure-1PSID
BARD_PROXY_API_KEY={your-bard-token}
```
```{tip}
Make sure your .env configuration is not overwritten
```
### How to Integrate Embedding rest API, like OpenAI, Azure api service?
```commandline
## Openai embedding model, See /pilot/model/parameter.py
EMBEDDING_MODEL=proxy_openai
proxy_openai_proxy_server_url=https://api.openai.com/v1
proxy_openai_proxy_api_key={your-openai-sk}
proxy_openai_proxy_backend=text-embedding-ada-002
```

View File

@@ -3,48 +3,58 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to DB-GPT!
==================================
| As large models are released and iterated upon, they are becoming increasingly intelligent. However, in the process of using large models, we face significant challenges in data security and privacy. We need to ensure that our sensitive data and environments remain completely controlled and avoid any data privacy leaks or security risks. Based on this, we have launched the DB-GPT project to build a complete private large model solution for all database-based scenarios. This solution supports local deployment, allowing it to be applied not only in independent private environments but also to be independently deployed and isolated according to business modules, ensuring that the ability of large models is absolutely private, secure, and controllable.
Overview
------------------
| **DB-GPT** is an experimental open-source project that uses localized GPT large models to interact with your data and environment. With this solution, you can be assured that there is no risk of data leakage, and your data is 100% private and secure.
| DB-GPT is an open-source framework for large models in the databases fields. It's purpose is to build infrastructure for the domain of large models, making it easier and more convenient to develop applications around databases. By developing various technical capabilities such as:
| **Features**
Currently, we have released multiple key features, which are listed below to demonstrate our current capabilities:
1. **SMMF(Service-oriented Multi-model Management Framework)**
2. **Text2SQL Fine-tuning**
3. **RAG(Retrieval Augmented Generation) framework and optimization**
4. **Data-Driven Agents framework collaboration**
5. **GBI(Generative Business intelligence)**
- SQL language capabilities
- SQL generation
- SQL diagnosis
etc, DB-GPT simplifies the construction of large model applications based on databases.
- Private domain Q&A and data processing
- Database knowledge Q&A
- Data processing
| In the era of Data 3.0, enterprises and developers can build their own customized applications with less code, leveraging models and databases.
- Plugins
- Support custom plugin execution tasks and natively support the Auto-GPT plugin, such as:
Features
^^^^^^^^^^^
- Unified vector storage/indexing of knowledge base
- Support for unstructured data such as PDF, Markdown, CSV, and WebURL
| **1. Private Domain Q&A & Data Processing**
| Supports custom construction of knowledge bases through methods such as built-in, multi-file format uploads, and plugin-based web scraping. Enables unified vector storage and retrieval of massive structured and unstructured data.
| **2.Multi-Data Source & GBI(Generative Business intelligence)**
| Supports interaction between natural language and various data sources such as Excel, databases, and data warehouses. Also supports analysis reporting.
| **3.SMMF(Service-oriented Multi-model Management Framework)**
| Supports a wide range of models, including dozens of large language models such as open-source models and API proxies. Examples include LLaMA/LLaMA2, Baichuan, ChatGLM, Wenxin, Tongyi, Zhipu, Xinghuo, etc.
| **4.Automated Fine-tuning**
| A lightweight framework for automated fine-tuning built around large language models, Text2SQL datasets, and methods like LoRA/QLoRA/Pturning. Makes TextSQL fine-tuning as convenient as a production line.
| **5.Data-Driven Multi-Agents & Plugins**
| Supports executing tasks through custom plugins and natively supports the Auto-GPT plugin model. Agents protocol follows the Agent Protocol standard.
| **6.Privacy and Security**
| Ensures data privacy and security through techniques such as privatizing large models and proxy de-identification.
- Multi LLMs Support
- Supports multiple large language models, currently supporting Vicuna (7b, 13b), ChatGLM-6b (int4, int8)
- TODO: codegen2, codet5p
Getting Started
-----------------
| How to get started using DB-GPT to interact with your data and environment.
- `Quickstart Guide <./getting_started/getting_started.html>`_
^^^^^^^^^^^^^^^^^
| Quickstart
- `Quickstart Guide <./getting_started/getting_started.html>`_
| Concepts and terminology
- `Concepts and Terminology <./getting_started/concepts.html>`_
| Coming soon...
- `Tutorials <.getting_started/tutorials.html>`_
.. toctree::
:maxdepth: 2
:caption: Getting Started
:name: getting_started
:hidden:
getting_started/install.rst
@@ -57,10 +67,9 @@ Getting Started
Modules
---------
^^^^^^^^^
| These modules are the core abstractions with which we can interact with data and environment smoothly.
It's very important for DB-GPT, DB-GPT also provide standard, extendable interfaces.
| These modules are the core abstractions with which we can interact with data and environment smoothly. It's very important for DB-GPT, DB-GPT also provide standard, extendable interfaces.
| The docs for each module contain quickstart examples, how to guides, reference docs, and conceptual guides.
@@ -78,64 +87,23 @@ It's very important for DB-GPT, DB-GPT also provide standard, extendable interfa
- `Vector <./modules/vector.html>`_: Supported multi vector database.
-------------
.. toctree::
:maxdepth: 2
:caption: Modules
:name: modules
:hidden:
./modules/llms.md
./modules/prompts.md
./modules/plugins.md
./modules/connections.rst
./modules/knowledge.rst
./modules/vector.rst
Use Cases
---------
| Best Practices and built-in implementations for common DB-GPT use cases:
- `Sql generation and diagnosis <./use_cases/sql_generation_and_diagnosis.html>`_: SQL generation and diagnosis.
- `knownledge Based QA <./use_cases/knownledge_based_qa.html>`_: A important scene for user to chat with database documents, codes, bugs and schemas.
- `Chatbots <./use_cases/chatbots.html>`_: Language model love to chat, use multi models to chat.
- `Querying Database Data <./use_cases/query_database_data.html>`_: Query and Analysis data from databases and give charts.
- `Interacting with apis <./use_cases/interacting_with_api.html>`_: Interact with apis, such as create a table, deploy a database cluster, create a database and so on.
- `Tool use with plugins <./use_cases/tool_use_with_plugin>`_: According to Plugin use tools to manage databases autonomoly.
.. toctree::
:maxdepth: 2
:caption: Use Cases
:name: use_cases
:hidden:
./use_cases/sql_generation_and_diagnosis.md
./use_cases/knownledge_based_qa.md
./use_cases/chatbots.md
./use_cases/query_database_data.md
./use_cases/interacting_with_api.md
./use_cases/tool_use_with_plugin.md
Reference
-----------
| Full documentation on all methods, classes, installation methods, and integration setups for DB-GPT.
.. toctree::
:maxdepth: 1
:caption: Reference
:name: reference
:hidden:
./reference.md
modules/llms.md
modules/prompts.md
modules/plugins.md
modules/connections.rst
modules/knowledge.rst
modules/vector.rst
Resources
----------
-----------------
| Additional resources we think may be useful as you develop your application!

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 👏👏 0.3.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-26 17:51+0800\n"
"POT-Creation-Date: 2023-11-03 15:33+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
@@ -20,12 +20,12 @@ msgstr ""
"Generated-By: Babel 2.12.1\n"
#: ../../getting_started/application/chatdb/chatdb.md:1
#: 0cf45852c1fd430090da81836bc961c7
#: c1489293ce464cee9577b0aa9a3f3037
msgid "ChatData & ChatDB"
msgstr "ChatData & ChatDB"
#: ../../getting_started/application/chatdb/chatdb.md:3
#: 6dc94a787ff844caa21074d71aaf351a
#: 2c421938f270427dbd0ffff892b1a5a1
#, fuzzy
msgid ""
"ChatData generates SQL from natural language and executes it. ChatDB "
@@ -38,47 +38,68 @@ msgstr ""
"plugins demonstration](../../../../assets/chat_data/chat_data.jpg)"
#: ../../getting_started/application/chatdb/chatdb.md:3
#: ../../getting_started/application/chatdb/chatdb.md:20
#: ../../getting_started/application/chatdb/chatdb.md:24
#: ../../getting_started/application/chatdb/chatdb.md:28
#: ../../getting_started/application/chatdb/chatdb.md:43
#: ../../getting_started/application/chatdb/chatdb.md:48
#: ../../getting_started/application/chatdb/chatdb.md:26
#: ../../getting_started/application/chatdb/chatdb.md:30
#: ../../getting_started/application/chatdb/chatdb.md:34
#: ../../getting_started/application/chatdb/chatdb.md:49
#: ../../getting_started/application/chatdb/chatdb.md:54
#: 826032e82a0a40b2bd122a90a35d0161 91652ef9e3224290b0c89112bcca4474
#: d396ffa33eef4bef8471040369414420 d7f176a7794048d3ac3573970db86d9d
#: f80e5611eca64f86baeeed6c860061f9
#: ../../getting_started/application/chatdb/chatdb.md:60
#: 1467691a6012498795a94a14f7eba307 32315140835948c58e1721c7e2fa88a9
#: 3b8e3c3396ff47348105a6dec9e755ba a314854e9be945dd88ad241bfa340870
#: d94d5f0e608f4399a0e10d593f0ab1da e0ca6ec1841040bc828ce2ef29c387b6
msgid "db plugins demonstration"
msgstr "db plugins demonstration"
#: ../../getting_started/application/chatdb/chatdb.md:7
#: aa0f978d3ad34b71aacf143a4c807ba1
#: 67cb0954cfa54e629b75cf9a241f6b9d
#, fuzzy
msgid "The LLM (Language Model) suitable for the ChatData scene is"
msgstr "ChatData场景适用的LLM * chatgpt3.5. * chatgpt4. * Vicuna-v1.5."
#: ../../getting_started/application/chatdb/chatdb.md:8
#: c973e19574e2405a96eb003c64063bfc
msgid "chatgpt3.5."
msgstr ""
#: ../../getting_started/application/chatdb/chatdb.md:9
#: 649b2382378c416591db7038a269c33b
msgid "chatgpt4."
msgstr ""
#: ../../getting_started/application/chatdb/chatdb.md:10
#: fac49de88fe3409f818193b953714cb9
msgid "Vicuna-v1.5."
msgstr ""
#: ../../getting_started/application/chatdb/chatdb.md:13
#: 8bd004993a834b0797ebcb5b6a6b1a23
msgid "1.Choose Datasource"
msgstr "1.Choose Datasource"
#: ../../getting_started/application/chatdb/chatdb.md:9
#: 8a2338e2fbae44f1b61b2fcf062499d3
#: ../../getting_started/application/chatdb/chatdb.md:15
#: 34abfdced7804b51a212c0e567ffda6b
msgid ""
"If you are using DB-GPT for the first time, you need to add a data source"
" and set the relevant connection information for the data source."
msgstr "如果你是第一次使用DB-GPT, 首先需要添加数据源,设置数据源的相关连接信息"
#: ../../getting_started/application/chatdb/chatdb.md:13
#: f1d165ab8b564445880e581a2e554434
#: ../../getting_started/application/chatdb/chatdb.md:19
#: 3a8d16a8a32c4ac5affbd8093677b4f8
msgid "there are some example data in DB-GPT-NEW/DB-GPT/docker/examples"
msgstr "在DB-GPT-NEW/DB-GPT/docker/examples有数据示例"
#: ../../getting_started/application/chatdb/chatdb.md:15
#: dd390cb518094c96bf5430bfa821830f
#: ../../getting_started/application/chatdb/chatdb.md:21
#: 2c3333a2705648148f79623c220d90cd
msgid "you can execute sql script to generate data."
msgstr "你可以通过执行sql脚本生成测试数据"
#: ../../getting_started/application/chatdb/chatdb.md:18
#: aebd974d23124daa80af6d74431d1ce3
#: ../../getting_started/application/chatdb/chatdb.md:24
#: 4994182137574d14a3eefb421ceccd8e
msgid "1.1 Datasource management"
msgstr "1.1 Datasource management"
#: ../../getting_started/application/chatdb/chatdb.md:20
#: af4d12aaed5c4fc484a3e7a755a666c2
#: ../../getting_started/application/chatdb/chatdb.md:26
#: 94680e1487d84092abc51a7da9bf1075
msgid ""
"![db plugins demonstration](https://github.com/eosphoros-ai/DB-"
"GPT/assets/13723926/7678f07e-9eee-40a9-b980-5b3978a0ed52)"
@@ -86,13 +107,13 @@ msgstr ""
"![db plugins demonstration](https://github.com/eosphoros-ai/DB-"
"GPT/assets/13723926/7678f07e-9eee-40a9-b980-5b3978a0ed52)"
#: ../../getting_started/application/chatdb/chatdb.md:22
#: 34b7b9ce0f0142af8179a8e1763a32f8
#: ../../getting_started/application/chatdb/chatdb.md:28
#: 236dbd6d6cb4467593bf30597ecb215c
msgid "1.2 Connection management"
msgstr "1.2 Connection管理"
#: ../../getting_started/application/chatdb/chatdb.md:24
#: 00a1af9f4e0a45b9a398f641c8198114
#: ../../getting_started/application/chatdb/chatdb.md:30
#: 6611193e600c4452ac8a9769c6230590
msgid ""
"![db plugins demonstration](https://github.com/eosphoros-ai/DB-"
"GPT/assets/13723926/25b8f5a9-d322-459e-a8b2-bfe8cb42bdd6)"
@@ -100,13 +121,13 @@ msgstr ""
"![db plugins demonstration](https://github.com/eosphoros-ai/DB-"
"GPT/assets/13723926/25b8f5a9-d322-459e-a8b2-bfe8cb42bdd6)"
#: ../../getting_started/application/chatdb/chatdb.md:26
#: 3b8efc25b482480b8d0f4afe5304ece0
#: ../../getting_started/application/chatdb/chatdb.md:32
#: 7cceb9703af54970bee4a50fb07d4509
msgid "1.3 Add Datasource"
msgstr "1.3 添加Datasource"
#: ../../getting_started/application/chatdb/chatdb.md:28
#: d36a476e1eb34a46b2d35e6c1c4c39dd
#: ../../getting_started/application/chatdb/chatdb.md:34
#: 83c9e18cb87b4f0d9b0ce5e68b7fea77
msgid ""
"![db plugins demonstration](https://github.com/eosphoros-ai/DB-"
"GPT/assets/13723926/19ce31a7-4061-4da8-a9cb-efca396cc085)"
@@ -114,54 +135,54 @@ msgstr ""
"![db plugins demonstration](https://github.com/eosphoros-ai/DB-"
"GPT/assets/13723926/19ce31a7-4061-4da8-a9cb-efca396cc085)"
#: ../../getting_started/application/chatdb/chatdb.md:31
#: 9205388f91404099bf1add6d55f33801
#: ../../getting_started/application/chatdb/chatdb.md:37
#: 143fb04274cd486687c5766179f6103e
msgid "now DB-GPT support Datasource Type"
msgstr "DB-GPT支持数据源类型"
#: ../../getting_started/application/chatdb/chatdb.md:33
#: 197722ccd9e54f8196e3037f0ebd4165
#: ../../getting_started/application/chatdb/chatdb.md:39
#: 8bcf83e66b2d4d858407fc2b21b8fe85
msgid "Mysql"
msgstr "Mysql"
#: ../../getting_started/application/chatdb/chatdb.md:34
#: e859c194648440b19941a42635f37ac5
#: ../../getting_started/application/chatdb/chatdb.md:40
#: cd74abd5d6f4410ca001a3de2685e768
msgid "Sqlite"
msgstr "Sqlite"
#: ../../getting_started/application/chatdb/chatdb.md:35
#: 91c695f437064f01bf1d7c85a0ecf5b4
#: ../../getting_started/application/chatdb/chatdb.md:41
#: fc5e01baba43449f8c3eb9b4b36a0ed8
msgid "DuckDB"
msgstr "DuckDB"
#: ../../getting_started/application/chatdb/chatdb.md:36
#: 0a8ff591969c4944890415a84aa64173
#: ../../getting_started/application/chatdb/chatdb.md:42
#: 10b6fe2153cd4ceba949687a54c3a68c
msgid "Clickhouse"
msgstr "Clickhouse"
#: ../../getting_started/application/chatdb/chatdb.md:37
#: d52ec849653141dc95862e82ce5777e0
#: ../../getting_started/application/chatdb/chatdb.md:43
#: 9ce0a41784f041d39138a81099c386e9
#, fuzzy
msgid "Mssql"
msgstr "Mysql"
#: ../../getting_started/application/chatdb/chatdb.md:38
#: 430a72d857114422aeecd5595df41881
#: ../../getting_started/application/chatdb/chatdb.md:44
#: 4af6eb835e954e0d937e98b308fb512b
msgid "Spark"
msgstr "Spark"
#: ../../getting_started/application/chatdb/chatdb.md:41
#: b615a70971e7443291ba33e8bc12b437
#: ../../getting_started/application/chatdb/chatdb.md:47
#: 8aaa3a73090b4805b2dddf1cc355d83c
msgid "2.ChatData"
msgstr "2.ChatData"
#: ../../getting_started/application/chatdb/chatdb.md:42
#: e3542c64926143958e71c7cb21d25c78
#: ../../getting_started/application/chatdb/chatdb.md:48
#: a34c79c99bd34233ae92d3090ff0b877
msgid "Preview Mode"
msgstr "Preview Mode"
#: ../../getting_started/application/chatdb/chatdb.md:43
#: e32f26b7c22141e181b5345a644dffd5
#: ../../getting_started/application/chatdb/chatdb.md:49
#: 39e31a2a01494d4191d415a2240e026d
#, fuzzy
msgid ""
"After successfully setting up the data source, you can start conversing "
@@ -173,13 +194,13 @@ msgstr ""
"设置数据源成功后就可以和数据库进行对话了。你可以让它帮你生成SQL也可以和问它数据库元数据的相关信息。 ![db plugins "
"demonstration](../../../../assets/chat_data/chatdata_eg.png)"
#: ../../getting_started/application/chatdb/chatdb.md:47
#: 4d5c0465a01b4f5a964d0e803f9cbc89
#: ../../getting_started/application/chatdb/chatdb.md:53
#: 999c78e8b604493a8190b0e1258d0da4
msgid "Editor Mode"
msgstr "Editor Mode"
#: ../../getting_started/application/chatdb/chatdb.md:48
#: 79b088787e8f43258bcc4292c89ad1b0
#: ../../getting_started/application/chatdb/chatdb.md:54
#: e4a61d1e62c743f8b13dbed92ec265ba
msgid ""
"In Editor Mode, you can edit your sql and execute it. ![db plugins "
"demonstration](https://github.com/eosphoros-ai/DB-"
@@ -189,13 +210,13 @@ msgstr ""
"/eosphoros-ai/DB-"
"GPT/assets/13723926/1a896dc1-7c0e-4354-8629-30357ffd8d7f)"
#: ../../getting_started/application/chatdb/chatdb.md:52
#: 9efaf27749614cd4bea07146edddf558
#: ../../getting_started/application/chatdb/chatdb.md:58
#: b3a0d94083524d249f97dd426e1e1f26
msgid "3.ChatDB"
msgstr "3.ChatDB"
#: ../../getting_started/application/chatdb/chatdb.md:54
#: b2dc15f067064c60974e532c3e2f5893
#: ../../getting_started/application/chatdb/chatdb.md:60
#: 8f4bd453447f48019a597eb3e4a59875
msgid ""
"![db plugins demonstration](https://github.com/eosphoros-ai/DB-"
"GPT/assets/13723926/e04bc1b1-2c58-4b33-af62-97e89098ace7)"

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 👏👏 0.3.6\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 21:14+0800\n"
"POT-Creation-Date: 2023-11-03 15:33+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
@@ -20,13 +20,13 @@ msgstr ""
"Generated-By: Babel 2.12.1\n"
#: ../../getting_started/application/chatexcel/chatexcel.md:1
#: ../../getting_started/application/chatexcel/chatexcel.md:9
#: 6efcbf4652954b27beb55f600cfe75c7 eefb0c3bc131439fb2dd4045761f1ae9
#: ../../getting_started/application/chatexcel/chatexcel.md:14
#: 5e9c1de21de240839a510b9e05afcba1 96556d6d1d734f67ab15e548c9fdce2f
msgid "ChatExcel"
msgstr ""
#: ../../getting_started/application/chatexcel/chatexcel.md:3
#: 5fc4ddd2690f46658df1e09c601d81ad
#: 19590f67feea4f2580602538b79cd138
#, fuzzy
msgid ""
"![db plugins demonstration](https://github.com/eosphoros-ai/DB-"
@@ -36,61 +36,75 @@ msgid ""
msgstr "使用自然语言进行Excel数据的分析处理"
#: ../../getting_started/application/chatexcel/chatexcel.md:3
#: ../../getting_started/application/chatexcel/chatexcel.md:13
#: ../../getting_started/application/chatexcel/chatexcel.md:17
#: ../../getting_started/application/chatexcel/chatexcel.md:21
#: 4c91baf5f0b244abb021f461851674cc 4eead9a4f81e4855a5c362774696999c
#: 5f309a06170946108ae70806dff157ea 790016c9c68f4a29a84b7ef8e14d6dc2
#: 93db1eb6af69452982f6028eff626a57 e758c8b320894e2b93f8db78459b7a1f
#: ea3c99f7eafc4ae0a19706a47e4c7bf6 f18d2b88de244173ab2673f2a5e828c0
#: ../../getting_started/application/chatexcel/chatexcel.md:18
#: ../../getting_started/application/chatexcel/chatexcel.md:22
#: ../../getting_started/application/chatexcel/chatexcel.md:26
#: 286462d6d79b4189bcd9d17937a96233 7009abd113244cc5badb8e90837dc9af
#: 7eb17d02534d4f77b7602f3756da0d5e f5c1cfd0f77d4199a45988114174c67f
msgid "db plugins demonstration"
msgstr ""
#: ../../getting_started/application/chatexcel/chatexcel.md:6
#: 45f137031025409ba2ada9c8f7c5f1e4
#: 338f0b19314f4026b84a670d35056e6c
#, fuzzy
msgid "The LLM (Language Model) suitable for the ChatExcel scene is"
msgstr "ChatExcel场景适用的LLM 是 scene is * chatgpt3.5. * chatgpt4."
#: ../../getting_started/application/chatexcel/chatexcel.md:7
#: bc09e8af60b64a8fbeecedb927a5a854
msgid "chatgpt3.5."
msgstr ""
#: ../../getting_started/application/chatexcel/chatexcel.md:8
#: e840c31d671946c190e27e1b7dd28647
msgid "chatgpt4."
msgstr ""
#: ../../getting_started/application/chatexcel/chatexcel.md:11
#: 2a710e2650bb44ef9d4a1ee4b8225a35
msgid "1.Select And Upload Excel or CSV File"
msgstr ""
#: ../../getting_started/application/chatexcel/chatexcel.md:7
#: cd282be2b4ef49ea8b0eaa3d53042f22
#: ../../getting_started/application/chatexcel/chatexcel.md:12
#: df48b1003f3640cfa621e416f0405e8d
msgid "Select your excel or csv file to upload and start the conversation."
msgstr "选择你的Excel或者CSV文件上传开始对话"
#: ../../getting_started/application/chatexcel/chatexcel.md:11
#: a5ebc8643eff4b44a951b28d85488143
#: ../../getting_started/application/chatexcel/chatexcel.md:16
#: 7ef5d5ebb634406ea4b566bbf5e30fd7
msgid ""
"The ChatExcel function supports Excel and CSV format files, select the "
"corresponding file to use."
msgstr "ChatExcel功能支持Excel和CSV格式的文件选择对应格式的文件开始使用"
#: ../../getting_started/application/chatexcel/chatexcel.md:13
#: d52927be09654c8daf29e2ef0c60a671
#: ../../getting_started/application/chatexcel/chatexcel.md:18
#: 40c79b71820f44439b1f541db2be9dd9
msgid ""
"![db plugins "
"demonstration](../../../../assets/chat_excel/chat_excel_2.png) ![db "
"plugins demonstration](../../../../assets/chat_excel/chat_excel_3.png)"
msgstr ""
#: ../../getting_started/application/chatexcel/chatexcel.md:16
#: d86202165fdc4da6be06024b45f9af55
#: ../../getting_started/application/chatexcel/chatexcel.md:21
#: 0dd469b6f56a442485392346065e345d
msgid "2.Wait for Data Processing"
msgstr "等待数据处理"
#: ../../getting_started/application/chatexcel/chatexcel.md:17
#: 3de7205fbdc741e2b79996d67264c058
#: ../../getting_started/application/chatexcel/chatexcel.md:22
#: 0e9213342664465187981d6fea41e7ba
msgid ""
"After the data is uploaded, it will first learn and process the data "
"structure and field meaning. ![db plugins "
"demonstration](../../../../assets/chat_excel/chat_excel_4.png)"
msgstr "等待数据上传完成,会自动进行数据结构的学习和处理"
#: ../../getting_started/application/chatexcel/chatexcel.md:20
#: fb0620dec5a24b469ceccf86e918fe54
#: ../../getting_started/application/chatexcel/chatexcel.md:25
#: dd2047d1199542f7abda4767b953cfac
msgid "3.Use Data Analysis Calculation"
msgstr "开始使用数据分析计算"
#: ../../getting_started/application/chatexcel/chatexcel.md:21
#: 221733f01fe04e38b19f191d4001c7a7
#: ../../getting_started/application/chatexcel/chatexcel.md:26
#: 4e168def205743c898586e99e34d3e18
msgid ""
"Now you can use natural language to analyze and query data in the dialog "
"box. ![db plugins "

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 👏👏 0.3.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 20:50+0800\n"
"POT-Creation-Date: 2023-11-03 15:33+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
@@ -20,12 +20,12 @@ msgstr ""
"Generated-By: Babel 2.12.1\n"
#: ../../getting_started/application/dashboard/dashboard.md:1
#: 2a1224e675d144269e5cc3695d4d60b4
#: 3e4ef12c51894e5d93adcbf090a4783b
msgid "Dashboard"
msgstr "Dashboard"
#: ../../getting_started/application/dashboard/dashboard.md:3
#: 2b6d2f94f73d43e68806bf4c6d0d9269
#: df9eb8d62bbe460d94e448c23fffa529
msgid ""
"The purpose of the DB-GPT Dashboard is to empower data analysts with "
"efficiency. DB-GPT provides intelligent reporting technology, allowing "
@@ -33,38 +33,54 @@ msgid ""
" language and gain insights into their respective areas of business."
msgstr "DB-GPT Dashboard目的是赋能数据分析人员。DB-GPT通过提供智能报表技术使得业务分析人员可以直接使用简单的自然语言进行自助分析。"
#: ../../getting_started/application/dashboard/dashboard.md:7
#: 3ce90998ab9547fc95105f0000e232da
#, fuzzy
msgid "The LLM (Language Model) suitable for the Dashboard scene is"
msgstr "Dashboard场景适用的LLM是 * chatgpt3.5. * chatgpt4."
#: ../../getting_started/application/dashboard/dashboard.md:8
#: 9612fa76c4264bab8e629ac50959faa9
#: be8fe8f9d9344e64acf51e54f8a17d7c
msgid "chatgpt3.5."
msgstr ""
#: ../../getting_started/application/dashboard/dashboard.md:9
#: 82ef8f03db3f4741a92113a485a40599
msgid "chatgpt4."
msgstr ""
#: ../../getting_started/application/dashboard/dashboard.md:13
#: da3aaa82126942058e72c472e2495641
msgid "Dashboard now support Datasource Type"
msgstr "Dashboard目前支持的数据源类型"
#: ../../getting_started/application/dashboard/dashboard.md:9
#: bb0b15742ebe41628fb0d1fc38caabe2
#: ../../getting_started/application/dashboard/dashboard.md:14
#: d21cfc9594a24b69a5040f60cba00abb
msgid "Mysql"
msgstr "Mysql"
#: ../../getting_started/application/dashboard/dashboard.md:10
#: 35491581125b4bdd8422f35b11c7bc2c
#: ../../getting_started/application/dashboard/dashboard.md:15
#: fc0e345321e84de5b9a96107fef5467e
msgid "Sqlite"
msgstr "Sqlite"
#: ../../getting_started/application/dashboard/dashboard.md:11
#: 8c4389354e0344aa9a781bdfc94c2cac
#: ../../getting_started/application/dashboard/dashboard.md:16
#: f5cc4387997441b88a9f10ba9b35b621
msgid "DuckDB"
msgstr "DuckDB"
#: ../../getting_started/application/dashboard/dashboard.md:13
#: 18e8c60f5c2f4aa698cec1e8e8b354c8
#: ../../getting_started/application/dashboard/dashboard.md:18
#: d8a86c3d05f84df0aa63c88f5dbfbd78
msgid "Steps to Dashboard In DB-GPT"
msgstr "Dashboard使用步骤"
#: ../../getting_started/application/dashboard/dashboard.md:15
#: 94f98e0f5c2e451ba29b9b77c4139ed9
#: ../../getting_started/application/dashboard/dashboard.md:20
#: dbf7b3f73677411a8e660f8d90c11e05
msgid "1 add datasource"
msgstr "1.添加数据源"
#: ../../getting_started/application/dashboard/dashboard.md:17
#: 34e1211e65b940c3beb6234bcfa423a1
#: ../../getting_started/application/dashboard/dashboard.md:22
#: 70a599bc716a4af2b5a07a40de6fed9d
#, fuzzy
msgid ""
"If you are using Dashboard for the first time, you need to mock some data"
@@ -74,18 +90,18 @@ msgid ""
"8c36-213b1c6fb5dd)"
msgstr "如果你是第一次使用Dashboard需要构造测试数据DB-GPT在pilot/mock_datas/提供了测试数据,只需要将数据源进行添加即可"
#: ../../getting_started/application/dashboard/dashboard.md:17
#: f29905929b32442ba05833b6c52a11be
#: ../../getting_started/application/dashboard/dashboard.md:22
#: e38d15f091264563840cf15f0a2fe97c
msgid "add_datasource"
msgstr "添加数据源"
#: ../../getting_started/application/dashboard/dashboard.md:21
#: 367a487dd1d54681a6e83d8fdda5b793
#: ../../getting_started/application/dashboard/dashboard.md:26
#: c6e87a5b20bb439ab1b3dc88e764d20b
msgid "2.Choose Dashboard Mode"
msgstr "2.进入Dashboard"
#: ../../getting_started/application/dashboard/dashboard.md:23
#: 1ee1e980934e4a618591b7c43921c304
#: ../../getting_started/application/dashboard/dashboard.md:28
#: 54c25766650546998d3aaa3655f5275b
msgid ""
"![create_space](https://github.com/eosphoros-ai/DB-"
"GPT/assets/13723926/5e888880-0e97-4b60-8e5c-b7e7224197f0)"
@@ -93,18 +109,18 @@ msgstr ""
"![create_space](https://github.com/eosphoros-ai/DB-"
"GPT/assets/13723926/5e888880-0e97-4b60-8e5c-b7e7224197f0)"
#: ../../getting_started/application/dashboard/dashboard.md:23
#: 12c756afdad740a9afc9cb46cc834af8
#: ../../getting_started/application/dashboard/dashboard.md:28
#: ea1781528db04000ab4a72308c7be97e
msgid "create_space"
msgstr "create_space"
#: ../../getting_started/application/dashboard/dashboard.md:25
#: 5a575b17408c42fbacd32d8ff792d5a8
#: ../../getting_started/application/dashboard/dashboard.md:30
#: 5de9b0f0853443368d90e42114e99d6e
msgid "3.Select Datasource"
msgstr "3.选择数据源"
#: ../../getting_started/application/dashboard/dashboard.md:27
#: ae051f852a5a4044a147c853cc3fba60
#: ../../getting_started/application/dashboard/dashboard.md:32
#: 3d4c429c4660414a8d5c44dea0ea0192
msgid ""
"![document](https://github.com/eosphoros-ai/DB-"
"GPT/assets/13723926/da2ac8b5-eca4-48ef-938f-f9dc1ca711b3)"
@@ -112,19 +128,19 @@ msgstr ""
"![document](https://github.com/eosphoros-ai/DB-"
"GPT/assets/13723926/da2ac8b5-eca4-48ef-938f-f9dc1ca711b3)"
#: ../../getting_started/application/dashboard/dashboard.md:27
#: ../../getting_started/application/dashboard/dashboard.md:31
#: 94907bb0dc694bc3a4d2ee57a84b8242 ecc0666385904fce8bb1000735482f65
#: ../../getting_started/application/dashboard/dashboard.md:32
#: ../../getting_started/application/dashboard/dashboard.md:36
#: 338912391ae441328549accdb6d5522b
msgid "document"
msgstr "document"
#: ../../getting_started/application/dashboard/dashboard.md:29
#: c8697e93661c48b19674e63094ba7486
#: ../../getting_started/application/dashboard/dashboard.md:34
#: 2c0fd7e79393417aa218908c5cc89461
msgid "4.Input your analysis goals"
msgstr "4.输入分析目标"
#: ../../getting_started/application/dashboard/dashboard.md:31
#: 473fc0d00ab54ee6bc5c21e017591cc4
#: ../../getting_started/application/dashboard/dashboard.md:36
#: fb0bb655581a4109a5510240e54db006
#, fuzzy
msgid ""
"![document](https://github.com/eosphoros-ai/DB-"
@@ -136,19 +152,19 @@ msgstr ""
"![document](https://github.com/eosphoros-ai/DB-GPT/assets/13723926"
"/3d14a2da-165e-4b2f-a921-325c20fe5ae9)"
#: ../../getting_started/application/dashboard/dashboard.md:31
#: ../../getting_started/application/dashboard/dashboard.md:35
#: 00597e1268544d97a3de368b04d5dcf8 350d04e4b7204823b7a03c0a7606c951
#: ../../getting_started/application/dashboard/dashboard.md:36
#: ../../getting_started/application/dashboard/dashboard.md:40
#: 44680217a9794eddb97bcb98593a1071
msgid "db plugins demonstration"
msgstr ""
#: ../../getting_started/application/dashboard/dashboard.md:34
#: b48cc911c1614def9e4738d35e8b754c
#: ../../getting_started/application/dashboard/dashboard.md:39
#: 4a9a8eac8e77465a9519b532afdfd1b7
msgid "5.Adjust and modify your report"
msgstr "5.调整"
#: ../../getting_started/application/dashboard/dashboard.md:35
#: b0442bbc0f6c4c33914814ac92fc4b13
#: ../../getting_started/application/dashboard/dashboard.md:40
#: b56da5e50ced4085bb376caa26e50e78
msgid ""
"![db plugins "
"demonstration](../../../../assets/chat_dashboard/chat_dashboard_2.png)"

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 👏👏 0.3.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-10-19 19:31+0800\n"
"POT-Creation-Date: 2023-10-27 15:57+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
@@ -20,12 +20,12 @@ msgstr ""
"Generated-By: Babel 2.12.1\n"
#: ../../getting_started/faq/deploy/deploy_faq.md:1
#: fb640f7c38744cbf996dcf7f73f325f6
#: 798fb40c5ec941fcb9d6a0795219132f
msgid "Installation FAQ"
msgstr "Installation FAQ"
msgstr "安装 FAQ"
#: ../../getting_started/faq/deploy/deploy_faq.md:5
#: 79fd80e469d14d608554d53a0e0ed2e3
#: 47d0aa43c5fe4ca3a8ceba50c18ba608
#, fuzzy
msgid ""
"Q1: execute `pip install -e .` error, found some package cannot find "
@@ -35,18 +35,20 @@ msgstr ""
"cannot find correct version."
#: ../../getting_started/faq/deploy/deploy_faq.md:6
#: f1f6e3291d1446b5bbcf744cd4c4e89a
#: 944761c1ccc543c0a6aa2fad8dc74a32
msgid "change the pip source."
msgstr "替换pip源."
#: ../../getting_started/faq/deploy/deploy_faq.md:13
#: ../../getting_started/faq/deploy/deploy_faq.md:20
#: 68e1b39a08774a81b9061cc5205e4c1c dd34901f446749e998cd34ec5b6c44f4
#: ../../getting_started/faq/deploy/deploy_faq.md:145
#: 3cff7ea0ee7945be8d03b6b3b032515b 5ba3037287524d6384ca96ffe58798fa
#: 9635f37d34e04764855f21d2266411f6
msgid "or"
msgstr "或者"
#: ../../getting_started/faq/deploy/deploy_faq.md:27
#: 0899f0e28dae443b8f912d96c797b79c
#: c1c71ca902d745b89136bb63beda3dfd
msgid ""
"Q2: sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to"
" open database file"
@@ -55,80 +57,80 @@ msgstr ""
" open database file"
#: ../../getting_started/faq/deploy/deploy_faq.md:29
#: 3e60d8190e49436b8c40b34a67b7bfb3
#: 97124a4512534c63bd09f2cf5a76fd13
msgid "make sure you pull latest code or create directory with mkdir pilot/data"
msgstr "make sure you pull latest code or create directory with mkdir pilot/data"
#: ../../getting_started/faq/deploy/deploy_faq.md:31
#: baeaae20238842d3b8e4ae5b337198e5
#: 369ed2cd489d46009184036a8f8ed67a
msgid "Q3: The model keeps getting killed."
msgstr "Q3: The model keeps getting killed."
#: ../../getting_started/faq/deploy/deploy_faq.md:33
#: eb3936307ad64b19b73483ff9ae126f2
#: 6d59ca711a95495d9bddf22cd804e20b
msgid ""
"your GPU VRAM size is not enough, try replace your hardware or replace "
"other llms."
msgstr "GPU显存不够, 增加显存或者换一个显存小的模型"
#: ../../getting_started/faq/deploy/deploy_faq.md:35
#: f6dba770717041699c73b4cd00d48aad
#: 7ef755bf77fa46ccb63076c3561ecc64
msgid "Q4: How to access website on the public network"
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:37
#: 447d9e9374de44bab6d8a03f2c936676
#: cd3f9144525b49babb826a7447812016
msgid ""
"You can try to use gradio's [network](https://github.com/gradio-"
"app/gradio/blob/main/gradio/networking.py) to achieve."
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:48
#: 5e34dd4dfcf34feeb1815dfa974041d0
#: 71f0174d58674b1abd3d6a02cf65abf6
msgid "Open `url` with your browser to see the website."
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:50
#: aaef774ce6124021a3862bc0a25d465f
#: 81b07e64feef4187beab2022f3af294d
msgid "Q5: (Windows) execute `pip install -e .` error"
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:52
#: ec3945df451c4ec2b32ebb476f45c82b
#: f2e7cd453c10486aa9b7d90d1d771b58
msgid "The error log like the following:"
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:71
#: 1df09f6d9f9b4c1a8a32d6e271e5ee39
#: 2c97bbe2f96142ec8398b376f6a21d7f
msgid ""
"Download and install `Microsoft C++ Build Tools` from [visual-cpp-build-"
"tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)"
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:75
#: 251f47bfa5694242a1c9d81a2022b7a0
#: 95120da5a6bf4a26bf64c2dd54632e4b
msgid "Q6: `Torch not compiled with CUDA enabled`"
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:82
#: bc9dfdfc47924a0e8d3ec535e23bf923
#: fa936391d8bd44cebeffc92e0f893700
msgid "Install [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit-archive)"
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:83
#: b5a632baa42745bdbee5d6ba516d8d8b
#: a8eb968b4b5a4f2786f7133299b8d20f
msgid ""
"Reinstall PyTorch [start-locally](https://pytorch.org/get-started/locally"
"/#start-locally) with CUDA support."
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:85
#: 0092fb91642749f5a55b629017c0de6a
#: 009f8b213c9044888975f1ae8cdf7a75
msgid "Q7: ImportError: cannot import name 'PersistentClient' from 'chromadb'."
msgstr "Q7: ImportError: cannot import name 'PersistentClient' from 'chromadb'."
#: ../../getting_started/faq/deploy/deploy_faq.md:91
#: 4aa87418f2a54c138bf3b7ff28a7e776
#: 237706fe28b846dcbe77e04a3bf89a6c
msgid ""
"Q8: pydantic.error_wrappers.ValidationError:1 validation error for "
"HuggingFaceEmbeddings.model_kwargs extra not permitted"
@@ -137,14 +139,62 @@ msgstr ""
"HuggingFaceEmbeddings.model_kwargs extra not permitted"
#: ../../getting_started/faq/deploy/deploy_faq.md:102
#: 6b690ab272af44f6b126cfe5ce1435ef
#: e20c5fde988b478fb7eaba0f10d7d196
msgid "Q9: alembic.util.exc.CommandError: Target database is not up to date."
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:103
#: 223026d3b9124363b695937922d8f8d5
msgid "delete files in `DB-GPT/pilot/meta_data/alembic/versions/` and reboot."
msgstr "删除`DB-GPT/pilot/meta_data/alembic/versions/`目录下文件"
#: ../../getting_started/faq/deploy/deploy_faq.md:104
#: 6d096ff6f4754490868a0ff2b8a08f10
msgid "delete files in `DB-GPT/pilot/meta_data/alembic/versions/` and restart."
msgstr "删除`DB-GPT/pilot/meta_data/alembic/versions/`目录下文件然后重新启动"
#: ../../getting_started/faq/deploy/deploy_faq.md:110
#: 2294a811682d4744b9334ee6deec4a49
msgid "Q10: How to store DB-GPT metadata into my database"
msgstr "Q10: 如何将 DB-GPT 的元数据存储到自己的数据库中"
#: ../../getting_started/faq/deploy/deploy_faq.md:112
#: 034495af54f041bcb560a5366b9be912
msgid ""
"In version 0.4.0, the metadata module of the DB-GPT application has been "
"refactored. All metadata tables will now be automatically saved in the "
"'dbgpt' database, based on the database type specified in the `.env` "
"file. If you would like to retain the existing data, it is recommended to"
" use a data migration tool to transfer the database table information to "
"the 'dbgpt' database. Additionally, you can change the default database "
"name 'dbgpt' in your `.env` file."
msgstr ""
"v0.4.0 重构了DB-"
"GPT应用的数据库元数据模块所有的元数据库表都会自动保存在.env文件设置的数据库类型的`dbgpt`数据库中如果想沿用以前的数据建议使用数据迁移工具将数据库表信息挪到dbgpt数据库中。"
"另外,你可以在 `.env` 中修改默认的数据库名 'dbgpt' "
#: ../../getting_started/faq/deploy/deploy_faq.md:132
#: f9baf853f21b460ba5df63b84b35c040
msgid ""
"Q11: pymysql.err.OperationalError: (1142, \"ALTER command denied to user "
"'{you db user}'@'{you db host}' for table '{some table name}'\")"
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:134
#: a64cb2d75d6643559420c016362eb435
msgid ""
"In version 0.4.0, DB-GPT use migration tool alembic to migrate metadata. "
"If the database user does not have DDL permissions, this error will be "
"reported. You can solve this problem by importing the metadata "
"information separately."
msgstr ""
"v0.4.0后DB-GPT 使用 alembic 作为元数据迁移工具。"
"如果数据库用户没有 DDL 权限则会报这个错,您可以通过单独导入元数据信息来解决这个问题。"
#: ../../getting_started/faq/deploy/deploy_faq.md:136
#: 77c6bd4b559d457ab599b7f7730e85f1
msgid "Use a privileged user to execute DDL sql file"
msgstr "使用一个有权限的用户来执行 DDL SQL 文件。"
#: ../../getting_started/faq/deploy/deploy_faq.md:141
#: 30c3fd7f7bfc4a63b5b9c4c15c64430f
msgid "Run DB-GPT webserver with `--disable_alembic_upgrade`"
msgstr "添加参数 `--disable_alembic_upgrade` 来运行 DB-GPT 的 webserver"
#~ msgid ""
#~ "Q2: When use Mysql, Access denied "

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 👏👏 0.3.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-10-20 14:49+0800\n"
"POT-Creation-Date: 2023-10-27 15:57+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
@@ -20,34 +20,34 @@ msgstr ""
"Generated-By: Babel 2.12.1\n"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:1
#: e95c136d802f486082c47a8c017eb725
#: ab7d87ee62774af099fb0a8167b2d4be
msgid "KBQA FAQ"
msgstr "KBQA FAQ"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:4
#: f19c96b7b1ec4bc7ad8c7c26582d7e59
#: 3582be98154f4c3381765c130538d997
msgid "Q1: text2vec-large-chinese not found"
msgstr "Q1: text2vec-large-chinese not found"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:6
#: 24a0603be39d4418909c27f9a53b51e2
#: 3382fb6d60b443029a04e183cb5449cf
msgid ""
"make sure you have download text2vec-large-chinese embedding model in "
"right way"
msgstr "确认下载text2vec-large-chinese模型姿势以及路径正确"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:18
#: 356008dd415f4bdd9b0927d8ee073548
#: 9fb65568d9cb4bf0be9371eae38ffe75
msgid "Q2:How to change Vector DB Type in DB-GPT."
msgstr "怎么修改向量数据库类型"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:20
#: 42013bfb02624010b668bd244b33c977
#: 1904c691985044acad9d1cd84a227250
msgid "Update .env file and set VECTOR_STORE_TYPE."
msgstr "怎样在.env文件设置VECTOR_STORE_TYPE"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:22
#: 72b2bae15fea4e0d927bda68a8d0861d
#: a6ebd5b32fac42fbbdb7e26aaeafd781
msgid ""
"DB-GPT currently support Chroma(Default), Milvus(>2.1), Weaviate vector "
"database. If you want to change vector db, Update your .env, set your "
@@ -61,19 +61,19 @@ msgstr ""
"://db-gpt.readthedocs.io/en/latest/modules/vector.html)"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:38
#: 0a12e3a5319c4a86a1db68d615d6fb8e
#: 8357695648cf4dcca7d8d2c6d0c48b0a
msgid "Q3:When I use vicuna-13b, found some illegal character like this."
msgstr "当使用vicuna系列模型时出现乱码。"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:43
#: f89ffbf4697a4ccdb8030834c52b0473
#: ff8cb9ecfd2d4c9fa179b872d03a97dd
msgid ""
"Set KNOWLEDGE_SEARCH_TOP_SIZE smaller or set KNOWLEDGE_CHUNK_SIZE "
"smaller, and reboot server."
msgstr "通过在.env文件将KNOWLEDGE_SEARCH_TOP_SIZE设置更小点或者在文档界面点击参数设置将topk设置更小点"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:45
#: fc837488bcc7432a92b70126e80e75d7
#: d7a49b1b219c4cf1bcb6ba212e378a7e
msgid ""
"Q4:space add error (pymysql.err.OperationalError) (1054, \"Unknown column"
" 'knowledge_space.context' in 'field list'\")"
@@ -82,53 +82,58 @@ msgstr ""
"'knowledge_space.context' in 'field list'\")"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:47
#: 30c186bae2c3489eb18c18768c11c302
#: 30d34122c9fe4d1a9870c54480c734a6
msgid "1.shutdown dbgpt_server(ctrl c)"
msgstr "1.终止 dbgpt_server(ctrl c)"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:49
#: 9cac5688ddb14c63905cc86e77d4567e
#: 1ccc21a493114e399007f9399f98006b
msgid "2.add column context for table knowledge_space"
msgstr "2.新增列 `context` for table knowledge_space"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:55
#: b32219bc1c6246108f606952d8ef0132
#: 075c48b850354ac7971bd7556b68ef52
msgid "3.execute sql ddl"
msgstr "3.执行ddl"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:62
#: ebfd196350994c44841d5766f776905c
#: c4484fc646324c9a976b81a4e802c435
msgid "4.restart dbgpt serve"
msgstr "4.重启dbgpt server"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:64
#: cfa083226efd4980a57ff15e86bb8480
#: b3da50497f37421485d8f0e852f0b09c
msgid "Q5:Use Mysql, how to use DB-GPT KBQA"
msgstr "Q5:当使用 Mysql数据库时, 使用DB-GPT怎么初始化 KBQA service database schema"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:66
#: 95098205d36c4ca79ad9b1b0f9b2985a
#: 97484a97b0d14d3f835efb5a0739c97e
msgid "build Mysql KBQA system database schema."
msgstr "构建Mysql KBQA system database schema"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:73
#: efc87678042d48b38b57f700d9ff74e5
#: bdcbaf0559a549468fab021e03ac3876
msgid "Q6:when pull from 0.4.0, I found historical knowledge document disappeared"
msgstr "当从0.4.0版本拉取代码后,历史知识库问答信息没了"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:75
#: 975eaff1a20a40b5b5ee18d6c6ddb9c1
#: ea78542f6be94dfc8d97b2660bb22876
#, fuzzy
msgid ""
"In version 0.4.0, the metadata module of the DB-GPT application has been "
"refactored. All metadata tables will now be automatically saved in the "
"'dbgpt' database, based on the database type specified in the .env file. "
"If you would like to retain the existing data, it is recommended to use a"
" data migration tool to transfer the database table information to the "
"'dbgpt' database."
msgstr "v0.4.0 重构了DB-GPT应用的数据库元数据模块所有的元数据库表都会自动保存在.env文件设置的数据库类型的`dbgpt`数据库中如果想沿用以前的数据建议使用数据迁移工具将数据库表信息挪到dbgpt数据库中。"
"'dbgpt' database, based on the database type specified in the `.env` "
"file. If you would like to retain the existing data, it is recommended to"
" use a data migration tool to transfer the database table information to "
"the 'dbgpt' database. Additionally, you can change the default database "
"name 'dbgpt' in your `.env` file."
msgstr ""
"v0.4.0 重构了DB-"
"GPT应用的数据库元数据模块所有的元数据库表都会自动保存在.env文件设置的数据库类型的`dbgpt`数据库中如果想沿用以前的数据建议使用数据迁移工具将数据库表信息挪到dbgpt数据库中。"
"另外,你可以在 `.env` 中修改默认的数据库名 'dbgpt' "
#: ../../getting_started/faq/kbqa/kbqa_faq.md:78
#: 815e44fef54f4807a2cf1e8d64b73a70
#: badc49ae6b4340be9700b92b1023e45b
msgid "old database:knowledge_management; new database:dbgpt;"
msgstr ""

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 👏👏 0.3.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-10-20 22:29+0800\n"
"POT-Creation-Date: 2023-10-30 11:37+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
@@ -19,34 +19,36 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.12.1\n"
#: ../../getting_started/faq/llm/llm_faq.md:1 54763acec7da4deb90669195c54ec3a1
#: ../../getting_started/faq/llm/llm_faq.md:1 98e23f85313c45169ff2ba7f80193356
msgid "LLM USE FAQ"
msgstr "LLM模型使用FAQ"
#: ../../getting_started/faq/llm/llm_faq.md:3 66f73fd2ee7b462e92d3f263792a5e33
msgid "Q1:how to use openai chatgpt service"
#: ../../getting_started/faq/llm/llm_faq.md:3 0d49acfb4af947cb969b249346b00d33
#, fuzzy
msgid "Q1: how to use openai chatgpt service"
msgstr "我怎么使用OPENAI服务"
#: ../../getting_started/faq/llm/llm_faq.md:4 9d178d8462b74cb188bbacf2ac2ac12b
#: ../../getting_started/faq/llm/llm_faq.md:4 7010fec33e264987a29de86c54da93e8
#, fuzzy
msgid "change your LLM_MODEL in `.env`"
msgstr "通过在.env文件设置LLM_MODEL"
#: ../../getting_started/faq/llm/llm_faq.md:9 f7ca82f257be4ac09639a7f8af5e83eb
#: ../../getting_started/faq/llm/llm_faq.md:9 0982d6d5d0b3434fb00698aaf675f3f3
msgid "set your OPENAPI KEY"
msgstr "set your OPENAPI KEY"
#: ../../getting_started/faq/llm/llm_faq.md:16 d6255b20dce34a2690df7e2af3505d97
#: ../../getting_started/faq/llm/llm_faq.md:16 63650494c1574de09c007e1d470dd53d
msgid "make sure your openapi API_KEY is available"
msgstr "确认openapi API_KEY是否可用"
#: ../../getting_started/faq/llm/llm_faq.md:18 6f1c6dbdb31f4210a6d21f0f3a6ae589
#: ../../getting_started/faq/llm/llm_faq.md:18 5721ec71e344499d96c55b7e531d7c08
#, fuzzy
msgid ""
"Q2 What difference between `python dbgpt_server --light` and `python "
"Q2: What difference between `python dbgpt_server --light` and `python "
"dbgpt_server`"
msgstr "Q2 `python dbgpt_server --light` 和 `python dbgpt_server`的区别是什么?"
msgstr "Q2: `python dbgpt_server --light` 和 `python dbgpt_server`的区别是什么?"
#: ../../getting_started/faq/llm/llm_faq.md:20 b839771ae9e34e998b0edf8d69deabdd
#: ../../getting_started/faq/llm/llm_faq.md:20 76a650f195dd40b6a3a3564030cdc040
msgid ""
"`python dbgpt_server --light` dbgpt_server does not start the llm "
"service. Users can deploy the llm service separately by using `python "
@@ -58,75 +60,75 @@ msgstr ""
"用户可以通过`python "
"llmserver`单独部署模型服务dbgpt_server通过LLM_SERVER环境变量来访问模型服务。目的是为了可以将dbgpt后台服务和大模型服务分离部署。"
#: ../../getting_started/faq/llm/llm_faq.md:22 aba39cef6fe84799bcd03e8f36c41296
#: ../../getting_started/faq/llm/llm_faq.md:22 8cd87e3504784d9e891e1fb96c79e143
msgid ""
"`python dbgpt_server` dbgpt_server service and the llm service are "
"deployed on the same instance. when dbgpt_server starts the service, it "
"also starts the llm service at the same time."
msgstr "`python dbgpt_server` 是将后台服务和模型服务部署在同一台实例上.dbgpt_server在启动服务的时候同时开启模型服务."
#: ../../getting_started/faq/llm/llm_faq.md:27 c65270d479af49e28e99b35a7932adbd
#: ../../getting_started/faq/llm/llm_faq.md:27 58a6eaf57e6d425685f67058b1a642d4
msgid ""
"If you want to access an external LLM service(deployed by DB-GPT), you "
"need to"
msgstr "如果模型服务部署(通过DB-GPT部署)在别的机器想通过dbgpt服务访问模型服务"
#: ../../getting_started/faq/llm/llm_faq.md:29 da153e6d18c543f28e0c4e85618e3d3d
#: ../../getting_started/faq/llm/llm_faq.md:29 67ac8823ca2e49ba9c833368e2cfb53c
msgid ""
"1.set the variables LLM_MODEL=YOUR_MODEL_NAME, "
"MODEL_SERVER=YOUR_MODEL_SERVEReg:http://localhost:5000 in the .env "
"file."
msgstr ""
#: ../../getting_started/faq/llm/llm_faq.md:31 cd89b8a2075f4407b8036a74151a6377
#: ../../getting_started/faq/llm/llm_faq.md:31 e5c066bcdf0649a1b33bbfc7fd3b1a66
msgid "2.execute dbgpt_server.py in light mode"
msgstr "2.execute dbgpt_server.py light 模式"
#: ../../getting_started/faq/llm/llm_faq.md:33 8f4b9401ac4f4a25a7479bee9ef5e8c1
#: ../../getting_started/faq/llm/llm_faq.md:33 402ff01d7ee94d97be4a0eb964e39b97
msgid "python pilot/server/dbgpt_server.py --light"
msgstr ""
#: ../../getting_started/faq/llm/llm_faq.md:38 69e1064cd7554ce6b49da732f800eacc
#: ../../getting_started/faq/llm/llm_faq.md:38 86190c689d8f4d9a9b58d904e0b5867b
#, fuzzy
msgid "Q3 How to use MultiGPUs"
msgstr "Q2 怎么使用 MultiGPUs"
msgid "Q3: How to use MultiGPUs"
msgstr "Q3: 怎么使用 MultiGPUs"
#: ../../getting_started/faq/llm/llm_faq.md:40 6de3f105ce96430db5756f38bbd9ca12
#: ../../getting_started/faq/llm/llm_faq.md:40 6b08cff88750440b98956203d8b8a084
msgid ""
"DB-GPT will use all available gpu by default. And you can modify the "
"setting `CUDA_VISIBLE_DEVICES=0,1` in `.env` file to use the specific gpu"
" IDs."
msgstr "DB-GPT默认加载可利用的gpu你也可以通过修改 在`.env`文件 `CUDA_VISIBLE_DEVICES=0,1`来指定gpu IDs"
#: ../../getting_started/faq/llm/llm_faq.md:43 87cb9bfb20af4b259d719df797c42a7d
#: ../../getting_started/faq/llm/llm_faq.md:43 93b39089e5be4475b9e90e7813f5a7d9
msgid ""
"Optionally, you can also specify the gpu ID to use before the starting "
"command, as shown below:"
msgstr "你也可以指定gpu ID启动"
#: ../../getting_started/faq/llm/llm_faq.md:53 bcfa35cda6304ee5ab9a775a2d4eda63
#: ../../getting_started/faq/llm/llm_faq.md:53 62e3074c109d401fa4bf1ddbdc6c7be1
msgid ""
"You can modify the setting `MAX_GPU_MEMORY=xxGib` in `.env` file to "
"configure the maximum memory used by each GPU."
msgstr "同时你可以通过在.env文件设置`MAX_GPU_MEMORY=xxGib`修改每个GPU的最大使用内存"
#: ../../getting_started/faq/llm/llm_faq.md:55 a05c5484927844c8bb4791f0a9ccc82e
#: ../../getting_started/faq/llm/llm_faq.md:55 d235bd83545c476f8e12572658d1c723
#, fuzzy
msgid "Q4 Not Enough Memory"
msgstr "Q3 机器显存不够 "
msgid "Q4: Not Enough Memory"
msgstr "Q4: 机器显存不够 "
#: ../../getting_started/faq/llm/llm_faq.md:57 fe17a023b6eb4a92b1b927e1b94e3784
#: ../../getting_started/faq/llm/llm_faq.md:57 b3243ed9147f42bba987d7f9b778e66f
msgid "DB-GPT supported 8-bit quantization and 4-bit quantization."
msgstr "DB-GPT 支持 8-bit quantization 和 4-bit quantization."
#: ../../getting_started/faq/llm/llm_faq.md:59 76c3684c10864b8e87e5c2255b6c0b7f
#: ../../getting_started/faq/llm/llm_faq.md:59 1ddb9f94ab994bfebfee46d1c19888d4
msgid ""
"You can modify the setting `QUANTIZE_8bit=True` or `QUANTIZE_4bit=True` "
"in `.env` file to use quantization(8-bit quantization is enabled by "
"default)."
msgstr "你可以通过在.env文件设置`QUANTIZE_8bit=True` or `QUANTIZE_4bit=True`"
#: ../../getting_started/faq/llm/llm_faq.md:61 c5d849a38f1a4f0687bbcffb6699dc39
#: ../../getting_started/faq/llm/llm_faq.md:61 54b85daa3fb24b17b67a6da31d2be8b0
msgid ""
"Llama-2-70b with 8-bit quantization can run with 80 GB of VRAM, and 4-bit"
" quantization can run with 48 GB of VRAM."
@@ -134,49 +136,77 @@ msgstr ""
"Llama-2-70b with 8-bit quantization 可以运行在 80 GB VRAM机器 4-bit "
"quantization可以运行在 48 GB VRAM"
#: ../../getting_started/faq/llm/llm_faq.md:63 867329a5e3b0403083e96f72b8747fb2
#: ../../getting_started/faq/llm/llm_faq.md:63 097d680aed184fee9eceebee55a47ac1
msgid ""
"Note: you need to install the latest dependencies according to "
"[requirements.txt](https://github.com/eosphoros-ai/DB-"
"GPT/blob/main/requirements.txt)."
"Note: you need to install the quantization dependencies with `pip install"
" -e \".[quantization]\"`"
msgstr ""
#: ../../getting_started/faq/llm/llm_faq.md:65 60ceee25e9fb4ddba40c5306bfb0a82f
#: ../../getting_started/faq/llm/llm_faq.md:65 f3a51056043c49eb84471040f2b364aa
#, fuzzy
msgid "Q5 How to Add LLM Service dynamic local mode"
msgstr "Q5 怎样动态新增模型服务"
msgid "Q5: How to Add LLM Service dynamic local mode"
msgstr "Q5: 怎样动态新增模型服务"
#: ../../getting_started/faq/llm/llm_faq.md:67 c99eb7f7ae844884a8f0da94238ea7e0
#: ../../getting_started/faq/llm/llm_faq.md:67 43ee6b0f23814c94a4ddb2429801a5e1
msgid ""
"Now DB-GPT through multi-llm service switch, so how to add llm service "
"dynamic,"
msgstr "DB-GPT支持多个模型服务切换, 怎样添加一个模型服务呢"
#: ../../getting_started/faq/llm/llm_faq.md:78 cd89b8a2075f4407b8036a74151a6377
#: ../../getting_started/faq/llm/llm_faq.md:78 c217bbf0d2b6425fa7a1c691b7704a8d
#, fuzzy
msgid "Q6 How to Add LLM Service dynamic in remote mode"
msgstr "Q5 怎样动态新增模型服务"
msgid "Q6: How to Add LLM Service dynamic in remote mode"
msgstr "Q6: 怎样动态新增模型服务"
#: ../../getting_started/faq/llm/llm_faq.md:79 8833ce89465848259b08ef0a4fa68d96
#: ../../getting_started/faq/llm/llm_faq.md:79 195bdaa937a94c7aa0d8c6e1a5430d6e
msgid ""
"If you deploy llm service in remote machine instance, and you want to "
"add model service to dbgpt server to manage"
msgstr "如果你想在远程机器实例部署大模型服务并添加到本地dbgpt_server进行管理"
#: ../../getting_started/faq/llm/llm_faq.md:81 992eb37e3cca48829636c15ba3ec2ee8
#: ../../getting_started/faq/llm/llm_faq.md:81 c64098b838a94821963a1d16e56497ff
msgid "use dbgpt start worker and set --controller_addr."
msgstr "使用1`dbgpt start worker`命令并设置注册地址--controller_addr"
#: ../../getting_started/faq/llm/llm_faq.md:91 0d06d7d6dd3d4780894ecd914c89b5a2
#: ../../getting_started/faq/llm/llm_faq.md:91 cb12d5e9d9d24f14abc3ebea877a4b24
#, fuzzy
msgid "Q7 dbgpt command not found"
msgstr "Q6 dbgpt command not found"
msgid "Q7: dbgpt command not found"
msgstr "Q7: dbgpt command not found"
#: ../../getting_started/faq/llm/llm_faq.md:97 5d9beed0d95a4503a43d0e025664273b
#: ../../getting_started/faq/llm/llm_faq.md:97 f95cdccfa82d4b3eb2a23dd297131faa
#, fuzzy
msgid ""
"Q8 When starting the worker_manager on a cloud server and registering it "
"with the controller, it is noticed that the worker's exposed IP is a "
"Q8: When starting the worker_manager on a cloud server and registering it"
" with the controller, it is noticed that the worker's exposed IP is a "
"private IP instead of a public IP, which leads to the inability to access"
" the service."
msgstr "云服务器启动worker_manager注册到controller时发现worker暴露的ip是私网ip, 没有以公网ip暴露导致服务访问不到"
msgstr ""
"Q8: 云服务器启动worker_manager注册到controller时发现worker暴露的ip是私网ip, "
"没有以公网ip暴露导致服务访问不到"
#: ../../getting_started/faq/llm/llm_faq.md:106
#: 739a2983f3484acf98e877dc12f4ccda
msgid "Q9: How to customize model path and prompt template"
msgstr "Q9: 如何自定义模型路径和 prompt 模板"
#: ../../getting_started/faq/llm/llm_faq.md:108
#: 8b82a33a311649c7850c30c00c987c72
#, fuzzy
msgid ""
"DB-GPT will read the model path from "
"`pilot.configs.model_config.LLM_MODEL_CONFIG` based on the `LLM_MODEL`. "
"Of course, you can use the environment variable `LLM_MODEL_PATH` to "
"specify the model path and `LLM_PROMPT_TEMPLATE` to specify your model "
"prompt template."
msgstr ""
"DB-GPT 会根据 `LLM_MODEL` 从 `pilot.configs.model_config.LLM_MODEL_CONFIG` "
"中读取模型路径。当然,你可以使用环境 `LLM_MODEL_PATH` 来指定模型路径,以及使用 `LLM_PROMPT_TEMPLATE` "
"来指定模型的 prompt 模板。"
#~ msgid ""
#~ "Note: you need to install the "
#~ "latest dependencies according to "
#~ "[requirements.txt](https://github.com/eosphoros-ai/DB-"
#~ "GPT/blob/main/requirements.txt)."
#~ msgstr ""

View File

@@ -0,0 +1,71 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2023, csunny
# This file is distributed under the same license as the DB-GPT package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 👏👏 0.4.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-02 21:09+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
"Language-Team: zh_CN <LL@li.org>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.12.1\n"
#: ../../getting_started/install/cluster/openai.md:1
#: 01f4e2bf853341198633b367efec1522
msgid "OpenAI-Compatible RESTful APIs"
msgstr "OpenAI RESTful 兼容接口"
#: ../../getting_started/install/cluster/openai.md:5
#: d8717e42335e4027bf4e76b3d28768ee
msgid "Install Prepare"
msgstr "安装准备"
#: ../../getting_started/install/cluster/openai.md:7
#: 9a48d8ee116942468de4c6faf9a64758
msgid ""
"You must [deploy DB-GPT cluster](https://db-"
"gpt.readthedocs.io/en/latest/getting_started/install/cluster/vms/index.html)"
" first."
msgstr "你必须先部署 [DB-GPT 集群]"
"(https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh-cn/latest/getting_started/install/cluster/vms/index.html)。"
#: ../../getting_started/install/cluster/openai.md:9
#: 7673a7121f004f7ca6b1a94a7e238fa3
msgid "Launch Model API Server"
msgstr "启动模型 API Server"
#: ../../getting_started/install/cluster/openai.md:14
#: 84a925c2cbcd4e4895a1d2d2fe8f720f
msgid "By default, the Model API Server starts on port 8100."
msgstr "默认情况下,模型 API Server 使用 8100 端口启动。"
#: ../../getting_started/install/cluster/openai.md:16
#: e53ed41977cd4721becd51eba05c6609
msgid "Validate with cURL"
msgstr "通过 cURL 验证"
#: ../../getting_started/install/cluster/openai.md:18
#: 7c883b410b5c4e53a256bf17c1ded80d
msgid "List models"
msgstr "列出模型"
#: ../../getting_started/install/cluster/openai.md:26
#: ../../getting_started/install/cluster/openai.md:37
#: 7cf0ed13f0754f149ec085cd6cf7a45a 990d5d5ed5d64ab49550e68495b9e7a0
msgid "Chat completions"
msgstr ""
#: ../../getting_started/install/cluster/openai.md:35
#: 81583edd22df44e091d18a0832278131
msgid "Validate with OpenAI Official SDK"
msgstr "通过 OpenAI 官方 SDK 验证"

View File

@@ -0,0 +1,652 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2023, csunny
# This file is distributed under the same license as the DB-GPT package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 👏👏 0.4.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-06 19:38+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
"Language-Team: zh_CN <LL@li.org>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.12.1\n"
#: ../../getting_started/install/deploy.rst:4 f3ea3305f122460aaa11999edc4b5de6
msgid "Installation From Source"
msgstr "源码安装"
#: ../../getting_started/install/deploy.rst:6 bb941f2bd56d4eb48f7c4f75ebd74176
msgid "To get started, install DB-GPT with the following steps."
msgstr "按照以下步骤进行安装"
#: ../../getting_started/install/deploy.rst:10 27a1e092c1f945ceb9946ebdaf89b600
msgid "1.Preparation"
msgstr "1.准备"
#: ../../getting_started/install/deploy.rst:11 5c5bfbdc74a14c3b9b1f1ed66617cac8
msgid "**Download DB-GPT**"
msgstr "**下载DB-GPT项目**"
#: ../../getting_started/install/deploy.rst:17 3065ee2f34f9417598a37fd699a4863e
msgid "**Install Miniconda**"
msgstr "**安装Miniconda**"
#: ../../getting_started/install/deploy.rst:19 f9f3a653ffb8447284686aa37a7bb79a
msgid ""
"We use Sqlite as default database, so there is no need for database "
"installation. If you choose to connect to other databases, you can "
"follow our tutorial for installation and configuration. For the entire "
"installation process of DB-GPT, we use the miniconda3 virtual "
"environment. Create a virtual environment and install the Python "
"dependencies. `How to install Miniconda "
"<https://docs.conda.io/en/latest/miniconda.html>`_"
msgstr ""
"目前使用Sqlite作为默认数据库因此DB-"
"GPT快速部署不需要部署相关数据库服务。如果你想使用其他数据库需要先部署相关数据库服务。我们目前使用Miniconda进行python环境和包依赖管理。`如何安装"
" Miniconda <https://docs.conda.io/en/latest/miniconda.html>`_ 。"
#: ../../getting_started/install/deploy.rst:36 a2cd2fdd1d16421f9cbe341040b153b6
msgid "2.Deploy LLM Service"
msgstr "2.部署LLM服务"
#: ../../getting_started/install/deploy.rst:37 180a121e3c994a92a917ace80bf12386
msgid ""
"DB-GPT can be deployed on servers with low hardware requirements or on "
"servers with high hardware requirements."
msgstr "DB-GPT可以部署在对硬件要求不高的服务器也可以部署在对硬件要求高的服务器"
#: ../../getting_started/install/deploy.rst:39 395608515c0348d5849030b58da7b659
msgid ""
"If you are low hardware requirements you can install DB-GPT by Using "
"third-part LLM REST API Service OpenAI, Azure, tongyi."
msgstr "低硬件要求模式适用于对接第三方模型服务的 API比如 OpenAI、通义千问、 文心一言等。"
#: ../../getting_started/install/deploy.rst:43 e29297e61e2e4d05ba88f0e1c2b1f365
msgid "As our project has the ability to achieve OpenAI performance of over 85%,"
msgstr "使用OpenAI服务可以让DB-GPT准确率达到85%"
#: ../../getting_started/install/deploy.rst:48 d0d70d51e8684c2891c58a6da4941a52
msgid "Notice make sure you have install git-lfs"
msgstr "确认是否已经安装git-lfs"
#: ../../getting_started/install/deploy.rst:50 0d2781fd38eb467ebad2a3c310a344e6
msgid "centos:yum install git-lfs"
msgstr ""
#: ../../getting_started/install/deploy.rst:52 1574ea24ad6443409070aa3a1f7abe87
msgid "ubuntu:apt-get install git-lfs"
msgstr ""
#: ../../getting_started/install/deploy.rst:54 ad86473d5c87447091c713f45cbfed0e
msgid "macos:brew install git-lfs"
msgstr ""
#: ../../getting_started/install/deploy.rst:58
#: ../../getting_started/install/deploy.rst:229
#: 3dd1e40f33924faab63634907a7f6511 dce32420face4ab2b99caf7f3900ede9
msgid "OpenAI"
msgstr "OpenAI"
#: ../../getting_started/install/deploy.rst:60 1f66400540114de2820761ef80137805
msgid "Installing Dependencies"
msgstr "安装依赖"
#: ../../getting_started/install/deploy.rst:66
#: ../../getting_started/install/deploy.rst:213
#: 31b856a6fc094334a37914c046cb1bb1 42b2f6d36ca4487f8e31d59bba123fca
msgid "Download embedding model"
msgstr "下载 embedding 模型"
#: ../../getting_started/install/deploy.rst:78 f970fb69e47c40d7bda381ec6f045829
msgid "Configure LLM_MODEL, PROXY_API_URL and API_KEY in `.env` file"
msgstr "在 `.env` 文件中设置 LLM_MODEL、PROXY_API_URL 和 API_KEY"
#: ../../getting_started/install/deploy.rst:88
#: ../../getting_started/install/deploy.rst:288
#: 6ca04c88fc60480db2ebdc9b234a0bbb 709cfe74c45c4eff83a7d77bb30b4a2b
msgid "Make sure your .env configuration is not overwritten"
msgstr "确保你的 .env 文件不会被覆盖"
#: ../../getting_started/install/deploy.rst:91 147aea0d753f44588f4a0c56002334ab
msgid "Vicuna"
msgstr "Vicuna"
#: ../../getting_started/install/deploy.rst:92 6a0bd60c4ca2478cb0f3d85aff70cd3b
msgid ""
"`Vicuna-v1.5 <https://huggingface.co/lmsys/vicuna-13b-v1.5>`_ based on "
"llama-2 has been released, we recommend you set `LLM_MODEL=vicuna-"
"13b-v1.5` to try this model)"
msgstr ""
"基于 llama-2 的模型 `Vicuna-v1.5 <https://huggingface.co/lmsys/vicuna-"
"13b-v1.5>`_ 已经发布,我们推荐你通过配置 `LLM_MODEL=vicuna-13b-v1.5` 来尝试这个模型"
#: ../../getting_started/install/deploy.rst:94 6a111c2ef31f41d4b737cf8b6f36fb16
msgid "vicuna-v1.5 hardware requirements"
msgstr "vicuna-v1.5 的硬件要求"
#: ../../getting_started/install/deploy.rst:98
#: ../../getting_started/install/deploy.rst:143
#: dc24c0238ce141df8bdce26cc0e2ddbb e04f1ea4b36940f3a28b66cdff7b702e
msgid "Model"
msgstr "模型"
#: ../../getting_started/install/deploy.rst:99
#: ../../getting_started/install/deploy.rst:144
#: b6473e65ca1a437a84226531be4da26d e0a2f7580685480aa13ca462418764d3
msgid "Quantize"
msgstr "量化"
#: ../../getting_started/install/deploy.rst:100
#: ../../getting_started/install/deploy.rst:145
#: 56471c3b174d4adf9e8cb5bebaa300a6 d82297b8b9c148c3906d8ee4ed10d8a0
msgid "VRAM Size"
msgstr "显存"
#: ../../getting_started/install/deploy.rst:101
#: ../../getting_started/install/deploy.rst:104
#: 1214432602fe47a28479ce3e21a7d88b 51838e72e42248f199653f1bf08c8155
msgid "vicuna-7b-v1.5"
msgstr ""
#: ../../getting_started/install/deploy.rst:102
#: ../../getting_started/install/deploy.rst:108
#: ../../getting_started/install/deploy.rst:147
#: ../../getting_started/install/deploy.rst:153
#: a64439f4e6f64c42bb76fbb819556784 ed95f498641e4a0f976318df608a1d67
#: fc400814509048b4a1cbe1e07c539285 ff7a8cb2cce8438cb6cb0d80dabfc2b5
msgid "4-bit"
msgstr ""
#: ../../getting_started/install/deploy.rst:103
#: ../../getting_started/install/deploy.rst:148
#: 2726e8a278c34e6db59147e9f66f2436 5feab5755a41403c9d641da697de4651
msgid "8 GB"
msgstr ""
#: ../../getting_started/install/deploy.rst:105
#: ../../getting_started/install/deploy.rst:111
#: ../../getting_started/install/deploy.rst:150
#: ../../getting_started/install/deploy.rst:156
#: 1984406682da4da3ad7b275e44085d07 2f027d838d0c46409e54c066d7983aae
#: 5c5878fe64944872b6769f075fedca05 e2507408a9c5423988e17b7029b487e4
msgid "8-bit"
msgstr ""
#: ../../getting_started/install/deploy.rst:106
#: ../../getting_started/install/deploy.rst:109
#: ../../getting_started/install/deploy.rst:151
#: ../../getting_started/install/deploy.rst:154
#: 332f50702c7b46e79ea0af5cbf86c6d5 381d23253cfd40109bacefca6a179f91
#: aafe2423c25546e789e4804e3fd91d1d cc56990a58e941d6ba023cbd4dca0357
msgid "12 GB"
msgstr ""
#: ../../getting_started/install/deploy.rst:107
#: ../../getting_started/install/deploy.rst:110
#: 1f14e2fa6d41493cb208f55eddff9773 6457f6307d8546beb5f2fb69c30922d8
msgid "vicuna-13b-v1.5"
msgstr ""
#: ../../getting_started/install/deploy.rst:112
#: ../../getting_started/install/deploy.rst:157
#: e24d3a36b5ce4cfe861dce2d1c4db592 f2e66b2da7954aaab0ee526b25a371f5
msgid "20 GB"
msgstr ""
#: ../../getting_started/install/deploy.rst:128
#: ../../getting_started/install/deploy.rst:175
#: ../../getting_started/install/deploy.rst:201
#: 1719c11f92874c47a87c00c634b9fad8 4596fcbe415d42fdbb29b92964fae070
#: e639ae6076a64b7b9de08527966e4550
msgid "The model files are large and will take a long time to download."
msgstr "这个模型权重文件比较大,需要花费较长时间来下载。"
#: ../../getting_started/install/deploy.rst:130
#: ../../getting_started/install/deploy.rst:177
#: ../../getting_started/install/deploy.rst:203
#: 4ec1492d389f403ebd9dd805fcaac68e ac6c68e2bf9b47c694ea8e0506014b10
#: e39be72282e64760903aaba45f8effb8
msgid "**Configure LLM_MODEL in `.env` file**"
msgstr "**在 `.env` 文件中配置 LLM_MODEL**"
#: ../../getting_started/install/deploy.rst:137
#: ../../getting_started/install/deploy.rst:234
#: 7ce4e2253ef24a7ea890ade04ce36682 b9d5bf4fa09649c4a098503132ce7c0c
msgid "Baichuan"
msgstr "百川"
#: ../../getting_started/install/deploy.rst:139
#: ffdad6a70558457fa825bad4d811100d
msgid "Baichuan hardware requirements"
msgstr "百川 的硬件要求"
#: ../../getting_started/install/deploy.rst:146
#: ../../getting_started/install/deploy.rst:149
#: 59d9b64f54d34971a68e93e3101def06 a66ce354d8f143ce920303241cd8947e
msgid "baichuan-7b"
msgstr ""
#: ../../getting_started/install/deploy.rst:152
#: ../../getting_started/install/deploy.rst:155
#: c530662259ca4ec5b03a18e4b690e17a fa3af65ecca54daab961f55729bbc40e
msgid "baichuan-13b"
msgstr ""
#: ../../getting_started/install/deploy.rst:179
#: efd73637994a4b7c97ef3557e1f3161c
msgid "please rename Baichuan path to \"baichuan2-13b\" or \"baichuan2-7b\""
msgstr "将Baichuan模型目录修改为\"baichuan2-13b\" 或 \"baichuan2-7b\""
#: ../../getting_started/install/deploy.rst:185
#: 435a3f0d0fe84b49a7305e2c0f51a5df
msgid "ChatGLM"
msgstr ""
#: ../../getting_started/install/deploy.rst:205
#: 165e23d3d40d4756b5a6a2580d015213
msgid "please rename chatglm model path to \"chatglm2-6b\""
msgstr "将 chatglm 模型目录修改为\"chatglm2-6b\""
#: ../../getting_started/install/deploy.rst:211
#: b651ebb5e0424b8992bc8b49d2280bee
msgid "Other LLM API"
msgstr "其它模型 API"
#: ../../getting_started/install/deploy.rst:225
#: 4eabdc25f4a34676b3ece620c88d866f
msgid "Now DB-GPT support LLM REST API TYPE:"
msgstr "目前DB-GPT支持的大模型 REST API 类型:"
#: ../../getting_started/install/deploy.rst:230
#: d361963cc3404e5ca55a823f1f1f545c
msgid "Azure"
msgstr ""
#: ../../getting_started/install/deploy.rst:231
#: 3b0f17c74aaa4bbd9db935973fa1c36b
msgid "Aliyun tongyi"
msgstr ""
#: ../../getting_started/install/deploy.rst:232
#: 7c4c457a499943b8804e31046551006d
msgid "Baidu wenxin"
msgstr ""
#: ../../getting_started/install/deploy.rst:233
#: ac1880a995184295acf07fff987d7c56
msgid "Zhipu"
msgstr ""
#: ../../getting_started/install/deploy.rst:235
#: 6927500d7d3445b7b1981da1df4e1666
msgid "Bard"
msgstr ""
#: ../../getting_started/install/deploy.rst:237
#: 419d564de18c485780d9336b852735b6
msgid "Configure LLM_MODEL and PROXY_API_URL and API_KEY in `.env` file"
msgstr "在`.env`文件设置 LLM_MODEL、PROXY_API_URL和 API_KEY"
#: ../../getting_started/install/deploy.rst:290
#: 71d5203682e24e2e896e4b9913471f78
msgid "llama.cpp"
msgstr ""
#: ../../getting_started/install/deploy.rst:292
#: 36a2b82f711a4c0f9491aca9c84d3c91
msgid ""
"DB-GPT already supports `llama.cpp "
"<https://github.com/ggerganov/llama.cpp>`_ via `llama-cpp-python "
"<https://github.com/abetlen/llama-cpp-python>`_ ."
msgstr ""
"DB-GPT 已经通过 `llama-cpp-python <https://github.com/abetlen/llama-cpp-"
"python>`_ 支持了 `llama.cpp <https://github.com/ggerganov/llama.cpp>`_ 。"
#: ../../getting_started/install/deploy.rst:294
#: 439064115dca4ae08d8e60041f2ffe17
msgid "**Preparing Model Files**"
msgstr "**准备模型文件**"
#: ../../getting_started/install/deploy.rst:296
#: 7291d6fa20b34942926e7765c01f25c9
msgid ""
"To use llama.cpp, you need to prepare a gguf format model file, and there"
" are two common ways to obtain it, you can choose either:"
msgstr "为了使用 llama.cpp你需要准备 gguf 格式的文件,你可以通过以下两种方法获取"
#: ../../getting_started/install/deploy.rst:298
#: 45752f3f5dd847469da0c5edddc530fa
msgid "**1. Download a pre-converted model file.**"
msgstr "**1.下载已转换的模型文件.**"
#: ../../getting_started/install/deploy.rst:300
#: c451db2157ff49b2b4992aed9907ddfa
msgid ""
"Suppose you want to use `Vicuna 13B v1.5 <https://huggingface.co/lmsys"
"/vicuna-13b-v1.5>`_ , you can download the file already converted from "
"`TheBloke/vicuna-13B-v1.5-GGUF <https://huggingface.co/TheBloke/vicuna-"
"13B-v1.5-GGUF>`_ , only one file is needed. Download it to the `models` "
"directory and rename it to `ggml-model-q4_0.gguf`."
msgstr ""
"假设您想使用 `Vicuna 13B v1.5 <https://huggingface.co/lmsys/vicuna-"
"13b-v1.5>`_ 您可以从 `TheBloke/vicuna-"
"13B-v1.5-GGUF <https://huggingface.co/TheBloke/vicuna-"
"13B-v1.5-GGUF>`_ 下载已转换的文件只需要一个文件。将其下载到models目录并将其重命名为 `ggml-"
"model-q4_0.gguf`。"
#: ../../getting_started/install/deploy.rst:306
#: f5b92b51622b43d398b3dc13a5892c29
msgid "**2. Convert It Yourself**"
msgstr "**2. 自行转换**"
#: ../../getting_started/install/deploy.rst:308
#: 8838ae6dcecf44ecad3fd963980c8eb3
msgid ""
"You can convert the model file yourself according to the instructions in "
"`llama.cpp#prepare-data--run <https://github.com/ggerganov/llama.cpp"
"#prepare-data--run>`_ , and put the converted file in the models "
"directory and rename it to `ggml-model-q4_0.gguf`."
msgstr ""
"您可以根据 `llama.cpp#prepare-data--run <https://github.com/ggerganov/llama.cpp"
"#prepare-data--run>`_ 中的说明自行转换模型文件并把转换后的文件放在models目录中并重命名为`ggml-"
"model-q4_0.gguf`。"
#: ../../getting_started/install/deploy.rst:310
#: 3fe28d6e5eaa4bdf9c5c44a914c3577c
msgid "**Installing Dependencies**"
msgstr "**安装依赖**"
#: ../../getting_started/install/deploy.rst:312
#: bdc10d2e88cc4c3f84a8c4a8dc2037a9
msgid ""
"llama.cpp is an optional dependency in DB-GPT, and you can manually "
"install it using the following command:"
msgstr "llama.cpp在DB-GPT中是可选安装项, 你可以通过以下命令进行安装"
#: ../../getting_started/install/deploy.rst:319
#: 9c136493448b43b5b27f66af74ff721e
msgid "**3.Modifying the Configuration File**"
msgstr "**3.修改配置文件**"
#: ../../getting_started/install/deploy.rst:321
#: c835a7dee1dd409fb861e7b886c6dc5b
msgid "Next, you can directly modify your `.env` file to enable llama.cpp."
msgstr "修改`.env`文件使用llama.cpp"
#: ../../getting_started/install/deploy.rst:328
#: ../../getting_started/install/deploy.rst:396
#: 296e6d08409544918fee0c31b1bf195c a81e5d882faf4722b0e10d53f635f53c
msgid ""
"Then you can run it according to `Run <https://db-"
"gpt.readthedocs.io/en/latest/getting_started/install/deploy/deploy.html#run>`_"
msgstr ""
"然后你可以根据 `运行 <https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-"
"cn/zh_CN/latest/getting_started/install/deploy/deploy.html#run>`_ 来运行。"
#: ../../getting_started/install/deploy.rst:331
#: 0f7f487ee11a4e01a95f7c504f0469ba
msgid "**More Configurations**"
msgstr "**更多配置文件**"
#: ../../getting_started/install/deploy.rst:333
#: b0f9964497f64fb5b3740099232cd72b
msgid ""
"In DB-GPT, the model configuration can be done through `{model "
"name}_{config key}`."
msgstr "在DB-GPT中模型配置可以通过`{模型名称}_{配置名}` 来配置。"
#: ../../getting_started/install/deploy.rst:335
#: 7c225de4fe9d4dd3a3c2b2a33802e656
msgid "More Configurations"
msgstr "**更多配置文件**"
#: ../../getting_started/install/deploy.rst:339
#: 5cc1671910314796a9ce0b5107d3c9fe
msgid "Environment Variable Key"
msgstr "环境变量Key"
#: ../../getting_started/install/deploy.rst:340
#: 4359ed4e11bb47ad89a605cbf9016cd5
msgid "Default"
msgstr "默认值"
#: ../../getting_started/install/deploy.rst:341
#: 5cf0efc6d1014665bb9dbdae96bf2726
msgid "Description"
msgstr "描述"
#: ../../getting_started/install/deploy.rst:342
#: e7c291f80a9a40fa90d642901eca02c6
msgid "llama_cpp_prompt_template"
msgstr ""
#: ../../getting_started/install/deploy.rst:343
#: ../../getting_started/install/deploy.rst:346
#: ../../getting_started/install/deploy.rst:352
#: ../../getting_started/install/deploy.rst:358
#: ../../getting_started/install/deploy.rst:364
#: 07dc7fc4e51e4d9faf8e5221bcf03ee0 549f3c57a2e9427880e457e653ce1182
#: 7ad961957f7b49d08e4aff347749b78d c1eab368175c4fa88fe0b471919523b2
#: e2e0bf9903484972b6d20e6837010029
msgid "None"
msgstr ""
#: ../../getting_started/install/deploy.rst:344
#: 6b5044a2009f432c92fcd65db42506d8
msgid ""
"Prompt template name, now support: zero_shot, vicuna_v1.1,alpaca,llama-2"
",baichuan-chat,internlm-chat, If None, the prompt template is "
"automatically determined from model path。"
msgstr ""
"Prompt template 现在可以支持`zero_shot, vicuna_v1.1,alpaca,llama-2,baichuan-"
"chat,internlm-chat`, 如果是None, 可以根据模型路径来自动获取模型 Prompt template"
#: ../../getting_started/install/deploy.rst:345
#: e01c860441ad43b88c0a8d012f97d2d8
msgid "llama_cpp_model_path"
msgstr ""
#: ../../getting_started/install/deploy.rst:347
#: 1cb68d772e454812a1a0c6de4950b8ce
msgid "Model path"
msgstr "模型路径"
#: ../../getting_started/install/deploy.rst:348
#: 6dac03820edb4fbd8a0856405e84c5bc
msgid "llama_cpp_n_gpu_layers"
msgstr ""
#: ../../getting_started/install/deploy.rst:349
#: 8cd5607b7941427f9a342ca7a00e5778
msgid "1000000000"
msgstr ""
#: ../../getting_started/install/deploy.rst:350
#: 61c9297656da434aa7ac2b49cf61ea9d
msgid ""
"Number of layers to offload to the GPU, Set this to 1000000000 to offload"
" all layers to the GPU. If your GPU VRAM is not enough, you can set a low"
" number, eg: 10"
msgstr "要将多少网络层转移到GPU上将其设置为1000000000以将所有层转移到GPU上。如果您的 GPU 内存不足可以设置较低的数字例如10。"
#: ../../getting_started/install/deploy.rst:351
#: 8c2d2182557a483aa2fda590c24faaf3
msgid "llama_cpp_n_threads"
msgstr ""
#: ../../getting_started/install/deploy.rst:353
#: cc442f61ffc442ecbd98c1e7f5598e1a
msgid ""
"Number of threads to use. If None, the number of threads is automatically"
" determined"
msgstr "要使用的线程数量。如果为None则线程数量将自动确定。"
#: ../../getting_started/install/deploy.rst:354
#: 8d5e917d86f048348106e6923638a0c2
msgid "llama_cpp_n_batch"
msgstr ""
#: ../../getting_started/install/deploy.rst:355
#: ee2719a0a8cd4a77846cffd8e675638f
msgid "512"
msgstr ""
#: ../../getting_started/install/deploy.rst:356
#: 845b354315384762a611ad2daa539d57
msgid "Maximum number of prompt tokens to batch together when calling llama_eval"
msgstr "在调用llama_eval时批处理在一起的prompt tokens的最大数量"
#: ../../getting_started/install/deploy.rst:357
#: a95e788bfa5f46f3bcd6356dfd9f87eb
msgid "llama_cpp_n_gqa"
msgstr ""
#: ../../getting_started/install/deploy.rst:359
#: 23ad9b5f34b5440bb90b2b21bab25763
msgid "Grouped-query attention. Must be 8 for llama-2 70b."
msgstr "对于 llama-2 70B 模型Grouped-query attention 必须为8。"
#: ../../getting_started/install/deploy.rst:360
#: 9ce25b7966fc40ec8be47ecfaf5f9994
msgid "llama_cpp_rms_norm_eps"
msgstr ""
#: ../../getting_started/install/deploy.rst:361
#: 58365f0d36af447ba976213646018431
msgid "5e-06"
msgstr ""
#: ../../getting_started/install/deploy.rst:362
#: d00b742a759140b795ba5949f1ce9a36
msgid "5e-6 is a good value for llama-2 models."
msgstr "对于llama-2模型来说5e-6是一个不错的值。"
#: ../../getting_started/install/deploy.rst:363
#: b9972e9b19354f55a5e6d9c50513a620
msgid "llama_cpp_cache_capacity"
msgstr ""
#: ../../getting_started/install/deploy.rst:365
#: 3c98c5396dd74db8b6d70fc50fa0754f
msgid "Maximum cache capacity. Examples: 2000MiB, 2GiB"
msgstr "模型缓存最大值. 例如: 2000MiB, 2GiB"
#: ../../getting_started/install/deploy.rst:366
#: 4277e155992c4442b69d665d6269bed6
msgid "llama_cpp_prefer_cpu"
msgstr ""
#: ../../getting_started/install/deploy.rst:367
#: 049169c1210a4ecabb25702ed813ea0a
msgid "False"
msgstr ""
#: ../../getting_started/install/deploy.rst:368
#: 60a39e93e7874491a93893de78b7d37e
msgid ""
"If a GPU is available, it will be preferred by default, unless "
"prefer_cpu=False is configured."
msgstr "如果有可用的GPU默认情况下会优先使用GPU除非配置了 prefer_cpu=False。"
#: ../../getting_started/install/deploy.rst:371
#: 7c86780fbf634de8873afd439389cf89
msgid "vllm"
msgstr ""
#: ../../getting_started/install/deploy.rst:373
#: e2827892e43d420c85b8b83c4855d197
msgid "vLLM is a fast and easy-to-use library for LLM inference and serving."
msgstr "vLLM 是一个快速且易于使用的 LLM 推理和服务的库。"
#: ../../getting_started/install/deploy.rst:375
#: 81bbfa3876a74244acc82d295803fdd4
msgid "**Running vLLM**"
msgstr "**运行vLLM**"
#: ../../getting_started/install/deploy.rst:377
#: 75bc518b444c417ba4d9c15246549327
msgid "**1.Installing Dependencies**"
msgstr "**1.安装依赖**"
#: ../../getting_started/install/deploy.rst:379
#: 725c620b0a5045c1a64a3b2a2e9b48f3
msgid ""
"vLLM is an optional dependency in DB-GPT, and you can manually install it"
" using the following command:"
msgstr "vLLM 在 DB-GPT 是一个可选依赖, 你可以使用下面的命令手动安装它:"
#: ../../getting_started/install/deploy.rst:385
#: 6f4b540107764f3592cc07cf170e4911
msgid "**2.Modifying the Configuration File**"
msgstr "**2.修改配置文件**"
#: ../../getting_started/install/deploy.rst:387
#: b8576a1572674c4890e09b73e02cf0e8
msgid "Next, you can directly modify your .env file to enable vllm."
msgstr "你可以直接修改你的 `.env` 文件"
#: ../../getting_started/install/deploy.rst:394
#: b006745f3aee4651aaa0cf79081b5d7f
msgid ""
"You can view the models supported by vLLM `here "
"<https://vllm.readthedocs.io/en/latest/models/supported_models.html"
"#supported-models>`_"
msgstr ""
"你可以在 `这里 "
"<https://vllm.readthedocs.io/en/latest/models/supported_models.html"
"#supported-models>`_ 查看 vLLM 支持的模型。"
#: ../../getting_started/install/deploy.rst:403
#: bc8057ee75e14737bf8fca3ceb555dac
msgid "3.Prepare sql example(Optional)"
msgstr "3.准备 sql example(可选)"
#: ../../getting_started/install/deploy.rst:404
#: 9b0b9112237c4b3aaa1dd5d704ea32e6
msgid "**(Optional) load examples into SQLite**"
msgstr "**(可选) 加载样例数据到 SQLite 数据库中**"
#: ../../getting_started/install/deploy.rst:411
#: 0815e13b96264ffcba1526c82ba2e7c8
msgid "On windows platform:"
msgstr "在 Windows 平台:"
#: ../../getting_started/install/deploy.rst:418
#: 577a4167ecac4fa88586961f225f0487
msgid "4.Run db-gpt server"
msgstr "4.运行db-gpt server"
#: ../../getting_started/install/deploy.rst:424
#: a9f96b064b674f80824257b4b0a18e2a
msgid "**Open http://localhost:5000 with your browser to see the product.**"
msgstr "打开浏览器访问http://localhost:5000"
#~ msgid ""
#~ "DB-GPT can be deployed on servers"
#~ " with low hardware requirements or on"
#~ " servers with high hardware requirements."
#~ " You can install DB-GPT by "
#~ "Using third-part LLM REST API "
#~ "Service OpenAI, Azure."
#~ msgstr ""
#~ msgid ""
#~ "And you can also install DB-GPT"
#~ " by deploy LLM Service by download"
#~ " LLM model."
#~ msgstr ""
#~ msgid "百川"
#~ msgstr ""
#~ msgid "百川 硬件要求"
#~ msgstr ""

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 👏👏 0.3.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-10-20 22:29+0800\n"
"POT-Creation-Date: 2023-10-26 11:34+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
@@ -20,47 +20,47 @@ msgstr ""
"Generated-By: Babel 2.12.1\n"
#: ../../getting_started/install/deploy/deploy.md:1
#: 7bcf028ff0884ea88f25b7e2c9608153
#: c9d9195862204bb9b526d728b1527a98
msgid "Installation From Source"
msgstr "源码安装"
#: ../../getting_started/install/deploy/deploy.md:3
#: 61f0b1135c84423bbaeb5f9f0942ad7d
#: e462f24ec27645c3afd23866fdeea761
msgid ""
"This tutorial gives you a quick walkthrough about use DB-GPT with you "
"environment and data."
msgstr "本教程为您提供了关于如何使用DB-GPT的使用指南。"
#: ../../getting_started/install/deploy/deploy.md:5
#: d7622cd5f69f4a32b3c8e979c6b9f601
#: 065a4cf91565437cbad46726e5aee89c
msgid "Installation"
msgstr "安装"
#: ../../getting_started/install/deploy/deploy.md:7
#: 4368072b6384496ebeaff3c09ca2f888
#: 07ebe19dbb5040419c6016258d975904
msgid "To get started, install DB-GPT with the following steps."
msgstr "请按照以下步骤安装DB-GPT"
#: ../../getting_started/install/deploy/deploy.md:9
#: 0dfdf8ac6e314fe7b624a685d9beebd5
#: 1a552a8bb4fe481ba7695e1a2f8985f8
msgid "1. Hardware Requirements"
msgstr "1. 硬件要求"
#: ../../getting_started/install/deploy/deploy.md:10
#: cff920f8732f4f1da3063ec2bc099271
#: bd292acafdb74b99a570c4a8e126df5d
msgid ""
"DB-GPT can be deployed on servers with low hardware requirements or on "
"servers with high hardware requirements."
msgstr "DB-GPT可以部署在对硬件要求不高的服务器也可以部署在对硬件要求高的服务器"
#: ../../getting_started/install/deploy/deploy.md:12
#: 8e3818824d6146c6b265731c277fbd0b
#: 913c8d0630f2460997fb856b81967903
#, fuzzy
msgid "Low hardware requirements"
msgstr "1. 硬件要求"
#: ../../getting_started/install/deploy/deploy.md:13
#: ca95d66526994173ac1fea20bdea5d67
#: 70ca521385c642049789e14ab61bc46b
msgid ""
"The low hardware requirements mode is suitable for integrating with "
"third-party LLM services' APIs, such as OpenAI, Tongyi, Wenxin, or "
@@ -68,23 +68,23 @@ msgid ""
msgstr "Low hardware requirements模式适用于对接第三方模型服务的api,比如OpenAI, 通义千问, 文心.cpp。"
#: ../../getting_started/install/deploy/deploy.md:15
#: 83fc53cc1b4248139f69f490b859ad8d
#: 7aacaa2505c447bfa3d0ef6418ae73d2
msgid "DB-GPT provides set proxy api to support LLM api."
msgstr "DB-GPT可以通过设置proxy api来支持第三方大模型服务"
#: ../../getting_started/install/deploy/deploy.md:17
#: 418a9f24eafc4571b74d86c3f1e57a2d
#: 6b5a9f7d61d54a559363a9a5d270a580
msgid "As our project has the ability to achieve ChatGPT performance of over 85%,"
msgstr "由于我们的项目有能力达到85%以上的ChatGPT性能"
#: ../../getting_started/install/deploy/deploy.md:19
#: 6f85149ab0024cc99e43804206a595ed
#: cf4b1f1115c041cbafb15af61946378c
#, fuzzy
msgid "High hardware requirements"
msgstr "1. 硬件要求"
#: ../../getting_started/install/deploy/deploy.md:20
#: 31635ffff5084814a14deb3220dd2c17
#: dae1e9a698144a919dc3740cd676eb81
#, fuzzy
msgid ""
"The high hardware requirements mode is suitable for independently "
@@ -98,67 +98,67 @@ msgstr ""
"chatglmvicuna等私有大模型所以对硬件有一定的要求。但总体来说我们在消费级的显卡上即可完成项目的部署使用具体部署的硬件说明如下:"
#: ../../getting_started/install/deploy/deploy.md
#: d806b90be1614ad3b2e06c92f4b17e5c
#: a6457364eccd49c99dc6a020a9aa5185
msgid "GPU"
msgstr "GPU"
#: ../../getting_started/install/deploy/deploy.md
#: 4b02f41145484389ace0b547384ac269 bbba2ff3fab94482a1761264264deef9
#: 2d737c43c9fd45efbaf1e4204227ab51 bc0aa12f56dd4d26af74d7c10187fc0c
msgid "VRAM Size"
msgstr "显存"
#: ../../getting_started/install/deploy/deploy.md
#: 0ea63c2dcc0e43858a61e01d59ad09f9
#: 8bfd4e58a63a42858b6be2d0ce11b2fa
msgid "Performance"
msgstr "Performance"
#: ../../getting_started/install/deploy/deploy.md
#: 6521683eb91e450c928a72688550a63d
#: 9ff11248bfdc43e18e6c29ed95d4f807
msgid "RTX 4090"
msgstr "RTX 4090"
#: ../../getting_started/install/deploy/deploy.md
#: bb6340c9cdc048fbb0ed55defc1aaeb6 d991b39845ee404198e1a1e35cc416f3
#: 229e141d0a0e4d558b11c204654f36a9 94a76fe065164a67883a79f75d10139c
msgid "24 GB"
msgstr "24 GB"
#: ../../getting_started/install/deploy/deploy.md
#: 4134d3a89d364e33b2bdf1c7667e4755
#: 2edf99edf84e43ea8a5dce2a5ad0056a
msgid "Smooth conversation inference"
msgstr "丝滑的对话体验"
#: ../../getting_started/install/deploy/deploy.md
#: 096ff425ac7646a990a7133961c6e6af
#: df67002e7eb84939a1f452acc88a1fa2
msgid "RTX 3090"
msgstr "RTX 3090"
#: ../../getting_started/install/deploy/deploy.md
#: ecf670cdbec3493f804e6a785a83c608
#: 333303d5e7054d2697f11bb2b53e92ec
msgid "Smooth conversation inference, better than V100"
msgstr "丝滑的对话体验性能好于V100"
#: ../../getting_started/install/deploy/deploy.md
#: 837b14e0a3d243bda0df7ab35b70b7e7
#: acfb9e152ec74bacb715cd758a9be964
msgid "V100"
msgstr "V100"
#: ../../getting_started/install/deploy/deploy.md
#: 3b20a087c8e342c89ccb807ffc3817c2 b8b6b45253084436a5893896b35a2bd5
#: 1127ebc45a1b4fdb828f13d55f99ce79 ed6dd464a7f640cd866712eb7f4d4b1b
msgid "16 GB"
msgstr "16 GB"
#: ../../getting_started/install/deploy/deploy.md
#: 772e18bb0ace4f7ea68b51bfc05816ce 9351389a1fac479cbe67b1f8c2c37de5
#: 0b6ef92756204be6984f39ee1b95d423 a5aad9380cd742c59934e5ead433a22e
msgid "Conversation inference possible, noticeable stutter"
msgstr "Conversation inference possible, noticeable stutter"
#: ../../getting_started/install/deploy/deploy.md
#: aadb62bf48bb49d99a714bcdf3092260
#: 7a5a394f02b04cdcb3a9785cfa0cfc7c
msgid "T4"
msgstr "T4"
#: ../../getting_started/install/deploy/deploy.md:30
#: 4de80d9fcf34470bae806d829836b7d7
#: 055b00b30901485a841d958a63750341
#, fuzzy
msgid ""
"If your VRAM Size is not enough, DB-GPT supported 8-bit quantization and "
@@ -166,109 +166,109 @@ msgid ""
msgstr "如果你的显存不够DB-GPT支持8-bit和4-bit量化版本"
#: ../../getting_started/install/deploy/deploy.md:32
#: 00d81cbf48b549f3b9128d3840d01b2e
#: 34175af61e2e4ecc9e56180b8872a30b
msgid ""
"Here are some of the VRAM size usage of the models we tested in some "
"common scenarios."
msgstr "这里是量化版本的相关说明"
#: ../../getting_started/install/deploy/deploy.md
#: dc346f2bca794bb7ae34b330e82ccbcf
#: 1d1adf0f341b4ed7b47887c5923fbe08
msgid "Model"
msgstr "Model"
#: ../../getting_started/install/deploy/deploy.md
#: 8de6cd40de78460ba774650466f8df26
#: 2e36f6ffdb084de3ae3d1568af60cecc
msgid "Quantize"
msgstr "Quantize"
#: ../../getting_started/install/deploy/deploy.md
#: 3e412b8f4852482ab07a0f546e37ae7f f30054e0558b41a192cc9a2462b299ec
#: 54df9f9813274db482a683c001003e86 61380cdbc434467fbf9cb7cb1efe49b7
msgid "vicuna-7b-v1.5"
msgstr "vicuna-7b-v1.5"
#: ../../getting_started/install/deploy/deploy.md
#: 14358fa40cf94614acf39a803987631f 2a3f52b26b444783be04ffa795246a03
#: 3956734b19aa44c3be08d56348b47a38 751034ca7d00447895fda1d9b8a7364f
#: a66d16e5424a42a3a1309dfb8ffc33f9 b8ebce0a9e7e481da5f16214f955665d
#: f533b3f37e6f4594aec5e0f59f241683
#: 4390ae926c094187bf2905361a5d6cff 467d31fb940c4daf9b2afec6bb7ea7f0
#: 525896b27182457486018a348c068c01 6788cb202dc044e59e6ae42936b1aca8
#: 74e07aaf7fa7461e824c653129240ad1 83b491c17b434fdb910b92c4cbc007a0
#: c14cc4d0ac384fc699a196bf62573f01
msgid "4-bit"
msgstr "4-bit"
#: ../../getting_started/install/deploy/deploy.md
#: 9eac7e866ebe45169c64a952c363ce43 aa56722db3014abd9022067ed5fc4f98
#: af4df898fb47471fbb487fcf6e2d40d6
#: 25bbb9742e604003aeb2da782e50fa46 334153c71b624064b4f50342ab79c30e
#: 6039634dfcfc4ad3a3298938534ef1e4
msgid "8 GB"
msgstr "8 GB"
#: ../../getting_started/install/deploy/deploy.md
#: 211aaf2e234d46108b5eee5006d5f4bb 40214b2f71ce452db3501ea9d81a0c8a
#: 72fcd5e0634e48d79813f1037e6acb45 7756b67568cc40c4b73079b26e79c85d
#: 8c21f8e90154407682c093a46b93939d ad937c14bbcd41ac92a3dbbdb8339eed
#: d1e7ee217dd64b15b934456c3a72c450
#: 0d31a4a235b949eabd8e98c2dcb6d5ff 15bcdb7aedf1497fb0790c1bf3e5ee47
#: 3125bc143cb0476db0a07b7788bc9928 be257ed0772d448b95873db9e044a713
#: cf4e3ed197a84dba87a60cc5fc70f8ac eb399647bafe418c90212787e695afbb
#: ee40d24463a143ca8768da7423d25b9b
msgid "8-bit"
msgstr "8-bit"
#: ../../getting_started/install/deploy/deploy.md
#: 4812504dfb9a4b25a5db773d9a08f34f 76ae2407ba4e4013953b9f243d9a5d92
#: 927054919de047fd8a83df67e1400622 9773e73eb89847f8a85a2dc55b562916
#: ce33d0c3792f43398fc7e2694653d8fc d3dc0d4cceb24d2b9dc5c7120fbed94e
#: 21efb501692440cf80fd29401e1f0afa 246e4fc9b5f44f42a36bb49fd65c08f2
#: 9adc65ad9d9344efa83f3507fb6ed2fd b00fd0d15bf441f48f9ea75d8877d4fd
#: d92aa46491b442a69709b9b8d7322c2e f8499e166ca04bc2a84bfa2d42cee890
msgid "12 GB"
msgstr "12 GB"
#: ../../getting_started/install/deploy/deploy.md
#: 83e6d6ba1aa74946858f0162424752ab b6b99caeaeff44c488e3e819ed337074
#: 39950e71d2884d2c8ce4dbc9b0cb4491 ab3349160edf447ea67b15d7a056cc6e
msgid "vicuna-13b-v1.5"
msgstr "vicuna-13b-v1.5"
#: ../../getting_started/install/deploy/deploy.md
#: 492c5f0d560946fe879f6c339975ba37 970063dda21e4dd8be6f89a3c87832a5
#: a66bad6054b24dd99b370312bc8b6fa6
#: 53bd397b40e449988d9fdfd201030387 6123ea3af97f4f3dafc6be44ecfed416
#: f493c256788e4a318cf57fa9340948a4
msgid "20 GB"
msgstr "20 GB"
#: ../../getting_started/install/deploy/deploy.md
#: a75f3405085441d8920db49f159588d2 cf635931c55846aea4cbccd92e4f0377
#: 11903db1ac944b60a40c92f752c1f3dc 76831b0fad014348a081f3f64260c73e
msgid "llama-2-7b"
msgstr "llama-2-7b"
#: ../../getting_started/install/deploy/deploy.md
#: 61d632df8c5149b393d03ac802141125 bc98c895d457495ea26e3537de83b432
#: 2576bd18e1714557b33420e5ed56a95b 997fe3a3a46e4891b39171b81386a601
msgid "llama-2-13b"
msgstr "llama-2-13b"
#: ../../getting_started/install/deploy/deploy.md
#: 3ccb1f6d8a924aeeacb5373edc168103 9ecce68e159a4649a8d5e69157af17a1
#: 8a1cf1ae302c4c2d8bfbb1a666cc9ba6 9cbe2dae8bf44181b24d9806b654b80f
msgid "llama-2-70b"
msgstr "llama-2-70b"
#: ../../getting_started/install/deploy/deploy.md
#: ca1da6ce08674b3daa0ab9ee0330203f
#: d5e875e84f534aac8f2cac4eacde7ead
msgid "48 GB"
msgstr "48 GB"
#: ../../getting_started/install/deploy/deploy.md
#: 34d4d20e57c1410fbdcabd09a5968cdd
#: 2e32ea59cce24ff0a96c8c152afeb09b
msgid "80 GB"
msgstr "80 GB"
#: ../../getting_started/install/deploy/deploy.md
#: 4ec2213171054c96ac9cd46e259ce7bf 68a1752f76a54287a73e82724723ea75
#: 176feab13e554986a1e09ce3c1d060ee edcf6676d3274fd3a578d337894467bf
msgid "baichuan-7b"
msgstr "baichuan-7b"
#: ../../getting_started/install/deploy/deploy.md
#: 103b020a575744ad964c60a367aa1651 c659a720a1024869b09d7cc161bcd8a2
#: 3da976a65887483abc029acb7e7640d4 837745bfb1ac41a99604f55e94fd4099
msgid "baichuan-13b"
msgstr "baichuan-13b"
#: ../../getting_started/install/deploy/deploy.md:51
#: 2259a008d0e14f9e8d1e1d9234b97298
#: 3c573a548e6a4767b4acc2e4d2dbd20c
msgid "2. Install"
msgstr "2. Install"
#: ../../getting_started/install/deploy/deploy.md:56
#: 875c7d8e32574552a48199577c78ccdd
#: 40d61f4ee30d4d70a45a0ffb97001cd6
msgid ""
"We use Sqlite as default database, so there is no need for database "
"installation. If you choose to connect to other databases, you can "
@@ -283,7 +283,7 @@ msgstr ""
" Miniconda](https://docs.conda.io/en/latest/miniconda.html)"
#: ../../getting_started/install/deploy/deploy.md:67
#: c03e3290e1144320a138d015171ac596
#: 69c950c69b204b94a768d1f023cc978a
msgid ""
"Once the environment is installed, we have to create a new folder "
"\"models\" in the DB-GPT project, and then we can put all the models "
@@ -291,49 +291,48 @@ msgid ""
msgstr "如果你已经安装好了环境需要创建models, 然后到huggingface官网下载模型"
#: ../../getting_started/install/deploy/deploy.md:70
#: 933401ac909741ada4acf6bcd4142ed6
#: 2ab1a4d9de8e412f80bd04ce6b40cdf6
msgid "Notice make sure you have install git-lfs"
msgstr "注意确认你已经安装了git-lfs"
#: ../../getting_started/install/deploy/deploy.md:72
#: e8e4886a83dd402c85fe3fa989322991
#: e718db01f5404485a05857b8403df93c
msgid "centos:yum install git-lfs"
msgstr ""
#: ../../getting_started/install/deploy/deploy.md:74
#: 5ead7e98bddf4fa4845c3d3955f18054
#: e98570774d28430295a094cc5f5220ae
msgid "ubuntu:apt-get install git-lfs"
msgstr ""
#: ../../getting_started/install/deploy/deploy.md:76
#: 08acfaaaa2544182a59df54cdf61cd84
#: 34c33b64b8de4b00be92b525ad038f23
msgid "macos:brew install git-lfs"
msgstr ""
#: ../../getting_started/install/deploy/deploy.md:78
#: 312ad44170c34531865576067c58701a
#: 34bd5fbc8a8c4898a4caa7d630137061
msgid "Download LLM Model and Embedding Model"
msgstr "下载LLM模型和Embedding模型"
#: ../../getting_started/install/deploy/deploy.md:80
#: de54793643434528a417011d2919b2c4
#: a67d0e365e684a3bbb5e8618c98884ce
#, fuzzy
msgid ""
"If you use OpenAI llm service, see [LLM Use FAQ](https://db-"
"gpt.readthedocs.io/en/latest/getting_started/faq/llm/llm_faq.html)"
msgstr ""
"如果想使用openai大模型服务, 可以参考[LLM Use FAQ](https://db-"
"gpt.readthedocs.io/en/latest/getting_started/faq/llm/llm_faq.html)"
"If you use OpenAI llm service, see [How to Use LLM REST API](https://db-"
"gpt.readthedocs.io/en/latest/getting_started/install/llm/proxyllm/proxyllm.html)"
msgstr "如果想使用openai大模型服务, 可以参考[如何集成LLM REST API](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh-cn/latest/getting_started/install/llm/proxyllm/proxyllm.html)"
#: ../../getting_started/install/deploy/deploy.md:83
#: 50ec1eb7c56a46ac8fbf911c7adc9b0e
#: f1a43cd2eba3458c863bfc77cf13ac1f
#, fuzzy
msgid ""
"If you use openai or Azure or tongyi llm api service, you don't need to "
"If you use openai or Axzure or tongyi llm api service, you don't need to "
"download llm model."
msgstr "如果你想通过openai or Azure or tongyi第三方api访问模型服务你可以不用下载llm模型"
#: ../../getting_started/install/deploy/deploy.md:103
#: 03950b2a480149388fb7b88f7d251ef5
#: 9f46746726ec4791b6963a2e2c4376c4
msgid ""
"The model files are large and will take a long time to download. During "
"the download, let's configure the .env file, which needs to be copied and"
@@ -341,19 +340,19 @@ msgid ""
msgstr "模型文件很大,需要很长时间才能下载。在下载过程中,让我们配置.env文件它需要从。env.template中复制和创建。"
#: ../../getting_started/install/deploy/deploy.md:106
#: 441c4333216a402a84fd52f8e56fc81b
#: 53e713c8a9664d92a6e4055789c4a7da
msgid "cp .env.template .env"
msgstr "cp .env.template .env"
#: ../../getting_started/install/deploy/deploy.md:109
#: 4eac3d98df6a4e788234ff0ec1ffd03e
#: 21c38ebc721242478e7ad4be4d672dc6
msgid ""
"You can configure basic parameters in the .env file, for example setting "
"LLM_MODEL to the model to be used"
msgstr "您可以在.env文件中配置基本参数例如将LLM_MODEL设置为要使用的模型。"
#: ../../getting_started/install/deploy/deploy.md:111
#: a36bd6d6236b4c74b161a935ae792b91
#: 6ca180c2142b455ebcc3a8b37f3bc25a
msgid ""
"([Vicuna-v1.5](https://huggingface.co/lmsys/vicuna-13b-v1.5) based on "
"llama-2 has been released, we recommend you set `LLM_MODEL=vicuna-"
@@ -364,39 +363,39 @@ msgstr ""
"目前Vicuna-v1.5模型(基于llama2)已经开源了我们推荐你使用这个模型通过设置LLM_MODEL=vicuna-13b-v1.5"
#: ../../getting_started/install/deploy/deploy.md:113
#: 78334cbf0c364eb3bc41a2a6c55ebb0d
#: 1a346658ec4b4074b3458fc806538aae
msgid "3. Run"
msgstr "3. Run"
#: ../../getting_started/install/deploy/deploy.md:115
#: 6d5ad6eb067d4e9fa1c574b7b706233f
#: 70f6300673834c9eb3e80145bb5bfcb8
msgid "**(Optional) load examples into SQLite**"
msgstr ""
#: ../../getting_started/install/deploy/deploy.md:120
#: 07219a4ed3c44e349314ae04ebdf58e1
#: c10f16bd300e473a950617b814d743a0
msgid "On windows platform:"
msgstr ""
#: ../../getting_started/install/deploy/deploy.md:125
#: 819be2bb22044440ae00c2e7687ea249
#: 64213616228643a7b0413805061b7a12
#, fuzzy
msgid "Run db-gpt server"
msgstr "1.Run db-gpt server"
#: ../../getting_started/install/deploy/deploy.md:131
#: 5ba6d7c9bf9146c797036ab4b9b4f59e
#: cb3248ebbade45bfba1366a66e4220f6
msgid "Open http://localhost:5000 with your browser to see the product."
msgstr "打开浏览器访问http://localhost:5000"
#: ../../getting_started/install/deploy/deploy.md:134
#: be3a2729ef3b4742a403017b31bda7e3
#: 0499acfd344b4d70a0cdce31f245971c
#, fuzzy
msgid "Multiple GPUs"
msgstr "4. Multiple GPUs"
#: ../../getting_started/install/deploy/deploy.md:136
#: 00ffa1cc145e4afa830c592a629246f9
#: d56b6c4aa795428aa64e3740401645d3
msgid ""
"DB-GPT will use all available gpu by default. And you can modify the "
"setting `CUDA_VISIBLE_DEVICES=0,1` in `.env` file to use the specific gpu"
@@ -404,32 +403,32 @@ msgid ""
msgstr "DB-GPT默认加载可利用的gpu你也可以通过修改 在`.env`文件 `CUDA_VISIBLE_DEVICES=0,1`来指定gpu IDs"
#: ../../getting_started/install/deploy/deploy.md:138
#: bde32a5a8fea4350868be579e9ee6baa
#: ca208283904441ab802827d94b3b9590
msgid ""
"Optionally, you can also specify the gpu ID to use before the starting "
"command, as shown below:"
msgstr "你也可以指定gpu ID启动"
#: ../../getting_started/install/deploy/deploy.md:148
#: 791ed2db2cff44c48342a7828cbd4c45
#: 30f7c3b3d9784a4698cdd15a0c046e81
msgid ""
"You can modify the setting `MAX_GPU_MEMORY=xxGib` in `.env` file to "
"configure the maximum memory used by each GPU."
msgstr "同时你可以通过在.env文件设置`MAX_GPU_MEMORY=xxGib`修改每个GPU的最大使用内存"
#: ../../getting_started/install/deploy/deploy.md:150
#: f86b37c8943e4f5595610706e75b4add
#: ab02884bb7f24e59b21b797501c3794b
#, fuzzy
msgid "Not Enough Memory"
msgstr "5. Not Enough Memory"
#: ../../getting_started/install/deploy/deploy.md:152
#: 8a7bd02cbeca497aa8eecaaf1910a6ad
#: 5b246b0456f8448bb0207312a17d40c5
msgid "DB-GPT supported 8-bit quantization and 4-bit quantization."
msgstr "DB-GPT 支持 8-bit quantization 和 4-bit quantization."
#: ../../getting_started/install/deploy/deploy.md:154
#: 5ad49b99fe774ba79c50de0cd694807c
#: a002dc2572d34b0f9b3ca6ac3b3b6147
msgid ""
"You can modify the setting `QUANTIZE_8bit=True` or `QUANTIZE_4bit=True` "
"in `.env` file to use quantization(8-bit quantization is enabled by "
@@ -437,7 +436,7 @@ msgid ""
msgstr "你可以通过在.env文件设置`QUANTIZE_8bit=True` or `QUANTIZE_4bit=True`"
#: ../../getting_started/install/deploy/deploy.md:156
#: b9c80e92137447da91eb944443144c69
#: 16d429bd42a44b02875e505273d35228
msgid ""
"Llama-2-70b with 8-bit quantization can run with 80 GB of VRAM, and 4-bit"
" quantization can run with 48 GB of VRAM."

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 👏👏 0.3.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-17 13:07+0800\n"
"POT-Creation-Date: 2023-11-14 16:08+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
@@ -20,290 +20,287 @@ msgstr ""
"Generated-By: Babel 2.12.1\n"
#: ../../getting_started/install/environment/environment.md:1
#: be341d16f7b24bf4ad123ab78a6d855a
#: e4787ab6eacc4362802752528bb786ec
#, fuzzy
msgid "Environment Parameter"
msgstr "环境变量说明"
#: ../../getting_started/install/environment/environment.md:4
#: 46eddb27c90f41548ea9a724bbcebd37
#: 4682a0734a034e0e9f2c22fa061b889e
msgid "LLM MODEL Config"
msgstr "模型配置"
#: ../../getting_started/install/environment/environment.md:5
#: 7deaa85df4a04fb098f5994547a8724f
#: c148f178b2964344a570bb2b3713fba3
msgid "LLM Model Name, see /pilot/configs/model_config.LLM_MODEL_CONFIG"
msgstr "LLM Model Name, see /pilot/configs/model_config.LLM_MODEL_CONFIG"
#: ../../getting_started/install/environment/environment.md:6
#: 3902801c546547b3a4009df681ef7d52
#: 9ab8d82fb338439a8c0042b92ad2f7c4
msgid "LLM_MODEL=vicuna-13b"
msgstr "LLM_MODEL=vicuna-13b"
#: ../../getting_started/install/environment/environment.md:8
#: 84b0fdbfa1544ec28751e9b69b00cc02
#: 76fb3b1299694730852f120db6fec7f9
msgid "MODEL_SERVER_ADDRESS"
msgstr "MODEL_SERVER_ADDRESS"
#: ../../getting_started/install/environment/environment.md:9
#: 0b430bfab77d405989470d00ca3f6fe0
msgid "MODEL_SERVER=http://127.0.0.1:8000 LIMIT_MODEL_CONCURRENCY"
#: ../../getting_started/install/environment/environment.md:10
#: 7476a0ee342f4517bbf999abecec029e
#, fuzzy
msgid "MODEL_SERVER=http://127.0.0.1:8000"
msgstr "MODEL_SERVER=http://127.0.0.1:8000 LIMIT_MODEL_CONCURRENCY"
#: ../../getting_started/install/environment/environment.md:12
#: b477a25586c546729a93fb6785b7b2ec
msgid "LIMIT_MODEL_CONCURRENCY=5"
#: fb3c73990a6443e8b63c35d61175e467
#, fuzzy
msgid "LIMIT_MODEL_CONCURRENCY"
msgstr "LIMIT_MODEL_CONCURRENCY=5"
#: ../../getting_started/install/environment/environment.md:14
#: 1d6ea800af384fff9c265610f71cc94e
#: 0eb187fffa3643dbac4bbe7237d2e011
msgid "LIMIT_MODEL_CONCURRENCY=5"
msgstr "LIMIT_MODEL_CONCURRENCY=5"
#: ../../getting_started/install/environment/environment.md:16
#: 1d7b8bf89c1b44e9871d9d0c382db114
msgid "MAX_POSITION_EMBEDDINGS"
msgstr "MAX_POSITION_EMBEDDINGS"
#: ../../getting_started/install/environment/environment.md:16
#: 388e758ce4ea4692a4c34294cebce7f2
#: ../../getting_started/install/environment/environment.md:18
#: 50d0b3f760fd4ff9829cd1ba0653fd79
msgid "MAX_POSITION_EMBEDDINGS=4096"
msgstr "MAX_POSITION_EMBEDDINGS=4096"
#: ../../getting_started/install/environment/environment.md:18
#: 16a307dce1294ceba892ff93ae4e81c0
#: ../../getting_started/install/environment/environment.md:20
#: d07c4bbcde214f5993d73ac2bfb1bf9e
msgid "QUANTIZE_QLORA"
msgstr "QUANTIZE_QLORA"
#: ../../getting_started/install/environment/environment.md:20
#: 93ceb2b2fcd5454b82eefb0ae8c7ae77
#: ../../getting_started/install/environment/environment.md:22
#: 6bceef51780f45d9805270d16847ddc2
msgid "QUANTIZE_QLORA=True"
msgstr "QUANTIZE_QLORA=True"
#: ../../getting_started/install/environment/environment.md:22
#: 15ffa35d023a4530b02a85ee6168dd4b
#: ../../getting_started/install/environment/environment.md:24
#: df9d560f69334e4aa3f6803e40a7f38d
msgid "QUANTIZE_8bit"
msgstr "QUANTIZE_8bit"
#: ../../getting_started/install/environment/environment.md:24
#: 81df248ac5cb4ab0b13a711505f6a177
#: ../../getting_started/install/environment/environment.md:26
#: ac433b8574574432add7315558b845ea
msgid "QUANTIZE_8bit=True"
msgstr "QUANTIZE_8bit=True"
#: ../../getting_started/install/environment/environment.md:27
#: 15cc7b7d41ad44f0891c1189709f00f1
#: ../../getting_started/install/environment/environment.md:29
#: 7b1c407517984bff9f4d509c5f45b92e
msgid "LLM PROXY Settings"
msgstr "LLM PROXY Settings"
#: ../../getting_started/install/environment/environment.md:28
#: e6c1115a39404f11b193a1593bc51a22
#: ../../getting_started/install/environment/environment.md:30
#: ba7d52c0e95143ebb973e7eda69f0bc1
msgid "OPENAI Key"
msgstr "OPENAI Key"
#: ../../getting_started/install/environment/environment.md:30
#: 8157e0a831fe4506a426822b7565e4f6
#: ../../getting_started/install/environment/environment.md:32
#: 0f0bd20a7a60461e8bcfc91297cc3666
msgid "PROXY_API_KEY={your-openai-sk}"
msgstr "PROXY_API_KEY={your-openai-sk}"
#: ../../getting_started/install/environment/environment.md:31
#: 89b34d00bdb64e738bd9bc8c086b1f02
#: ../../getting_started/install/environment/environment.md:33
#: d9c03e0b3316415eb2ca59ad9c419b8c
msgid "PROXY_SERVER_URL=https://api.openai.com/v1/chat/completions"
msgstr "PROXY_SERVER_URL=https://api.openai.com/v1/chat/completions"
#: ../../getting_started/install/environment/environment.md:33
#: 7a97df730aeb484daf19c8172e61a290
#: ../../getting_started/install/environment/environment.md:35
#: 45883f99c1fd494ea513f3c0f92562a3
msgid "from https://bard.google.com/ f12-> application-> __Secure-1PSID"
msgstr "from https://bard.google.com/ f12-> application-> __Secure-1PSID"
#: ../../getting_started/install/environment/environment.md:35
#: d430ddf726a049c0a9e0a9bfd5a6fe0e
#: ../../getting_started/install/environment/environment.md:37
#: 70665dbe72c545a3b61c6efe37dfa7d5
msgid "BARD_PROXY_API_KEY={your-bard-token}"
msgstr "BARD_PROXY_API_KEY={your-bard-token}"
#: ../../getting_started/install/environment/environment.md:38
#: 23d6b0da3e7042abb55f6181c4a382d2
#: ../../getting_started/install/environment/environment.md:40
#: 782f8a9c9cd745a4990542ba8130c66a
msgid "DATABASE SETTINGS"
msgstr "DATABASE SETTINGS"
#: ../../getting_started/install/environment/environment.md:39
#: dbae0a2d847f41f5be9396a160ef88d0
#: ../../getting_started/install/environment/environment.md:41
#: 50ad9eae827a407c8c77692f48b9d423
msgid "SQLite database (Current default database)"
msgstr "SQLite database (Current default database)"
#: ../../getting_started/install/environment/environment.md:40
#: bdb55b7280c341a981e9d338cce53345
#: ../../getting_started/install/environment/environment.md:42
#: 410041683b664cabbe7ce6cb2050c629
msgid "LOCAL_DB_PATH=data/default_sqlite.db"
msgstr "LOCAL_DB_PATH=data/default_sqlite.db"
#: ../../getting_started/install/environment/environment.md:41
#: 739d67927a9d46b28500deba1917916b
#: ../../getting_started/install/environment/environment.md:43
#: 0fcf0f9da84d4e4a8a1503a96dd6734b
msgid "LOCAL_DB_TYPE=sqlite # Database Type default:sqlite"
msgstr "LOCAL_DB_TYPE=sqlite # Database Type default:sqlite"
#: ../../getting_started/install/environment/environment.md:43
#: eb4717bce6a6483b86d9780d924c5ff1
#: ../../getting_started/install/environment/environment.md:45
#: 15fb9cdc51e44b71a1a375e49fb7bc6d
msgid "MYSQL database"
msgstr "MYSQL database"
#: ../../getting_started/install/environment/environment.md:44
#: 0f4cdf0ff5dd4ff0b397dfa88541a2e1
#: ../../getting_started/install/environment/environment.md:46
#: c8cc4cb61d1c44cd9ef3546455929ef6
msgid "LOCAL_DB_TYPE=mysql"
msgstr "LOCAL_DB_TYPE=mysql"
#: ../../getting_started/install/environment/environment.md:45
#: c971ead492c34487bd766300730a9cba
#: ../../getting_started/install/environment/environment.md:47
#: a6caf3cabc4041b5879ec3af25c85139
msgid "LOCAL_DB_USER=root"
msgstr "LOCAL_DB_USER=root"
#: ../../getting_started/install/environment/environment.md:46
#: 02828b29ad044eeab890a2f8af0e5907
#: ../../getting_started/install/environment/environment.md:48
#: b839bde122374e299086f120fce0144c
msgid "LOCAL_DB_PASSWORD=aa12345678"
msgstr "LOCAL_DB_PASSWORD=aa12345678"
#: ../../getting_started/install/environment/environment.md:47
#: 53dc7f15b3934987b1f4c2e2d0b11299
#: ../../getting_started/install/environment/environment.md:49
#: 52cdbfdefda142b4a3b5cb3b060916a8
msgid "LOCAL_DB_HOST=127.0.0.1"
msgstr "LOCAL_DB_HOST=127.0.0.1"
#: ../../getting_started/install/environment/environment.md:48
#: 1ac95fc482934247a118bab8dcebeb57
#: ../../getting_started/install/environment/environment.md:50
#: 492db6e5c13b40898f38063980c5897c
msgid "LOCAL_DB_PORT=3306"
msgstr "LOCAL_DB_PORT=3306"
#: ../../getting_started/install/environment/environment.md:51
#: 34e46aa926844be19c7196759b03af63
#: ../../getting_started/install/environment/environment.md:53
#: 20b101603f054c70af633439abddefec
msgid "EMBEDDING SETTINGS"
msgstr "EMBEDDING SETTINGS"
#: ../../getting_started/install/environment/environment.md:52
#: 2b5aa08cc995495e85a1f7dc4f97b5d7
#: ../../getting_started/install/environment/environment.md:54
#: 3463a5a74cea494c8442100c0069285c
msgid "EMBEDDING MODEL Name, see /pilot/configs/model_config.LLM_MODEL_CONFIG"
msgstr "EMBEDDING模型, 参考see /pilot/configs/model_config.LLM_MODEL_CONFIG"
#: ../../getting_started/install/environment/environment.md:53
#: 0de0ca551ed040248406f848feca541d
#: ../../getting_started/install/environment/environment.md:55
#: 4c8adbf52110474bbfcd3b63cf2839f6
msgid "EMBEDDING_MODEL=text2vec"
msgstr "EMBEDDING_MODEL=text2vec"
#: ../../getting_started/install/environment/environment.md:55
#: 43019fb570904c9981eb68f33e64569c
#: ../../getting_started/install/environment/environment.md:57
#: 8a85a75151e64827971b1a367b31ecfa
msgid "Embedding Chunk size, default 500"
msgstr "Embedding 切片大小, 默认500"
#: ../../getting_started/install/environment/environment.md:57
#: 7e3f93854873461286e96887e04167aa
#: ../../getting_started/install/environment/environment.md:59
#: 947939b0fa7e46de97d48eadf5c443d2
msgid "KNOWLEDGE_CHUNK_SIZE=500"
msgstr "KNOWLEDGE_CHUNK_SIZE=500"
#: ../../getting_started/install/environment/environment.md:59
#: 9504f4a59ae74352a524b7741113e2d6
#: ../../getting_started/install/environment/environment.md:61
#: 2785ad6bb0de4534a6523ac420f2c84c
msgid "Embedding Chunk Overlap, default 100"
msgstr "Embedding chunk Overlap, 文本块之间的最大重叠量。保留一些重叠可以保持文本块之间的连续性(例如使用滑动窗口),默认100"
#: ../../getting_started/install/environment/environment.md:60
#: 24e6119c2051479bbd9dba71a9c23dbe
#: ../../getting_started/install/environment/environment.md:62
#: 40b6a8f57ee14ec1ab73143ba1516e78
msgid "KNOWLEDGE_CHUNK_OVERLAP=100"
msgstr "KNOWLEDGE_CHUNK_OVERLAP=100"
#: ../../getting_started/install/environment/environment.md:62
#: 0d180d7f2230442abee901c19526e442
msgid "embeding recall top k,5"
#: ../../getting_started/install/environment/environment.md:64
#: e410faa1087c45639ee210be99cf9336
#, fuzzy
msgid "embedding recall top k,5"
msgstr "embedding 召回topk, 默认5"
#: ../../getting_started/install/environment/environment.md:64
#: a5bb9ab2ba50411cbbe87f7836bfbb6d
#: ../../getting_started/install/environment/environment.md:66
#: abfca38fe2a04161a11259588fa4d205
msgid "KNOWLEDGE_SEARCH_TOP_SIZE=5"
msgstr "KNOWLEDGE_SEARCH_TOP_SIZE=5"
#: ../../getting_started/install/environment/environment.md:66
#: 183b8dd78cba4ae19bd2e08d69d21e0b
msgid "embeding recall max token ,2000"
#: ../../getting_started/install/environment/environment.md:68
#: 31182c38607b4c3bbc657b5fe5b7a4f6
#, fuzzy
msgid "embedding recall max token ,2000"
msgstr "embedding向量召回最大token, 默认2000"
#: ../../getting_started/install/environment/environment.md:68
#: ce0c711febcb44c18ae0fc858c3718d1
#: ../../getting_started/install/environment/environment.md:70
#: 96cd042635bc468e90c792fd9d1a7f4d
msgid "KNOWLEDGE_SEARCH_MAX_TOKEN=5"
msgstr "KNOWLEDGE_SEARCH_MAX_TOKEN=5"
#: ../../getting_started/install/environment/environment.md:71
#: ../../getting_started/install/environment/environment.md:87
#: 4cab1f399cc245b4a1a1976d2c4fc926 ec9cec667a1c4473bf9a796a26e1ce20
#: ../../getting_started/install/environment/environment.md:73
#: d43b408ad9bc46f2b3c97aa91627f6b3
msgid "Vector Store SETTINGS"
msgstr "Vector Store SETTINGS"
#: ../../getting_started/install/environment/environment.md:72
#: ../../getting_started/install/environment/environment.md:88
#: 4dd04aadd46948a5b1dcf01fdb0ef074 bab7d512f33e40cf9e10f0da67e699c8
#: ../../getting_started/install/environment/environment.md:74
#: b1fcbf6049af4eeea91edd3de58c8512
msgid "Chroma"
msgstr "Chroma"
#: ../../getting_started/install/environment/environment.md:73
#: ../../getting_started/install/environment/environment.md:89
#: 13eec36741b14e028e2d3859a320826e ab3ffbcf9358401993af636ba9ab2e2d
#: ../../getting_started/install/environment/environment.md:75
#: 2fb31575b274448fb945d47ee0eb108c
msgid "VECTOR_STORE_TYPE=Chroma"
msgstr "VECTOR_STORE_TYPE=Chroma"
#: ../../getting_started/install/environment/environment.md:74
#: ../../getting_started/install/environment/environment.md:90
#: d15b91e2a2884f23a1dd2d54783b0638 d1f856d571b547098bb0c2a18f9f1979
#: ../../getting_started/install/environment/environment.md:76
#: 601b87cc6f1d4732b935747e907cba5a
msgid "MILVUS"
msgstr "MILVUS"
#: ../../getting_started/install/environment/environment.md:75
#: ../../getting_started/install/environment/environment.md:91
#: 1e165f6c934343c7808459cc7a65bc70 985dd60c2b7d4baaa6601a810a6522d7
#: ../../getting_started/install/environment/environment.md:77
#: fde6cf6982764020aa1174f7fe3a5b3e
msgid "VECTOR_STORE_TYPE=Milvus"
msgstr "VECTOR_STORE_TYPE=Milvus"
#: ../../getting_started/install/environment/environment.md:76
#: ../../getting_started/install/environment/environment.md:92
#: a1a53f051cee40ed886346a94babd75a d263e8eaee684935a58f0a4fe61c6f0e
#: ../../getting_started/install/environment/environment.md:78
#: 40c6206c7a614edf9b0af82c2c76f518
msgid "MILVUS_URL=127.0.0.1"
msgstr "MILVUS_URL=127.0.0.1"
#: ../../getting_started/install/environment/environment.md:77
#: ../../getting_started/install/environment/environment.md:93
#: 2741a312db1a4c6a8a1c1d62415c5fba d03bbf921ddd4f4bb715fe5610c3d0aa
#: ../../getting_started/install/environment/environment.md:79
#: abde3c75269442cbb94a59c657d847a9
msgid "MILVUS_PORT=19530"
msgstr "MILVUS_PORT=19530"
#: ../../getting_started/install/environment/environment.md:78
#: ../../getting_started/install/environment/environment.md:94
#: d0786490d38c4e4f971cc14f62fe1fc8 e9e0854873dc4c209861ee4eb77d25cd
#: ../../getting_started/install/environment/environment.md:80
#: 375a837cbf6d4d65891612a7f073414a
msgid "MILVUS_USERNAME"
msgstr "MILVUS_USERNAME"
#: ../../getting_started/install/environment/environment.md:79
#: ../../getting_started/install/environment/environment.md:95
#: 9a82d07153cc432ebe754b5bc02fde0d a6485c1cfa7d4069a6894c43674c8c2b
#: ../../getting_started/install/environment/environment.md:81
#: f785a796c8d3452c802d9a637f34cb57
msgid "MILVUS_PASSWORD"
msgstr "MILVUS_PASSWORD"
#: ../../getting_started/install/environment/environment.md:80
#: ../../getting_started/install/environment/environment.md:96
#: 2f233f32b8ba408a9fbadb21fabb99ec 809b3219dd824485bc2cfc898530d708
#: ../../getting_started/install/environment/environment.md:82
#: 18cd17a50dc14add9b31f6b4c55069ef
msgid "MILVUS_SECURE="
msgstr "MILVUS_SECURE="
#: ../../getting_started/install/environment/environment.md:82
#: ../../getting_started/install/environment/environment.md:98
#: f00603661f2b42e1bd2bca74ad1e3c31 f378e16fdec44c559e34c6929de812e8
#: ../../getting_started/install/environment/environment.md:84
#: a4783d775bf2444788b758a71bd5a7e7
msgid "WEAVIATE"
msgstr "WEAVIATE"
#: ../../getting_started/install/environment/environment.md:83
#: da2049ebc6874cf0a6b562e0e2fd9ec7
#: ../../getting_started/install/environment/environment.md:85
#: 3cc5ca99670947e6868e27db588031e0
msgid "VECTOR_STORE_TYPE=Weaviate"
msgstr "VECTOR_STORE_TYPE=Weaviate"
#: ../../getting_started/install/environment/environment.md:84
#: ../../getting_started/install/environment/environment.md:99
#: 25f1246629934289aad7ef01c7304097 c9fe0e413d9a4fc8abf86b3ed99e0581
#: ../../getting_started/install/environment/environment.md:86
#: 141a3da2e36e40ffaa0fb863081a4c07
msgid "WEAVIATE_URL=https://kt-region-m8hcy0wc.weaviate.network"
msgstr "WEAVIATE_URL=https://kt-region-m8hcy0wc.weaviate.network"
#: ../../getting_started/install/environment/environment.md:102
#: ba7c9e707f6a4cd6b99e52b58da3ab2d
#: ../../getting_started/install/environment/environment.md:89
#: fde1941617ec4148b33c298bebeb45e4
msgid "Multi-GPU Setting"
msgstr "Multi-GPU Setting"
#: ../../getting_started/install/environment/environment.md:103
#: 5ca75fdf2c264b2c844d77f659b4f0b3
#: ../../getting_started/install/environment/environment.md:90
#: fe162354e15e42cda54f6c9322409321
msgid ""
"See https://developer.nvidia.com/blog/cuda-pro-tip-control-gpu-"
"visibility-cuda_visible_devices/ If CUDA_VISIBLE_DEVICES is not "
@@ -312,50 +309,50 @@ msgstr ""
"参考 https://developer.nvidia.com/blog/cuda-pro-tip-control-gpu-visibility-"
"cuda_visible_devices/ 如果 CUDA_VISIBLE_DEVICES没有设置, 会使用所有可用的gpu"
#: ../../getting_started/install/environment/environment.md:106
#: de92eb310aff43fbbbf3c5a116c3b2c6
#: ../../getting_started/install/environment/environment.md:93
#: c8a83b09bfc94dab8226840b275ca034
msgid "CUDA_VISIBLE_DEVICES=0"
msgstr "CUDA_VISIBLE_DEVICES=0"
#: ../../getting_started/install/environment/environment.md:108
#: d2641df6123a442b8e4444ad5f01a9aa
#: ../../getting_started/install/environment/environment.md:95
#: a1d33bd2492a4a80bd8b679c1331280a
msgid ""
"Optionally, you can also specify the gpu ID to use before the starting "
"command"
msgstr "你也可以通过启动命令设置gpu ID"
#: ../../getting_started/install/environment/environment.md:110
#: 76c66179d11a4e5fa369421378609aae
#: ../../getting_started/install/environment/environment.md:97
#: 961087a5cf1b45168c7439e3a2103253
msgid "CUDA_VISIBLE_DEVICES=3,4,5,6"
msgstr "CUDA_VISIBLE_DEVICES=3,4,5,6"
#: ../../getting_started/install/environment/environment.md:112
#: 29bd0f01fdf540ad98385ea8473f7647
#: ../../getting_started/install/environment/environment.md:99
#: 545b438ecb9d46edacbd8b4cc95886f9
msgid "You can configure the maximum memory used by each GPU."
msgstr "可以设置GPU的最大内存"
#: ../../getting_started/install/environment/environment.md:114
#: 31e5e23838734ba7a2810e2387e6d6a0
#: ../../getting_started/install/environment/environment.md:101
#: a78dc8082fa04e13a7a3e43302830c26
msgid "MAX_GPU_MEMORY=16Gib"
msgstr "MAX_GPU_MEMORY=16Gib"
#: ../../getting_started/install/environment/environment.md:117
#: 99aa63ab1ae049d9b94536d6a96f3443
#: ../../getting_started/install/environment/environment.md:104
#: eaebcb1784be4047b739ff1b8a78faa1
msgid "Other Setting"
msgstr "Other Setting"
#: ../../getting_started/install/environment/environment.md:118
#: 3168732183874bffb59a3575d3473d62
#: ../../getting_started/install/environment/environment.md:105
#: 21f524662fa34bfa9cfb8855bc191cc7
msgid "Language Settings(influence prompt language)"
msgstr "Language Settings(涉及prompt语言以及知识切片方式)"
#: ../../getting_started/install/environment/environment.md:119
#: 73eb0a96f29b4739bd456faa9cb5033d
#: ../../getting_started/install/environment/environment.md:106
#: bb5ce4a6ee794f0e910363673e54055a
msgid "LANGUAGE=en"
msgstr "LANGUAGE=en"
#: ../../getting_started/install/environment/environment.md:120
#: c6646b78c6cf4d25a13108232f5b2046
#: ../../getting_started/install/environment/environment.md:107
#: 862f113d63b94084b89bfef29f8ab48d
msgid "LANGUAGE=zh"
msgstr "LANGUAGE=zh"

View File

@@ -0,0 +1,97 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2023, csunny
# This file is distributed under the same license as the DB-GPT package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 👏👏 0.4.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-10-26 11:26+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
"Language-Team: zh_CN <LL@li.org>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.12.1\n"
#: ../../getting_started/install/llm/proxyllm/proxyllm.md:1
#: b006d689cfd2430da6a2b503a4f2fef3
msgid "Proxy LLM API"
msgstr "Proxy LLM API"
#: ../../getting_started/install/llm/proxyllm/proxyllm.md:3
#: b60328fb6b074edba31c34825038bbf4
msgid "Now DB-GPT supports connect LLM service through proxy rest api."
msgstr "DB-GPT支持对接第三方的LLM REST API 服务"
#: ../../getting_started/install/llm/proxyllm/proxyllm.md:5
#: 82dcc5fc9d314a6f871851c842c3b6b3
msgid "LLM rest api now supports"
msgstr "LLM REST API服务目前支持"
#: ../../getting_started/install/llm/proxyllm/proxyllm.md:7
#: 2a894db1f42544b2bdc932b50050eaf4
msgid "OpenAI"
msgstr "OpenAI"
#: ../../getting_started/install/llm/proxyllm/proxyllm.md:8
#: 52c288434b6b42a1a376f8d698d0aad1
msgid "Azure"
msgstr "Azure"
#: ../../getting_started/install/llm/proxyllm/proxyllm.md:9
#: eeca0b58cf504586b8695e433e1a4458
msgid "Aliyun tongyi"
msgstr "通义千问API"
#: ../../getting_started/install/llm/proxyllm/proxyllm.md:10
#: 7b30a85b145545f0b2d8dd3b85f98bcf
msgid "Baidu wenxin"
msgstr "百度文心API"
#: ../../getting_started/install/llm/proxyllm/proxyllm.md:11
#: b4cfeba632cb4f898564cf76d9c1551d
msgid "Zhipu"
msgstr "智谱API"
#: ../../getting_started/install/llm/proxyllm/proxyllm.md:12
#: faa92560db2b47d9b9a41bbf703fd84d
msgid "Baichuan"
msgstr "百川API"
#: ../../getting_started/install/llm/proxyllm/proxyllm.md:13
#: aba2dcc36b854b6193ababca772e1cf0
#, fuzzy
msgid "Bard"
msgstr "bard API"
#: ../../getting_started/install/llm/proxyllm/proxyllm.md:17
#: f66f0bfcad2a4f428c953452d5f6963b
msgid ""
"How to Integrate LLM rest API, like OpenAI, Azure, tongyi, wenxin llm "
"api service?"
msgstr "如何集成这些LLM rest API呢"
#: ../../getting_started/install/llm/proxyllm/proxyllm.md:18
#: 01284baeb4a24bb18d48e51ad8503997
msgid "update your `.env` file"
msgstr "更新`.env`配置文件"
#: ../../getting_started/install/llm/proxyllm/proxyllm.md:63
#: f602876d957446fd8056854b6b2121a1
msgid "Make sure your .env configuration is not overwritten"
msgstr "确保文件配置不会被覆盖"
#: ../../getting_started/install/llm/proxyllm/proxyllm.md:66
#: 51cb501d1500440981b3b93f01ff36f4
msgid "How to Integrate Embedding rest API, like OpenAI, Azure api service?"
msgstr "如何集成想OpenAI Embedding rest api"
#~ msgid "Now DB-GPT support connect LLM service through proxy rest api."
#~ msgstr ""

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 0.3.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-17 21:58+0800\n"
"POT-Creation-Date: 2023-11-14 17:55+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
@@ -19,154 +19,176 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.12.1\n"
#: ../../index.rst:34 ../../index.rst:45 3566ae9872dd4f97844f9e0680de5f5d
#: ../../index.rst:44 ../../index.rst:54 fb98707559574eb29f01bd8f6ebfac60
msgid "Getting Started"
msgstr "开始"
#: ../../index.rst:59 ../../index.rst:80 6845a928056940b28be8c13d766009f8
#: ../../index.rst:70 ../../index.rst:92 6d9603b978d44e54a257fb359c871867
msgid "Modules"
msgstr "模块"
#: ../../index.rst:94 ../../index.rst:110 ef3bcf6f837345fca8539d51434e3c2c
msgid "Use Cases"
msgstr "示例"
#: ../../index.rst:124 ../../index.rst:127 b10b8b49e4f5459f8bea881ffc9259d5
msgid "Reference"
msgstr "参考"
#: ../../index.rst:137 ../../index.rst:143 12e75881253a4c4383ac7364c1103348
#: ../../index.rst:106 ../../index.rst:112 9df06739ca4446bc86ec2ff6907763ce
msgid "Resources"
msgstr "资源"
#: ../../index.rst:7 f1a30af655744c0b8fb7197a5fc3a45b
msgid "Welcome to DB-GPT!"
msgstr "欢迎来到DB-GPT中文文档"
#: ../../index.rst:7 7de875cfbc764937ab7f8b362d997952
msgid "Overview"
msgstr "概览"
#: ../../index.rst:8 426686c829a342798eaae9f789260621
#: ../../index.rst:9 770a756bd0b640ef863fd72b8d7e882a
msgid ""
"As large models are released and iterated upon, they are becoming "
"increasingly intelligent. However, in the process of using large models, "
"we face significant challenges in data security and privacy. We need to "
"ensure that our sensitive data and environments remain completely "
"controlled and avoid any data privacy leaks or security risks. Based on "
"this, we have launched the DB-GPT project to build a complete private "
"large model solution for all database-based scenarios. This solution "
"supports local deployment, allowing it to be applied not only in "
"independent private environments but also to be independently deployed "
"and isolated according to business modules, ensuring that the ability of "
"large models is absolutely private, secure, and controllable."
msgstr ""
"随着大型模型的发布和迭代,它们变得越来越智能。然而,在使用大型模型的过程中,我们在数据安全和隐私方面面临着重大挑战。我们需要确保我们的敏感数据和环境得到完全控制,避免任何数据隐私泄露或安全风险。基于此"
"我们启动了DB-"
"GPT项目为所有基于数据库的场景构建一个完整的私有大模型解决方案。该方案“”支持本地部署既可应用于“独立私有环境”又可根据业务模块进行“独立部署”和“隔离”确保“大模型”的能力绝对私有、安全、可控。"
"DB-GPT is an open-source framework for large models in the database "
"field. Its purpose is to build infrastructure for the domain of large "
"models, making it easier and more convenient to develop applications "
"around databases. By developing various technical capabilities such as:"
msgstr "DB-GPT是一个开源的数据库领域大模型框架。目的是构建大模型领域的基础设施通过开发如"
#: ../../index.rst:10 0a7fbd17ecfd48cb8e0593e35a225e1b
#: ../../index.rst:11 8774a5ad5ce14baf9eae35fefd62e40b
msgid "**SMMF(Service-oriented Multi-model Management Framework)**"
msgstr "**服务化多模型管理**"
#: ../../index.rst:12 b2ba120fc994436db7066486c9acd6ad
msgid "**Text2SQL Fine-tuning**"
msgstr "**Text2SQL微调**"
#: ../../index.rst:13 d55efe86dd6b40ebbe63079edb60e421
msgid "**RAG(Retrieval Augmented Generation) framework and optimization**"
msgstr "**检索增强**"
#: ../../index.rst:14 3eca943c44464c9cb9bbc5724c27ad1c
msgid "**Data-Driven Agents framework collaboration**"
msgstr "**数据驱动的Agents协作框架**"
#: ../../index.rst:15 bf41d57cbc474e2c9829f09d6b983ae1
msgid "**GBI(Generative Business intelligence)**"
msgstr "**生成式报表分析**"
#: ../../index.rst:17 36630469cc064317a1c196dd377c3d93
msgid ""
"**DB-GPT** is an experimental open-source project that uses localized GPT"
" large models to interact with your data and environment. With this "
"solution, you can be assured that there is no risk of data leakage, and "
"your data is 100% private and secure."
msgstr ""
"DB-GPT 是一个开源的以数据库为基础的GPT实验项目使用本地化的GPT大模型与您的数据和环境进行交互无数据泄露风险100% 私密100%"
" 安全。"
"etc, DB-GPT simplifies the construction of large model applications based"
" on databases."
msgstr "等能力, 让围绕数据库构建大模型应用更简单,更方便。"
#: ../../index.rst:12 50e02964b1e24c4fa598f820796aec61
msgid "**Features**"
#: ../../index.rst:19 82f03535c6914ebfa8b3adad34eeed2f
msgid ""
"In the era of Data 3.0, enterprises and developers can build their own "
"customized applications with less code, leveraging models and databases."
msgstr "*数据3.0 时代,基于模型、数据库,企业/开发者可以用更少的代码搭建自己的专属应用*。"
#: ../../index.rst:22 daf64ec39c28458087d542879d106d1b
msgid "Features"
msgstr "特性"
#: ../../index.rst:13 62b74478b9b046dfa7606785939ca70e
#: ../../index.rst:24 7ceb41b710f847e683479dc892baa3d5
msgid "**1. Private Domain Q&A & Data Processing**"
msgstr "**1. 私域问答&数据处理**"
#: ../../index.rst:25 3f480e259ee9432b934ee6474bc8de79
msgid ""
"Currently, we have released multiple key features, which are listed below"
" to demonstrate our current capabilities:"
msgstr "目前我们已经发布了多种关键的特性,这里一一列举展示一下当前发布的能力。"
"Supports custom construction of knowledge bases through methods such as "
"built-in, multi-file format uploads, and plugin-based web scraping. "
"Enables unified vector storage and retrieval of massive structured and "
"unstructured data."
msgstr "支持内置、多文件格式上传、插件自抓取等方式自定义构建知识库,对海量结构化,非结构化数据做统一向量存储与检索"
#: ../../index.rst:15 f593159ba8dd4388bd2ba189f9efd5ea
msgid "SQL language capabilities - SQL generation - SQL diagnosis"
msgstr "SQL语言能力 - SQL生成 - SQL诊断"
#: ../../index.rst:27 1f9f12be761a4a6c996788051a3fa4dd
msgid "**2.Multi-Data Source & GBI(Generative Business intelligence)**"
msgstr "**2.多数据源与可视化**"
#: ../../index.rst:19 b829655a3ef146528beb9c50538be84e
#: ../../index.rst:28 e597e6c2d4ad4d1bbcc440b3afb7c0fa
msgid ""
"Private domain Q&A and data processing - Database knowledge Q&A - Data "
"processing"
msgstr "私有领域问答与数据处理 - 数据库知识问答 - 数据处理"
"Supports interaction between natural language and various data sources "
"such as Excel, databases, and data warehouses. Also supports analysis "
"reporting."
msgstr "支持自然语言与Excel、数据库、数仓等多种数据源交互,并支持分析报告。"
#: ../../index.rst:23 43e988a100a740358f1a0be1710d7960
#: ../../index.rst:30 9c63ecf927874f9ea79f1ef5c1535e67
msgid "**3.SMMF(Service-oriented Multi-model Management Framework)**"
msgstr "**3.多模型管理**"
#: ../../index.rst:31 d6cfb9b69f9743d083c4644c90fd6108
msgid ""
"Plugins - Support custom plugin execution tasks and natively support the "
"Auto-GPT plugin, such as:"
msgstr "插件模型 - 支持自定义插件执行任务并原生支持Auto-GPT插件例如:* SQL自动执行获取查询结果 * 自动爬取学习知识"
"Supports a wide range of models, including dozens of large language "
"models such as open-source models and API proxies. Examples include "
"LLaMA/LLaMA2, Baichuan, ChatGLM, Wenxin, Tongyi, Zhipu, Xinghuo, etc."
msgstr "海量模型支持包括开源、API代理等几十种大语言模型。如LLaMA/LLaMA2、Baichuan、ChatGLM、文心、通义、智谱、星火等。"
#: ../../index.rst:26 888186524aef4fe5a0ba643d55783fd9
#: ../../index.rst:33 dda6cec4316e48f2afe77005baa53a06
msgid "**4.Automated Fine-tuning**"
msgstr "**4.自动化微调**"
#: ../../index.rst:34 7cf1654a9779444ab3982435887d087b
msgid ""
"Unified vector storage/indexing of knowledge base - Support for "
"unstructured data such as PDF, Markdown, CSV, and WebURL"
msgstr "知识库统一向量存储/索引 - 非结构化数据支持包括PDF、MarkDown、CSV、WebURL"
"A lightweight framework for automated fine-tuning built around large "
"language models, Text2SQL datasets, and methods like LoRA/QLoRA/Pturning."
" Makes TextSQL fine-tuning as convenient as a production line."
msgstr ""
"围绕大语言模型、Text2SQL数据集、LoRA/QLoRA/Pturning等微调方法构建的自动化微调轻量框架, "
"让TextSQL微调像流水线一样方便。"
#: ../../index.rst:29 fab4f961fe1746dca3d5e369de714108
#: ../../index.rst:36 f58f114546f04b658aaa67fd895fba2b
msgid "**5.Data-Driven Multi-Agents & Plugins**"
msgstr "**5.数据驱动的插件模型**"
#: ../../index.rst:37 a93fdca3de054cb0812d7f5ca3d12375
msgid ""
"Milti LLMs Support - Supports multiple large language models, currently "
"supporting Vicuna (7b, 13b), ChatGLM-6b (int4, int8) - TODO: codegen2, "
"codet5p"
msgstr "多模型支持 - 支持多种大语言模型, 当前已支持Vicuna(7b,13b), ChatGLM-6b(int4, int8)"
"Supports executing tasks through custom plugins and natively supports the"
" Auto-GPT plugin model. Agents protocol follows the Agent Protocol "
"standard."
msgstr "支持自定义插件执行任务原生支持Auto-GPT插件模型Agents协议采用Agent Protocol标准"
#: ../../index.rst:35 7bc21f280364448da0edc046378be622
#: ../../index.rst:39 3a0e89b151694e4b8e87646efe313568
msgid "**6.Privacy and Security**"
msgstr "**6.隐私安全**"
#: ../../index.rst:40 aa50fc40f22f4fae8225a0a0a97c17dc
msgid ""
"How to get started using DB-GPT to interact with your data and "
"environment."
msgstr "开始使用DB-GPT与您的数据环境进行交互。"
"Ensures data privacy and security through techniques such as privatizing "
"large models and proxy de-identification."
msgstr "通过私有化大模型、代理脱敏等多种技术保障数据的隐私安全"
#: ../../index.rst:36 5362221ecdf5427faa51df83d4a939ee
#: ../../index.rst:46 d8bf21a7abd749608cddcdb2e358f3be
msgid "Quickstart"
msgstr "快速开始"
#: ../../index.rst:48 d1f117a7cbb94c80afc0660e899d8154
#, fuzzy
msgid "`Quickstart Guide <./getting_started/getting_started.html>`_"
msgstr "`使用指南 <./getting_started/getting_started.html>`_"
#: ../../index.rst:38 e028ed5afce842fbb76a6ce825d5a8e2
#: ../../index.rst:50 5fd56979f31b4a0b93082004f1cb90c7
msgid "Concepts and terminology"
msgstr "相关概念"
#: ../../index.rst:40 f773ac5e50054c308920c0b95a44b0cb
#: ../../index.rst:52 09c6889d02fa417c9ffde312211726f0
#, fuzzy
msgid "`Concepts and Terminology <./getting_started/concepts.html>`_"
msgstr "`相关概念 <./getting_started/concepts.html>`_"
#: ../../index.rst:42 afeee818ec45454da12b80161b5f1de0
msgid "Coming soon..."
msgstr ""
#: ../../index.rst:44 cb4f911316234b86aad88b83d2784ad3
msgid "`Tutorials <.getting_started/tutorials.html>`_"
msgstr "`教程 <.getting_started/tutorials.html>`_"
#: ../../index.rst:61 de365722d61442b99f44fcde8a8c9efb
#: ../../index.rst:72 5bd727134fc94cfb88abb755ccceac03
msgid ""
"These modules are the core abstractions with which we can interact with "
"data and environment smoothly."
msgstr "这些模块是我们可以与数据和环境顺利地进行交互的核心组成。"
"data and environment smoothly. It's very important for DB-GPT, DB-GPT "
"also provide standard, extendable interfaces."
msgstr "这些模块是我们能够与数据和环境顺利交互的核心抽象。这对于DB-GPT来说非常重要DB-GPT还提供了标准的、可扩展的接口。"
#: ../../index.rst:62 8fbb6303d3cd4fcc956815f44ef1fa8d
msgid ""
"It's very important for DB-GPT, DB-GPT also provide standard, extendable "
"interfaces."
msgstr "DB-GPT还提供了标准的、可扩展的接口。"
#: ../../index.rst:64 797ac43f459b4662a5097c8cb783c4ba
#: ../../index.rst:74 1a5eb0b7cb884309be3431112c8f38e5
msgid ""
"The docs for each module contain quickstart examples, how to guides, "
"reference docs, and conceptual guides."
msgstr "每个模块的文档都包含快速入门的例子、操作指南、参考文档和相关概念等内容。"
#: ../../index.rst:66 70d7b89c1c154c65aabedbb3c94c8771
#: ../../index.rst:76 24aa8c08d1dc460ab23d69a5bb9c8fc3
msgid "The modules are as follows"
msgstr "组成模块如下:"
#: ../../index.rst:68 794d8a939e274894910fcdbb3ee52429
#: ../../index.rst:78 9f4280cca1f743cb9b868cc67e3f3ce7
msgid ""
"`LLMs <./modules/llms.html>`_: Supported multi models management and "
"integrations."
msgstr "`LLMs <./modules/llms.html>`_:基于FastChat提供大模型的运行环境。支持多模型管理和集成。 "
#: ../../index.rst:70 58b0d2fcac2c471494fe2b6b5b3f1b49
#: ../../index.rst:80 d357811f110f40e79f0c20ef9cb60d0c
msgid ""
"`Prompts <./modules/prompts.html>`_: Prompt management, optimization, and"
" serialization for multi database."
@@ -174,86 +196,35 @@ msgstr ""
"`Prompt自动生成与优化 <./modules/prompts.html>`_: 自动化生成高质量的Prompt "
",并进行优化,提高系统的响应效率"
#: ../../index.rst:72 d433b62e11f64e18995bd334f93992a6
#: ../../index.rst:82 3cb9acc9f11a46638e6687f743d6b7f3
msgid "`Plugins <./modules/plugins.html>`_: Plugins management, scheduler."
msgstr "`Agent与插件 <./modules/plugins.html>`_:提供Agent和插件机制使得用户可以自定义并增强系统的行为。"
#: ../../index.rst:74 3e7eb10f64274c07ace90b84ffc904b4
#: ../../index.rst:84 b24c462cb5364890a6ca990f09f48cfc
#, fuzzy
msgid ""
"`Knowledge <./modules/knowledge.html>`_: Knowledge management, embedding,"
" and search."
msgstr "`知识库能力: <./modules/knowledge.html>`_: 支持私域知识库问答能力, "
#: ../../index.rst:76 3af796f287f54de0869a086cfa24b568
#: ../../index.rst:86 7448b231fe8745f1965a1f48ffc5444a
msgid ""
"`Connections <./modules/connections.html>`_: Supported multi databases "
"connection. management connections and interact with this."
msgstr "`连接模块 <./modules/connections.html>`_: 用于连接不同的模块和数据源,实现数据的流转和交互 "
#: ../../index.rst:78 27273a4020a540f4b28e7c54ea9c9232
#: ../../index.rst:88 c677fb24869347ff907f1529ef333b6b
#, fuzzy
msgid "`Vector <./modules/vector.html>`_: Supported multi vector database."
msgstr "`LLMs <./modules/llms.html>`_:基于FastChat提供大模型的运行环境。支持多模型管理和集成。 "
#: ../../index.rst:96 d887747669d1429f950c56131cd35a62
msgid "Best Practices and built-in implementations for common DB-GPT use cases:"
msgstr "DB-GPT用例的最佳实践和内置方法:"
#: ../../index.rst:98 63ea6a449012432baeeef975db5c3ac1
msgid ""
"`Sql generation and diagnosis "
"<./use_cases/sql_generation_and_diagnosis.html>`_: SQL generation and "
"diagnosis."
msgstr "`Sql生成和诊断 <./use_cases/sql_generation_and_diagnosis.html>`_: Sql生成和诊断。"
#: ../../index.rst:100 c7388a2147af48d1a6619492a3b926db
msgid ""
"`knownledge Based QA <./use_cases/knownledge_based_qa.html>`_: A "
"important scene for user to chat with database documents, codes, bugs and"
" schemas."
msgstr "`知识库问答 <./use_cases/knownledge_based_qa.html>`_: 用户与数据库文档、代码和bug聊天的重要场景\""
#: ../../index.rst:102 f5a459f5a84241648a6a05f7ba3026c0
msgid ""
"`Chatbots <./use_cases/chatbots.html>`_: Language model love to chat, use"
" multi models to chat."
msgstr "`聊天机器人 <./use_cases/chatbots.html>`_: 使用多模型进行对话"
#: ../../index.rst:104 d566174db6eb4834854c00ce7295c297
msgid ""
"`Querying Database Data <./use_cases/query_database_data.html>`_: Query "
"and Analysis data from databases and give charts."
msgstr "`查询数据库数据 <./use_cases/query_database_data.html>`_:从数据库中查询和分析数据并给出图表。"
#: ../../index.rst:106 89aac5a738ae4aeb84bc324803ada354
msgid ""
"`Interacting with apis <./use_cases/interacting_with_api.html>`_: "
"Interact with apis, such as create a table, deploy a database cluster, "
"create a database and so on."
msgstr ""
"`API交互 <./use_cases/interacting_with_api.html>`_: "
"与API交互例如创建表、部署数据库集群、创建数据库等。"
#: ../../index.rst:108 f100fb0cdd264cf186bf554771488aa1
msgid ""
"`Tool use with plugins <./use_cases/tool_use_with_plugin>`_: According to"
" Plugin use tools to manage databases autonomoly."
msgstr "`插件工具 <./use_cases/tool_use_with_plugin>`_: 根据插件使用工具自主管理数据库。"
#: ../../index.rst:125 93809b95cc4a41249d7ab6b264981167
msgid ""
"Full documentation on all methods, classes, installation methods, and "
"integration setups for DB-GPT."
msgstr "关于DB-GPT的所有方法、类、安装方法和集成设置的完整文档。"
#: ../../index.rst:139 4a95e65e128e4fc0907a3f51f1f2611b
#: ../../index.rst:108 2e56f2cb1a8b40dda9465c0a1af94196
msgid ""
"Additional resources we think may be useful as you develop your "
"application!"
msgstr "我们认为在您开发应用程序时可能有用的其他资源!"
msgstr "我们认为在您开发应用程序时可能有用的其他资源!"
#: ../../index.rst:141 4934fbae909644769dd83c7f99c0fcd0
#: ../../index.rst:110 590362cb3b7442d49eafa58cb323e127
msgid ""
"`Discord <https://discord.gg/eZHE94MN>`_: if your have some problem or "
"ideas, you can talk from discord."
@@ -271,3 +242,325 @@ msgstr "`Discord <https://discord.gg/eZHE94MN>`_:如果您有任何问题,可
#~ msgid "Guides for how other companies/products can be used with DB-GPT"
#~ msgstr "其他公司/产品如何与DB-GPT一起使用的方法指南"
#~ msgid "Use Cases"
#~ msgstr "示例"
#~ msgid ""
#~ "Best Practices and built-in "
#~ "implementations for common DB-GPT use"
#~ " cases:"
#~ msgstr "DB-GPT用例的最佳实践和内置方法:"
#~ msgid ""
#~ "`Sql generation and diagnosis "
#~ "<./use_cases/sql_generation_and_diagnosis.html>`_: SQL "
#~ "generation and diagnosis."
#~ msgstr "`Sql生成和诊断 <./use_cases/sql_generation_and_diagnosis.html>`_: Sql生成和诊断。"
#~ msgid ""
#~ "`knownledge Based QA "
#~ "<./use_cases/knownledge_based_qa.html>`_: A important "
#~ "scene for user to chat with "
#~ "database documents, codes, bugs and "
#~ "schemas."
#~ msgstr ""
#~ "`知识库问答 <./use_cases/knownledge_based_qa.html>`_: "
#~ "用户与数据库文档、代码和bug聊天的重要场景\""
#~ msgid ""
#~ "`Chatbots <./use_cases/chatbots.html>`_: Language "
#~ "model love to chat, use multi "
#~ "models to chat."
#~ msgstr "`聊天机器人 <./use_cases/chatbots.html>`_: 使用多模型进行对话"
#~ msgid ""
#~ "`Querying Database Data "
#~ "<./use_cases/query_database_data.html>`_: Query and "
#~ "Analysis data from databases and give"
#~ " charts."
#~ msgstr "`查询数据库数据 <./use_cases/query_database_data.html>`_:从数据库中查询和分析数据并给出图表。"
#~ msgid ""
#~ "`Interacting with apis "
#~ "<./use_cases/interacting_with_api.html>`_: Interact with"
#~ " apis, such as create a table, "
#~ "deploy a database cluster, create a "
#~ "database and so on."
#~ msgstr ""
#~ "`API交互 <./use_cases/interacting_with_api.html>`_: "
#~ "与API交互例如创建表、部署数据库集群、创建数据库等。"
#~ msgid ""
#~ "`Tool use with plugins "
#~ "<./use_cases/tool_use_with_plugin>`_: According to "
#~ "Plugin use tools to manage databases "
#~ "autonomoly."
#~ msgstr "`插件工具 <./use_cases/tool_use_with_plugin>`_: 根据插件使用工具自主管理数据库。"
#~ msgid "Reference"
#~ msgstr "参考"
#~ msgid "Welcome to DB-GPT!"
#~ msgstr "欢迎来到DB-GPT中文文档"
#~ msgid ""
#~ "As large models are released and "
#~ "iterated upon, they are becoming "
#~ "increasingly intelligent. However, in the "
#~ "process of using large models, we "
#~ "face significant challenges in data "
#~ "security and privacy. We need to "
#~ "ensure that our sensitive data and "
#~ "environments remain completely controlled and"
#~ " avoid any data privacy leaks or "
#~ "security risks. Based on this, we "
#~ "have launched the DB-GPT project "
#~ "to build a complete private large "
#~ "model solution for all database-based"
#~ " scenarios. This solution supports local"
#~ " deployment, allowing it to be "
#~ "applied not only in independent private"
#~ " environments but also to be "
#~ "independently deployed and isolated according"
#~ " to business modules, ensuring that "
#~ "the ability of large models is "
#~ "absolutely private, secure, and controllable."
#~ msgstr ""
#~ "随着大型模型的发布和迭代,它们变得越来越智能。然而,在使用大型模型的过程中,我们在数据安全和隐私方面面临着重大挑战。我们需要确保我们的敏感数据和环境得到完全控制,避免任何数据隐私泄露或安全风险。基于此"
#~ "我们启动了DB-"
#~ "GPT项目为所有基于数据库的场景构建一个完整的私有大模型解决方案。该方案“”支持本地部署既可应用于“独立私有环境”又可根据业务模块进行“独立部署”和“隔离”确保“大模型”的能力绝对私有、安全、可控。"
#~ msgid ""
#~ "**DB-GPT** is an experimental open-"
#~ "source project that uses localized GPT"
#~ " large models to interact with your"
#~ " data and environment. With this "
#~ "solution, you can be assured that "
#~ "there is no risk of data leakage,"
#~ " and your data is 100% private "
#~ "and secure."
#~ msgstr ""
#~ "DB-GPT "
#~ "是一个开源的以数据库为基础的GPT实验项目使用本地化的GPT大模型与您的数据和环境进行交互无数据泄露风险100% "
#~ "私密100% 安全。"
#~ msgid ""
#~ "Currently, we have released multiple key"
#~ " features, which are listed below to"
#~ " demonstrate our current capabilities:"
#~ msgstr "目前我们已经发布了多种关键的特性,这里一一列举展示一下当前发布的能力。"
#~ msgid "SQL language capabilities - SQL generation - SQL diagnosis"
#~ msgstr "SQL语言能力 - SQL生成 - SQL诊断"
#~ msgid ""
#~ "Private domain Q&A and data processing"
#~ " - Database knowledge Q&A - Data "
#~ "processing"
#~ msgstr "私有领域问答与数据处理 - 数据库知识问答 - 数据处理"
#~ msgid ""
#~ "Plugins - Support custom plugin "
#~ "execution tasks and natively support the"
#~ " Auto-GPT plugin, such as:"
#~ msgstr "插件模型 - 支持自定义插件执行任务并原生支持Auto-GPT插件例如:* SQL自动执行获取查询结果 * 自动爬取学习知识"
#~ msgid ""
#~ "Unified vector storage/indexing of knowledge"
#~ " base - Support for unstructured data"
#~ " such as PDF, Markdown, CSV, and "
#~ "WebURL"
#~ msgstr "知识库统一向量存储/索引 - 非结构化数据支持包括PDF、MarkDown、CSV、WebURL"
#~ msgid ""
#~ "Multi LLMs Support - Supports multiple"
#~ " large language models, currently "
#~ "supporting Vicuna (7b, 13b), ChatGLM-6b"
#~ " (int4, int8) - TODO: codegen2, "
#~ "codet5p"
#~ msgstr "多模型支持 - 支持多种大语言模型, 当前已支持Vicuna(7b,13b), ChatGLM-6b(int4, int8)"
#~ msgid ""
#~ "Full documentation on all methods, "
#~ "classes, installation methods, and integration"
#~ " setups for DB-GPT."
#~ msgstr "关于DB-GPT的所有方法、类、安装方法和集成设置的完整文档。"
#~ msgid ""
#~ "**DB-GPT** is an open-source "
#~ "framework for large models in the "
#~ "database field. Its purpose is to "
#~ "build infrastructure for the domain of"
#~ " large models, making it easier and"
#~ " more convenient to develop applications"
#~ " around databases."
#~ msgstr ""
#~ msgid "By developing various technical capabilities such as"
#~ msgstr ""
#~ msgid "SMMF(Service-oriented Multi-model Management Framework)"
#~ msgstr ""
#~ msgid "Text2SQL Fine-tuning"
#~ msgstr ""
#~ msgid "RAG(Retrieval Augmented Generation) framework and optimization"
#~ msgstr ""
#~ msgid "Data-Driven Agents framework collaboration"
#~ msgstr ""
#~ msgid ""
#~ "5. GBI(Generative Business intelligence) etc,"
#~ " DB-GPT simplifies the construction "
#~ "of large model applications based on "
#~ "databases."
#~ msgstr ""
#~ msgid ""
#~ "**1. Private Domain Q&A & Data "
#~ "Processing** Supports custom construction of"
#~ " knowledge bases through methods such "
#~ "as built-in, multi-file format "
#~ "uploads, and plugin-based web scraping."
#~ " Enables unified vector storage and "
#~ "retrieval of massive structured and "
#~ "unstructured data."
#~ msgstr ""
#~ msgid ""
#~ "**2.Multi-Data Source & GBI(Generative "
#~ "Business intelligence)** Supports interaction "
#~ "between natural language and various "
#~ "data sources such as Excel, databases,"
#~ " and data warehouses. Also supports "
#~ "analysis reporting."
#~ msgstr ""
#~ msgid ""
#~ "**3.SMMF(Service-oriented Multi-model "
#~ "Management Framework)** Supports a wide "
#~ "range of models, including dozens of "
#~ "large language models such as open-"
#~ "source models and API proxies. Examples"
#~ " include LLaMA/LLaMA2, Baichuan, ChatGLM, "
#~ "Wenxin, Tongyi, Zhipu, Xinghuo, etc."
#~ msgstr ""
#~ msgid ""
#~ "**4.Automated Fine-tuning** A lightweight "
#~ "framework for automated fine-tuning "
#~ "built around large language models, "
#~ "Text2SQL datasets, and methods like "
#~ "LoRA/QLoRA/Pturning. Makes TextSQL fine-tuning"
#~ " as convenient as a production line."
#~ msgstr ""
#~ msgid ""
#~ "**5.Data-Driven Multi-Agents & Plugins**"
#~ " Supports executing tasks through custom"
#~ " plugins and natively supports the "
#~ "Auto-GPT plugin model. Agents protocol "
#~ "follows the Agent Protocol standard."
#~ msgstr ""
#~ msgid ""
#~ "**6.Privacy and Security** Ensures data "
#~ "privacy and security through techniques "
#~ "such as privatizing large models and "
#~ "proxy de-identification."
#~ msgstr ""
#~ msgid "Coming soon..."
#~ msgstr ""
#~ msgid "`Tutorials <.getting_started/tutorials.html>`_"
#~ msgstr "`教程 <.getting_started/tutorials.html>`_"
#~ msgid ""
#~ "DB-GPT is an open-source framework"
#~ " for large models in the database "
#~ "field. Its purpose is to build "
#~ "infrastructure for the domain of large"
#~ " models, making it easier and more"
#~ " convenient to develop applications around"
#~ " databases. By developing various technical"
#~ " capabilities such as **1. SMMF(Service-"
#~ "oriented Multi-model Management Framework)**"
#~ " **2. Text2SQL Fine-tuning** **3. "
#~ "RAG(Retrieval Augmented Generation) framework "
#~ "and optimization** **4. Data-Driven "
#~ "Agents framework collaboration** **5. "
#~ "GBI(Generative Business intelligence)** etc, "
#~ "DB-GPT simplifies the construction of "
#~ "large model applications based on "
#~ "databases."
#~ msgstr ""
#~ msgid ""
#~ "**1. Private Domain Q&A & Data "
#~ "Processing** ::Supports custom construction of"
#~ " knowledge bases through methods such "
#~ "as built-in, multi-file format "
#~ "uploads, and plugin-based web scraping."
#~ " Enables unified vector storage and "
#~ "retrieval of massive structured and "
#~ "unstructured data."
#~ msgstr ""
#~ msgid ""
#~ "**2.Multi-Data Source & GBI(Generative "
#~ "Business intelligence)** ::Supports interaction "
#~ "between natural language and various "
#~ "data sources such as Excel, databases,"
#~ " and data warehouses. Also supports "
#~ "analysis reporting."
#~ msgstr ""
#~ msgid ""
#~ "**3.SMMF(Service-oriented Multi-model "
#~ "Management Framework)** ::Supports a wide "
#~ "range of models, including dozens of "
#~ "large language models such as open-"
#~ "source models and API proxies. Examples"
#~ " include LLaMA/LLaMA2, Baichuan, ChatGLM, "
#~ "Wenxin, Tongyi, Zhipu, Xinghuo, etc."
#~ msgstr ""
#~ msgid ""
#~ "**4.Automated Fine-tuning** ::A lightweight"
#~ " framework for automated fine-tuning "
#~ "built around large language models, "
#~ "Text2SQL datasets, and methods like "
#~ "LoRA/QLoRA/Pturning. Makes TextSQL fine-tuning"
#~ " as convenient as a production line."
#~ msgstr ""
#~ msgid ""
#~ "**5.Data-Driven Multi-Agents & Plugins**"
#~ " ::Supports executing tasks through custom"
#~ " plugins and natively supports the "
#~ "Auto-GPT plugin model. Agents protocol "
#~ "follows the Agent Protocol standard."
#~ msgstr ""
#~ msgid ""
#~ "**6.Privacy and Security** ::Ensures data "
#~ "privacy and security through techniques "
#~ "such as privatizing large models and "
#~ "proxy de-identification."
#~ msgstr ""
#~ msgid ""
#~ "How to get started using DB-GPT"
#~ " to interact with your data and "
#~ "environment."
#~ msgstr "开始使用DB-GPT与您的数据环境进行交互。"
#~ msgid ""
#~ "It's very important for DB-GPT, "
#~ "DB-GPT also provide standard, extendable"
#~ " interfaces."
#~ msgstr "DB-GPT还提供了标准的、可扩展的接口。"

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 0.3.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-13 15:39+0800\n"
"POT-Creation-Date: 2023-11-02 21:04+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
@@ -19,103 +19,84 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.12.1\n"
#: ../../modules/knowledge.rst:2 ../../modules/knowledge.rst:136
#: 3cc8fa6e9fbd4d889603d99424e9529a
#: ../../modules/knowledge.md:1 b94b3b15cb2441ed9d78abd222a717b7
msgid "Knowledge"
msgstr "知识"
#: ../../modules/knowledge.rst:4 0465a393d9d541958c39c1d07c885d1f
#: ../../modules/knowledge.md:3 c6d6e308a6ce42948d29e928136ef561
#, fuzzy
msgid ""
"As the knowledge base is currently the most significant user demand "
"scenario, we natively support the construction and processing of "
"knowledge bases. At the same time, we also provide multiple knowledge "
"base management strategies in this project, such as pdf knowledge,md "
"knowledge, txt knowledge, word knowledge, ppt knowledge:"
"base management strategies in this project, such as:"
msgstr ""
"由于知识库是当前用户需求最显著的场景,我们原生支持知识库的构建和处理。同时,我们还在本项目中提供了多种知识库管理策略,如:pdf,md , "
"txt, word, ppt"
#: ../../modules/knowledge.rst:6 e670cbe14d8e4da88ba935e4120c31e0
msgid ""
"We currently support many document formats: raw text, txt, pdf, md, html,"
" doc, ppt, and url. In the future, we will continue to support more types"
" of knowledge, including audio, video, various databases, and big data "
"sources. Of course, we look forward to your active participation in "
"contributing code."
#: ../../modules/knowledge.md:4 268abc408d40410ba90cf5f121dc5270
msgid "Default built-in knowledge base"
msgstr ""
#: ../../modules/knowledge.rst:9 e0bf601a1a0c458297306db6ff79f931
msgid "**Create your own knowledge repository**"
#: ../../modules/knowledge.md:5 558c3364c38b458a8ebf81030efc2a48
msgid "Custom addition of knowledge bases"
msgstr ""
#: ../../modules/knowledge.md:6 9cb3ce62da1440579c095848c7aef88c
msgid ""
"Various usage scenarios such as constructing knowledge bases through "
"plugin capabilities and web crawling. Users only need to organize the "
"knowledge documents, and they can use our existing capabilities to build "
"the knowledge base required for the large model."
msgstr ""
#: ../../modules/knowledge.md:9 b8ca6bc4dd9845baa56e36eea7fac2a2
#, fuzzy
msgid "Create your own knowledge repository"
msgstr "创建你自己的知识库"
#: ../../modules/knowledge.rst:11 bb26708135d44615be3c1824668010f6
msgid "1.prepare"
msgstr "准备"
#: ../../modules/knowledge.md:11 17d7178a67924f43aa5b6293707ef041
msgid ""
"1.Place personal knowledge files or folders in the pilot/datasets "
"directory."
msgstr ""
#: ../../modules/knowledge.rst:13 c150a0378f3e4625908fa0d8a25860e9
#: ../../modules/knowledge.md:13 31c31f14bf444981939689f9a9fb038a
#, fuzzy
msgid ""
"We currently support many document formats: TEXT(raw text), "
"DOCUMENT(.txt, .pdf, .md, .doc, .ppt, .html), and URL."
"We currently support many document formats: txt, pdf, md, html, doc, ppt,"
" and url."
msgstr "当前支持txt, pdf, md, html, doc, ppt, url文档格式"
#: ../../modules/knowledge.rst:15 7f9f02a93d5d4325b3d2d976f4bb28a0
#: ../../modules/knowledge.md:15 9ad2f2e05f8842a9b9d8469a3704df23
msgid "before execution:"
msgstr "开始前"
#: ../../modules/knowledge.rst:24 59699a8385e04982a992cf0d71f6dcd5
#, fuzzy
#: ../../modules/knowledge.md:22 6fd2775914b641c4b8e486417b558ea6
msgid ""
"2.prepare embedding model, you can download from https://huggingface.co/."
" Notice you have installed git-lfs."
"2.Update your .env, set your vector store type, VECTOR_STORE_TYPE=Chroma "
"(now only support Chroma and Milvus, if you set Milvus, please set "
"MILVUS_URL and MILVUS_PORT)"
msgstr ""
"提前准备Embedding Model, 你可以在https://huggingface.co/进行下载注意你需要先安装git-lfs.eg:"
" git clone https://huggingface.co/THUDM/chatglm2-6b"
#: ../../modules/knowledge.rst:27 2be1a17d0b54476b9dea080d244fd747
msgid ""
"eg: git clone https://huggingface.co/sentence-transformers/all-"
"MiniLM-L6-v2"
msgstr "eg: git clone https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2"
#: ../../modules/knowledge.rst:33 d328f6e243624c9488ebd27c9324621b
msgid ""
"3.prepare vector_store instance and vector store config, now we support "
"Chroma, Milvus and Weaviate."
msgstr "提前准备向量数据库环境目前支持Chroma, Milvus and Weaviate向量数据库"
#: ../../modules/knowledge.rst:63 44f97154eff647d399fd30b6f9e3b867
msgid ""
"3.init Url Type EmbeddingEngine api and embedding your document into "
"vector store in your code."
msgstr "初始化 Url类型 EmbeddingEngine api 将url文档embedding向量化到向量数据库 "
#: ../../modules/knowledge.rst:75 e2581b414f0148bca88253c7af9cd591
msgid "If you want to add your source_reader or text_splitter, do this:"
msgstr "如果你想手动添加你自定义的source_reader和text_splitter, 请参考:"
#: ../../modules/knowledge.rst:95 74c110414f924bbfa3d512e45ba2f30f
#, fuzzy
msgid ""
"4.init Document Type EmbeddingEngine api and embedding your document into"
" vector store in your code. Document type can be .txt, .pdf, .md, .doc, "
".ppt."
#: ../../modules/knowledge.md:25 131c5f58898a4682940910980edb2043
msgid "2.Run the knowledge repository initialization command"
msgstr ""
"初始化 文档型类型 EmbeddingEngine api 将文档embedding向量化到向量数据库(文档可以是.txt, .pdf, "
".md, .html, .doc, .ppt)"
#: ../../modules/knowledge.rst:108 0afd40098d5f4dfd9e44fe1d8004da25
#: ../../modules/knowledge.md:31 2cf550f17881497bb881b19efcc18c23
msgid ""
"5.init TEXT Type EmbeddingEngine api and embedding your document into "
"vector store in your code."
msgstr "初始化TEXT类型 EmbeddingEngine api 将文档embedding向量化到向量数据库"
"Optionally, you can run `dbgpt knowledge load --help` command to see more"
" usage."
msgstr ""
#: ../../modules/knowledge.rst:120 a66961bf3efd41fa8ea938129446f5a5
msgid "4.similar search based on your knowledge base. ::"
msgstr "在知识库进行相似性搜索"
#: ../../modules/knowledge.md:33 c8a2ea571b944bdfbcad48fa8b54fcc9
msgid ""
"3.Add the knowledge repository in the interface by entering the name of "
"your knowledge repository (if not specified, enter \"default\") so you "
"can use it for Q&A based on your knowledge base."
msgstr ""
#: ../../modules/knowledge.rst:126 b7066f408378450db26770f83fbd2716
#: ../../modules/knowledge.md:35 b701170ad75e49dea7d7734c15681e0f
msgid ""
"Note that the default vector model used is text2vec-large-chinese (which "
"is a large model, so if your personal computer configuration is not "
@@ -125,48 +106,6 @@ msgstr ""
"注意这里默认向量模型是text2vec-large-chinese(模型比较大如果个人电脑配置不够建议采用text2vec-base-"
"chinese),因此确保需要将模型download下来放到models目录中。"
#: ../../modules/knowledge.rst:128 58481d55cab74936b6e84b24c39b1674
#, fuzzy
msgid ""
"`pdf_embedding <./knowledge/pdf/pdf_embedding.html>`_: supported pdf "
"embedding."
msgstr "pdf_embedding <./knowledge/pdf_embedding.html>`_: supported pdf embedding."
#: ../../modules/knowledge.rst:129 fbb013c4f1bc46af910c91292f6690cf
#, fuzzy
msgid ""
"`markdown_embedding <./knowledge/markdown/markdown_embedding.html>`_: "
"supported markdown embedding."
msgstr "pdf_embedding <./knowledge/pdf_embedding.html>`_: supported pdf embedding."
#: ../../modules/knowledge.rst:130 59d45732f4914d16b4e01aee0992edf7
#, fuzzy
msgid ""
"`word_embedding <./knowledge/word/word_embedding.html>`_: supported word "
"embedding."
msgstr "pdf_embedding <./knowledge/pdf_embedding.html>`_: supported pdf embedding."
#: ../../modules/knowledge.rst:131 df0e6f311861423e885b38e020a7c0f0
#, fuzzy
msgid ""
"`url_embedding <./knowledge/url/url_embedding.html>`_: supported url "
"embedding."
msgstr "pdf_embedding <./knowledge/pdf_embedding.html>`_: supported pdf embedding."
#: ../../modules/knowledge.rst:132 7c550c1f5bc34fe9986731fb465e12cd
#, fuzzy
msgid ""
"`ppt_embedding <./knowledge/ppt/ppt_embedding.html>`_: supported ppt "
"embedding."
msgstr "pdf_embedding <./knowledge/pdf_embedding.html>`_: supported pdf embedding."
#: ../../modules/knowledge.rst:133 8648684cb191476faeeb548389f79050
#, fuzzy
msgid ""
"`string_embedding <./knowledge/string/string_embedding.html>`_: supported"
" raw text embedding."
msgstr "pdf_embedding <./knowledge/pdf_embedding.html>`_: supported pdf embedding."
#~ msgid "before execution: python -m spacy download zh_core_web_sm"
#~ msgstr "在执行之前请先执行python -m spacy download zh_core_web_sm"
@@ -201,3 +140,112 @@ msgstr "pdf_embedding <./knowledge/pdf_embedding.html>`_: supported pdf embeddin
#~ "and MILVUS_PORT)"
#~ msgstr "2.更新你的.env设置你的向量存储类型VECTOR_STORE_TYPE=Chroma(现在只支持Chroma和Milvus如果你设置了Milvus请设置MILVUS_URL和MILVUS_PORT)"
#~ msgid ""
#~ "We currently support many document "
#~ "formats: raw text, txt, pdf, md, "
#~ "html, doc, ppt, and url. In the"
#~ " future, we will continue to support"
#~ " more types of knowledge, including "
#~ "audio, video, various databases, and big"
#~ " data sources. Of course, we look "
#~ "forward to your active participation in"
#~ " contributing code."
#~ msgstr ""
#~ msgid "1.prepare"
#~ msgstr "准备"
#~ msgid ""
#~ "2.prepare embedding model, you can "
#~ "download from https://huggingface.co/. Notice "
#~ "you have installed git-lfs."
#~ msgstr ""
#~ "提前准备Embedding Model, 你可以在https://huggingface.co/进行下载,注意"
#~ "你需要先安装git-lfs.eg: git clone "
#~ "https://huggingface.co/THUDM/chatglm2-6b"
#~ msgid ""
#~ "eg: git clone https://huggingface.co/sentence-"
#~ "transformers/all-MiniLM-L6-v2"
#~ msgstr ""
#~ "eg: git clone https://huggingface.co/sentence-"
#~ "transformers/all-MiniLM-L6-v2"
#~ msgid ""
#~ "3.prepare vector_store instance and vector "
#~ "store config, now we support Chroma, "
#~ "Milvus and Weaviate."
#~ msgstr "提前准备向量数据库环境目前支持Chroma, Milvus and Weaviate向量数据库"
#~ msgid ""
#~ "3.init Url Type EmbeddingEngine api and"
#~ " embedding your document into vector "
#~ "store in your code."
#~ msgstr "初始化 Url类型 EmbeddingEngine api 将url文档embedding向量化到向量数据库 "
#~ msgid "If you want to add your source_reader or text_splitter, do this:"
#~ msgstr "如果你想手动添加你自定义的source_reader和text_splitter, 请参考:"
#~ msgid ""
#~ "4.init Document Type EmbeddingEngine api "
#~ "and embedding your document into vector"
#~ " store in your code. Document type"
#~ " can be .txt, .pdf, .md, .doc, "
#~ ".ppt."
#~ msgstr ""
#~ "初始化 文档型类型 EmbeddingEngine api "
#~ "将文档embedding向量化到向量数据库(文档可以是.txt, .pdf, .md, .html,"
#~ " .doc, .ppt)"
#~ msgid ""
#~ "5.init TEXT Type EmbeddingEngine api and"
#~ " embedding your document into vector "
#~ "store in your code."
#~ msgstr "初始化TEXT类型 EmbeddingEngine api 将文档embedding向量化到向量数据库"
#~ msgid "4.similar search based on your knowledge base. ::"
#~ msgstr "在知识库进行相似性搜索"
#~ msgid ""
#~ "`pdf_embedding <./knowledge/pdf/pdf_embedding.html>`_: "
#~ "supported pdf embedding."
#~ msgstr ""
#~ "pdf_embedding <./knowledge/pdf_embedding.html>`_: "
#~ "supported pdf embedding."
#~ msgid ""
#~ "`markdown_embedding "
#~ "<./knowledge/markdown/markdown_embedding.html>`_: supported "
#~ "markdown embedding."
#~ msgstr ""
#~ "pdf_embedding <./knowledge/pdf_embedding.html>`_: "
#~ "supported pdf embedding."
#~ msgid ""
#~ "`word_embedding <./knowledge/word/word_embedding.html>`_: "
#~ "supported word embedding."
#~ msgstr ""
#~ "pdf_embedding <./knowledge/pdf_embedding.html>`_: "
#~ "supported pdf embedding."
#~ msgid ""
#~ "`url_embedding <./knowledge/url/url_embedding.html>`_: "
#~ "supported url embedding."
#~ msgstr ""
#~ "pdf_embedding <./knowledge/pdf_embedding.html>`_: "
#~ "supported pdf embedding."
#~ msgid ""
#~ "`ppt_embedding <./knowledge/ppt/ppt_embedding.html>`_: "
#~ "supported ppt embedding."
#~ msgstr ""
#~ "pdf_embedding <./knowledge/pdf_embedding.html>`_: "
#~ "supported pdf embedding."
#~ msgid ""
#~ "`string_embedding <./knowledge/string/string_embedding.html>`_:"
#~ " supported raw text embedding."
#~ msgstr ""
#~ "pdf_embedding <./knowledge/pdf_embedding.html>`_: "
#~ "supported pdf embedding."

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 0.3.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-14 21:47+0800\n"
"POT-Creation-Date: 2023-11-03 15:33+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
@@ -19,11 +19,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.12.1\n"
#: ../../modules/plugins.md:1 8e0200134cca45b6aead6d05b60ca95a
#: ../../modules/plugins.md:1 e8c539b65ccd459793e8ed3812903578
msgid "Plugins"
msgstr "插件"
#: ../../modules/plugins.md:3 d0d532cfe9b44fa0916d7d5b912a744a
#: ../../modules/plugins.md:3 0d6f6bdcf843416fb35d9f51df52bead
msgid ""
"The ability of Agent and Plugin is the core of whether large models can "
"be automated. In this project, we natively support the plugin mode, and "
@@ -35,49 +35,62 @@ msgstr ""
"Agent与插件能力是大模型能否自动化的核心在本的项目中原生支持插件模式大模型可以自动化完成目标。 同时为了充分发挥社区的优势"
"本项目中所用的插件原生支持Auto-GPT插件生态即Auto-GPT的插件可以直接在我们的项目中运行。"
#: ../../modules/plugins.md:5 2f78a6b397a24f34b0d5771ca93efb0b
#: ../../modules/plugins.md:5 625763bc41fe417c8e4ea03ab2f8fdfc
#, fuzzy
msgid "The LLM (Language Model) suitable for the Plugin scene is"
msgstr "Plugin场景适用的LLM是 * chatgpt3.5. * chatgpt4."
#: ../../modules/plugins.md:6 b3bd64693a4f4bf8b64b9224d3e1532e
msgid "chatgpt3.5."
msgstr ""
#: ../../modules/plugins.md:7 46d9220e63384594b54c2c176077d962
msgid "chatgpt4."
msgstr ""
#: ../../modules/plugins.md:10 8c539e139f6648b2bef5dc683b8e093c
#, fuzzy
msgid "Local Plugins"
msgstr "插件"
#: ../../modules/plugins.md:7 54a817a638c3440989191b3bffaca6de
#: ../../modules/plugins.md:12 2cc7ba992d524913b3377cad3bf747d3
msgid "1.1 How to write local plugins."
msgstr ""
#: ../../modules/plugins.md:9 fbdc0a9d327f432aa6a380117dfb2f11
#: ../../modules/plugins.md:14 eddffc1d2c434e45890a9befa1bb5160
msgid ""
"Local plugins use the Auto-GPT plugin template. A simple example is as "
"follows: first write a plugin file called \"sql_executor.py\"."
msgstr ""
#: ../../modules/plugins.md:39 dc398ab427bd4d15b3b7c8cb1ff032b3
#: ../../modules/plugins.md:44 06efbea552bb4dc7828d842b779e41d4
msgid ""
"Then set the \"can_handle_post_prompt\" method of the plugin template to "
"True. In the \"post_prompt\" method, write the prompt information and the"
" mapped plugin function."
msgstr ""
#: ../../modules/plugins.md:81 c9d4019392bf452e906057cbe9271005
#: ../../modules/plugins.md:86 afd3cfb379bb463e97e515ae65790830
msgid "1.2 How to use local plugins"
msgstr ""
#: ../../modules/plugins.md:83 9beaed4a71124ecf9544a1dba0d1e722
#: ../../modules/plugins.md:88 f43a70e4cb5c4846a5bb8df3853021ba
msgid ""
"Pack your plugin project into `your-plugin.zip` and place it in the "
"`/plugins/` directory of the DB-GPT project. After starting the "
"webserver, you can select and use it in the `Plugin Model` section."
msgstr ""
#: ../../modules/plugins.md:86 9a1439c883a947d7acac3fd1196b3c1e
#: ../../modules/plugins.md:91 8269458bd7f5480dbc56100865eb1eb0
#, fuzzy
msgid "Public Plugins"
msgstr "插件"
#: ../../modules/plugins.md:88 2ed4c509bf5848adb3fa163752a1cfa1
#: ../../modules/plugins.md:93 ec5bb7b6b2cf464d8b8400f3dfd9a50e
msgid "1.1 How to use public plugins"
msgstr ""
#: ../../modules/plugins.md:90 dd5ba8d582204b2f89ce802a1232b11d
#: ../../modules/plugins.md:95 3025a85c905c49b6b2ac3f5c39c84c93
msgid ""
"By default, after launching the webserver, plugins from the public plugin"
" library `DB-GPT-Plugins` will be automatically loaded. For more details,"
@@ -85,17 +98,17 @@ msgid ""
"Plugins)"
msgstr ""
#: ../../modules/plugins.md:92 244f0591bc5045eab175754521b414c4
#: ../../modules/plugins.md:97 e73d7779df254ba49fe7123ce06353aa
msgid "1.2 Contribute to the DB-GPT-Plugins repository"
msgstr ""
#: ../../modules/plugins.md:94 e00bac1a299b46caa19b9cf16709d6ba
#: ../../modules/plugins.md:99 3297fb00dfc940e8a614c3858640cfe5
msgid ""
"Please refer to the plugin development process in the public plugin "
"library, and put the configuration parameters in `.plugin_env`"
msgstr ""
#: ../../modules/plugins.md:96 315fbf576ea24158adc7b564f53940e0
#: ../../modules/plugins.md:101 13280b270b304e139ed67e5b0dafa5b4
msgid ""
"We warmly welcome everyone to contribute plugins to the public plugin "
"library!"

View File

@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 0.3.0\n"
"Project-Id-Version: DB-GPT 👏👏 0.4.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-14 22:33+0800\n"
"POT-Creation-Date: 2023-11-03 11:47+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
@@ -19,21 +19,130 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.12.1\n"
#: ../../modules/prompts.md:1 b9279c238c014a74aecbc75b5d3dc202
#: ../../modules/prompts.md:1 3c5bdc61dc4a4301acdc9775c854a896
msgid "Prompts"
msgstr ""
msgstr "Prompts"
#: ../../modules/prompts.md:3 f0c720c1c85b401cbc26ed0eb3f6e70e
#: ../../modules/prompts.md:3 118fc2b85e8b4e02a6868b3bc2a7892c
msgid ""
"Prompt is a very important part of the interaction between the large "
"**Prompt** is a very important part of the interaction between the large "
"model and the user, and to a certain extent, it determines the quality "
"and accuracy of the answer generated by the large model. In this project,"
" we will automatically optimize the corresponding prompt according to "
" we will automatically optimize the corresponding Prompt according to "
"user input and usage scenarios, making it easier and more efficient for "
"users to use large language models."
msgstr "Prompt是与大模型交互过程中非常重要的部分,一定程度上Prompt决定了大模型生成答案的质量准确性,在本的项目中,我们会根据用户输入使用场景自动优化对应的Prompt让用户使用大语言模型变得更简单、更高效。"
msgstr "**Prompt**是大模型与用户交互中非常重要的一环,在一定程度上决定了大模型生成答案的质量准确性。在这个项目中,我们会根据用户输入使用场景自动优化相应提示,让用户更轻松、更高效地使用大语言模型。"
#: ../../modules/prompts.md:5 6576d32e28a14be6a5d8180eed000aa7
msgid "1.DB-GPT Prompt"
#: ../../modules/prompts.md:5 41614effa0a445b7b5a119311b902305
msgid "Prompt Management"
msgstr "Prompt 管理"
#: ../../modules/prompts.md:7 a8ed0a7b3d1243ffa1ed80c24d1ab518
msgid ""
"Here, you can choose to create a Prompt in **Public Prompts** space or "
"**Private Prompts** space."
msgstr "该页面允许用户选择**公共Prompts**或者**私有Prompts**空间来创建相应的 Prompt。"
#: ../../modules/prompts.md:9 ../../modules/prompts.md:17
#: ../../modules/prompts.md:31 ../../modules/prompts.md:45
#: 68db272acc6b4572aa275940da4b788b 92d46d647bbb4035add92f750511a840
#: af1789fae8cb47b8a81e68520086f35e d7c2f6f43b5c406d82b7dc5bd92d183c
#: e2f91ca11e784fe5943d0738671f68bf
msgid "image"
msgstr ""
#: ../../modules/prompts.md:11 102220bf95f04f81acc9a0093458f297
msgid ""
"The difference between **Public Prompts** and **Private Prompts** is that"
" Prompts in **Public Prompts** space can be viewed and used by all users,"
" while prompts in **Private Prompts** space can only be viewed and used "
"by the owner."
msgstr ""
"**公共 Prompts**和**私有 Prompts**空间的区别在于,**公共 Prompts**空间下的 Prompt "
"可供所有的用户查看和使用,而**私有 Prompts**空间下的 Prompt 只能被所有者查看和使用。"
#: ../../modules/prompts.md:13 2e0d2f6b335a4aacbdc83b7b7042a701
msgid "Create Prompt"
msgstr "创建 Prompt"
#: ../../modules/prompts.md:15 c9f8c3d1698941e08b90a35fffb2fce1
msgid "Click the \"Add Prompts\" button to pop up the following subpage:"
msgstr "点击 \"新增Prompts\"按钮可以弹出如下的子页面:"
#: ../../modules/prompts.md:19 23ed81a83ab2458f826f2b5d9c55a89a
msgid ""
"**Scene**: It is assumed here that when we have a lot of Prompts, we "
"often classify the Prompts according to scene, such as Prompts in the "
"chat knowledge scene, Prompts in the chat data scene, Prompts in the chat"
" normal scene, etc."
msgstr ""
"**场景**:这里假设,当我们有很多 Prompts 时,往往会根据场景对 Prompts 进行分类,比如在 DB-GPT 项目中chat "
"knowledge 场景的 Prompts、chat data 场景的 Prompts、chat normal 场景的 Prompts 等等。"
#: ../../modules/prompts.md:21 11299da493e741869fe67237f1cb1794
msgid ""
"**Sub Scene**: Continuing with the above, assuming that we have a lot of "
"Prompts, scene classification alone is not enough. For example, in the "
"chat data scenario, there can be many types of sub-scene: anomaly "
"recognition sub scene, attribution analysis sub scene, etc. sub scene is "
"used to distinguish subcategories under each scene."
msgstr ""
"**次级场景**:接着上面的内容,如果我们的 Prompt 很多时,仅使用场景一级分类是不够的。例如,在 chat data "
"场景中,还可以细分为很多的次级场景:异常识别次级场景、归因分析次级场景等等。次级场景是用于区分每个场景下的子类别。"
#: ../../modules/prompts.md:23 c15d62af27094d14acb6428c0e3e1a1d
msgid ""
"**Name**: Considering that a Prompt generally contains a lot of content, "
"for ease of use and easy search, we need to name the Prompt. Note: The "
"name of the Prompt is not allowed to be repeated. Name is the unique key "
"that identifies a Prompt."
msgstr ""
"**名称**:考虑到每个 Prompt 的内容会非常多,为了方便用户使用和搜索,我们需要给每个 Prompt 命名。注意Prompt "
"的名称不允许重复,名称是一个 Prompt 的唯一键。"
#: ../../modules/prompts.md:25 621fe9c729c94e9bbde637b5a1856284
msgid "**Content**: Here is the actual Prompt content that will be input to LLM."
msgstr "**内容**:这里是实际要输入 LLM 的提示内容。"
#: ../../modules/prompts.md:27 ac2f153f704c4841a044daaf6548262b
msgid "Edit Prompt"
msgstr "编辑 Prompt"
#: ../../modules/prompts.md:29 3d6238ea482842e0968f691f3fd0c947
msgid ""
"Existing Prompts can be edited. Note that except **name**, other items "
"can be modified."
msgstr "已有的 Prompts 可以被编辑,除了名称不可修改,其余的内容均可修改。"
#: ../../modules/prompts.md:33 7cbe985fd9534471bce5f93a93da82fd
msgid "Delete Prompt"
msgstr "删除 Prompt"
#: ../../modules/prompts.md:35 849ab9ef2a2c4a29bb827eb373f37b7d
msgid ""
"Ordinary users can only delete Prompts created by themselves in the "
"private Prompts space. Administrator users can delete Prompts in public "
"Prompts spaces and private Prompts spaces."
msgstr ""
"普通用户只能删除他们自己在私有 Prompts 空间中创建的 Prompts管理员可以删除 公共 Prompts 空间下的 "
"Prompts也可以删除私有 Prompts 空间下的 Prompts即使 Prompts 的创建者不是管理员)。"
#: ../../modules/prompts.md:38 191921e5664d4326b01f0c45dc88a1e5
msgid "Use Prompt"
msgstr "使用 Prompt"
#: ../../modules/prompts.md:40 87ad58641f834f30bce178e748d75284
msgid ""
"Users can find and use Prompts next to the input boxes in each scene. "
"Click to view all contents of Prompts library."
msgstr "用户可以在每个场景中的输入框旁边找到并使用 Prompts。 点击悬浮图标可以查看当前用户能使用的全部 Prompts。"
#: ../../modules/prompts.md:42 60458c7980174c73bc0d56e9e27cd2b3
msgid ""
"✓ Hover the mouse over each Prompt to preview the Prompt content. ✓ "
"Click Prompt to automatically fill in the Prompt content in the input "
"box."
msgstr ""
"✓ 将鼠标悬停在每个 Prompt 上,可预览 Prompt 的内容。 ✓ 单击对应的 Prompt可自动将 Prompt "
"的内容填充到输入框中。"

View File

@@ -1,4 +1,4 @@
# Knownledge
# Knowledge
As the knowledge base is currently the most significant user demand scenario, we natively support the construction and processing of knowledge bases. At the same time, we also provide multiple knowledge base management strategies in this project, such as:
1. Default built-in knowledge base
@@ -32,4 +32,4 @@ Optionally, you can run `dbgpt knowledge load --help` command to see more usage.
3.Add the knowledge repository in the interface by entering the name of your knowledge repository (if not specified, enter "default") so you can use it for Q&A based on your knowledge base.
Note that the default vector model used is text2vec-large-chinese (which is a large model, so if your personal computer configuration is not enough, it is recommended to use text2vec-base-chinese). Therefore, ensure that you download the model and place it in the models directory.
Note that the default vector model used is text2vec-large-chinese (which is a large model, so if your personal computer configuration is not enough, it is recommended to use text2vec-base-chinese). Therefore, ensure that you download the model and place it in the models directory.

View File

@@ -2,6 +2,11 @@
The ability of Agent and Plugin is the core of whether large models can be automated. In this project, we natively support the plugin mode, and large models can automatically achieve their goals. At the same time, in order to give full play to the advantages of the community, the plugins used in this project natively support the Auto-GPT plugin ecology, that is, Auto-GPT plugins can directly run in our project.
```{admonition} The LLM (Language Model) suitable for the Plugin scene is
* chatgpt3.5.
* chatgpt4.
```
## Local Plugins
### 1.1 How to write local plugins.

View File

@@ -1,5 +1,46 @@
# Prompts
Prompt is a very important part of the interaction between the large model and the user, and to a certain extent, it determines the quality and accuracy of the answer generated by the large model. In this project, we will automatically optimize the corresponding prompt according to user input and usage scenarios, making it easier and more efficient for users to use large language models.
**Prompt** is a very important part of the interaction between the large model and the user, and to a certain extent, it determines the quality and accuracy of the answer generated by the large model. In this project, we will automatically optimize the corresponding Prompt according to user input and usage scenarios, making it easier and more efficient for users to use large language models.
### 1.DB-GPT Prompt
## Prompt Management
Here, you can choose to create a Prompt in **Public Prompts** space or **Private Prompts** space.
<img width="1657" alt="image" src="https://github.com/eosphoros-ai/DB-GPT/assets/44772254/64d3b666-b8da-48f4-85fe-bf128381c715">
The difference between **Public Prompts** and **Private Prompts** is that Prompts in **Public Prompts** space can be viewed and used by all users, while prompts in **Private Prompts** space can only be viewed and used by the owner.
### Create Prompt
Click the "Add Prompts" button to pop up the following subpage:
<img width="1658" alt="image" src="https://github.com/eosphoros-ai/DB-GPT/assets/44772254/18fac6df-e050-4e41-aac9-bb4a4728a79b">
**Scene**: It is assumed here that when we have a lot of Prompts, we often classify the Prompts according to scene, such as Prompts in the chat knowledge scene, Prompts in the chat data scene, Prompts in the chat normal scene, etc.
**Sub Scene**: Continuing with the above, assuming that we have a lot of Prompts, scene classification alone is not enough. For example, in the chat data scenario, there can be many types of sub-scene: anomaly recognition sub scene, attribution analysis sub scene, etc. sub scene is used to distinguish subcategories under each scene.
**Name**: Considering that a Prompt generally contains a lot of content, for ease of use and easy search, we need to name the Prompt. Note: The name of the Prompt is not allowed to be repeated. Name is the unique key that identifies a Prompt.
**Content**: Here is the actual Prompt content that will be input to LLM.
### Edit Prompt
Existing Prompts can be edited. Note that except **name**, other items can be modified.
<img width="1881" alt="image" src="https://github.com/eosphoros-ai/DB-GPT/assets/44772254/28c66fdb-0dd4-48d1-8604-211b4cced8b6">
### Delete Prompt
Ordinary users can only delete Prompts created by themselves in the private Prompts space. Administrator users can delete Prompts in public Prompts spaces and private Prompts spaces.
## Use Prompt
Users can find and use Prompts next to the input boxes in each scene. Click to view all contents of Prompts library.
✓ Hover the mouse over each Prompt to preview the Prompt content.
✓ Click Prompt to automatically fill in the Prompt content in the input box.
<img width="1907" alt="image" src="https://github.com/eosphoros-ai/DB-GPT/assets/44772254/f63999bc-6b7b-439f-81b7-b9271e65b17b">
<img width="1902" alt="image" src="https://github.com/eosphoros-ai/DB-GPT/assets/44772254/414ab0db-b961-487f-99a8-1edf8f173ebc">

View File

@@ -1 +0,0 @@
# Reference

View File

@@ -9,9 +9,9 @@ sphinx_book_theme
sphinx_rtd_theme==1.0.0
sphinx-typlog-theme==0.8.0
sphinx-panels
sphinx-tabs==3.4.0
toml
myst_nb
sphinx_copybutton
pydata-sphinx-theme==0.13.1
pydantic-settings
furo

View File

@@ -1,74 +0,0 @@
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import gradio as gr
from langchain.agents import AgentType, initialize_agent, load_tools
from llama_index import (
Document,
GPTVectorStoreIndex,
LangchainEmbedding,
LLMPredictor,
ServiceContext,
)
from pilot.model.llm_out.vicuna_llm import VicunaEmbeddingLLM, VicunaRequestLLM
def agent_demo():
llm = VicunaRequestLLM()
tools = load_tools(["python_repl"], llm=llm)
agent = initialize_agent(
tools, llm, agent=AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION, verbose=True
)
agent.run("Write a SQL script that Query 'select count(1)!'")
def knowledged_qa_demo(text_list):
llm_predictor = LLMPredictor(llm=VicunaRequestLLM())
hfemb = VicunaEmbeddingLLM()
embed_model = LangchainEmbedding(hfemb)
documents = [Document(t) for t in text_list]
service_context = ServiceContext.from_defaults(
llm_predictor=llm_predictor, embed_model=embed_model
)
index = GPTVectorStoreIndex.from_documents(
documents, service_context=service_context
)
return index
def get_answer(q):
base_knowledge = """ """
text_list = [base_knowledge]
index = knowledged_qa_demo(text_list)
response = index.query(q)
return response.response
def get_similar(q):
from pilot.vector_store.extract_tovec import knownledge_tovec_st
docsearch = knownledge_tovec_st("./datasets/plan.md")
docs = docsearch.similarity_search_with_score(q, k=1)
for doc in docs:
dc, s = doc
print(s)
yield dc.page_content
if __name__ == "__main__":
# agent_demo()
with gr.Blocks() as demo:
gr.Markdown("数据库智能助手")
with gr.Tab("知识问答"):
text_input = gr.TextArea()
text_output = gr.TextArea()
text_button = gr.Button()
text_button.click(get_similar, inputs=text_input, outputs=text_output)
demo.queue(concurrency_count=3).launch(server_name="0.0.0.0")

View File

@@ -0,0 +1,56 @@
"""AWEL: Simple chat dag example
DB-GPT will automatically load and execute the current file after startup.
Example:
.. code-block:: shell
curl -X POST http://127.0.0.1:5000/api/v1/awel/trigger/examples/simple_chat \
-H "Content-Type: application/json" -d '{
"model": "proxyllm",
"user_input": "hello"
}'
"""
from typing import Dict
from pydantic import BaseModel, Field
from pilot.awel import DAG, HttpTrigger, MapOperator
from pilot.scene.base_message import ModelMessage
from pilot.model.base import ModelOutput
from pilot.model.operator.model_operator import ModelOperator
class TriggerReqBody(BaseModel):
model: str = Field(..., description="Model name")
user_input: str = Field(..., description="User input")
class RequestHandleOperator(MapOperator[TriggerReqBody, Dict]):
def __init__(self, **kwargs):
super().__init__(**kwargs)
async def map(self, input_value: TriggerReqBody) -> Dict:
hist = []
hist.append(ModelMessage.build_human_message(input_value.user_input))
hist = list(h.dict() for h in hist)
params = {
"prompt": input_value.user_input,
"messages": hist,
"model": input_value.model,
"echo": False,
}
print(f"Receive input value: {input_value}")
return params
with DAG("dbgpt_awel_simple_dag_example") as dag:
# Receive http request and trigger dag to run.
trigger = HttpTrigger(
"/examples/simple_chat", methods="POST", request_body=TriggerReqBody
)
request_handle_task = RequestHandleOperator()
model_task = ModelOperator()
# type(out) == ModelOutput
model_parse_task = MapOperator(lambda out: out.to_dict())
trigger >> request_handle_task >> model_task >> model_parse_task

View File

@@ -0,0 +1,34 @@
"""AWEL: Simple dag example
DB-GPT will automatically load and execute the current file after startup.
Example:
.. code-block:: shell
curl -X GET http://127.0.0.1:5000/api/v1/awel/trigger/examples/hello\?name\=zhangsan
"""
from pydantic import BaseModel, Field
from pilot.awel import DAG, HttpTrigger, MapOperator
class TriggerReqBody(BaseModel):
name: str = Field(..., description="User name")
age: int = Field(18, description="User age")
class RequestHandleOperator(MapOperator[TriggerReqBody, str]):
def __init__(self, **kwargs):
super().__init__(**kwargs)
async def map(self, input_value: TriggerReqBody) -> str:
print(f"Receive input value: {input_value}")
return f"Hello, {input_value.name}, your age is {input_value.age}"
with DAG("simple_dag_example") as dag:
trigger = HttpTrigger("/examples/hello", request_body=TriggerReqBody)
map_node = RequestHandleOperator()
trigger >> map_node

View File

@@ -0,0 +1,73 @@
"""AWEL: Simple rag example
DB-GPT will automatically load and execute the current file after startup.
Example:
.. code-block:: shell
curl -X POST http://127.0.0.1:5000/api/v1/awel/trigger/examples/simple_rag \
-H "Content-Type: application/json" -d '{
"conv_uid": "36f0e992-8825-11ee-8638-0242ac150003",
"model_name": "proxyllm",
"chat_mode": "chat_knowledge",
"user_input": "What is DB-GPT?",
"select_param": "default"
}'
"""
from pilot.awel import HttpTrigger, DAG, MapOperator
from pilot.scene.operator._experimental import (
ChatContext,
PromptManagerOperator,
ChatHistoryStorageOperator,
ChatHistoryOperator,
EmbeddingEngingOperator,
BaseChatOperator,
)
from pilot.scene.base import ChatScene
from pilot.openapi.api_view_model import ConversationVo
from pilot.model.base import ModelOutput
from pilot.model.operator.model_operator import ModelOperator
class RequestParseOperator(MapOperator[ConversationVo, ChatContext]):
def __init__(self, **kwargs):
super().__init__(**kwargs)
async def map(self, input_value: ConversationVo) -> ChatContext:
return ChatContext(
current_user_input=input_value.user_input,
model_name=input_value.model_name,
chat_session_id=input_value.conv_uid,
select_param=input_value.select_param,
chat_scene=ChatScene.ChatKnowledge,
)
with DAG("simple_rag_example") as dag:
trigger_task = HttpTrigger(
"/examples/simple_rag", methods="POST", request_body=ConversationVo
)
req_parse_task = RequestParseOperator()
# TODO should register prompt template first
prompt_task = PromptManagerOperator()
history_storage_task = ChatHistoryStorageOperator()
history_task = ChatHistoryOperator()
embedding_task = EmbeddingEngingOperator()
chat_task = BaseChatOperator()
model_task = ModelOperator()
output_parser_task = MapOperator(lambda out: out.to_dict()["text"])
(
trigger_task
>> req_parse_task
>> prompt_task
>> history_storage_task
>> history_task
>> embedding_task
>> chat_task
>> model_task
>> output_parser_task
)

View File

@@ -1,82 +0,0 @@
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import json
import os
import sys
from urllib.parse import urljoin
import gradio as gr
import requests
ROOT_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(ROOT_PATH)
from langchain.prompts import PromptTemplate
from pilot.configs.config import Config
from pilot.conversation import conv_qa_prompt_template, conv_templates
llmstream_stream_path = "generate_stream"
CFG = Config()
def generate(query):
template_name = "conv_one_shot"
state = conv_templates[template_name].copy()
# pt = PromptTemplate(
# template=conv_qa_prompt_template,
# input_variables=["context", "question"]
# )
# result = pt.format(context="This page covers how to use the Chroma ecosystem within LangChain. It is broken into two parts: installation and setup, and then references to specific Chroma wrappers.",
# question=query)
# print(result)
state.append_message(state.roles[0], query)
state.append_message(state.roles[1], None)
prompt = state.get_prompt()
params = {
"model": "chatglm-6b",
"prompt": prompt,
"temperature": 1.0,
"max_new_tokens": 1024,
"stop": "###",
}
response = requests.post(
url=urljoin(CFG.MODEL_SERVER, llmstream_stream_path), data=json.dumps(params)
)
skip_echo_len = len(params["prompt"]) + 1 - params["prompt"].count("</s>") * 3
for chunk in response.iter_lines(decode_unicode=False, delimiter=b"\0"):
if chunk:
data = json.loads(chunk.decode())
if data["error_code"] == 0:
if "vicuna" in CFG.LLM_MODEL:
output = data["text"][skip_echo_len:].strip()
else:
output = data["text"].strip()
state.messages[-1][-1] = output + ""
yield (output)
if __name__ == "__main__":
print(CFG.LLM_MODEL)
with gr.Blocks() as demo:
gr.Markdown("数据库SQL生成助手")
with gr.Tab("SQL生成"):
text_input = gr.TextArea()
text_output = gr.TextArea()
text_button = gr.Button("提交")
text_button.click(generate, inputs=text_input, outputs=text_output)
demo.queue(concurrency_count=3).launch(server_name="0.0.0.0")

View File

@@ -1,19 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import sys
from llama_index import GPTVectorStoreIndex, SimpleDirectoryReader
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))
# read the document of data dir
documents = SimpleDirectoryReader("data").load_data()
# split the document to chunk, max token size=500, convert chunk to vector
index = GPTVectorStoreIndex(documents)
# save index
index.save_to_disk("index.json")

View File

@@ -1,21 +0,0 @@
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import gradio as gr
def change_tab():
return gr.Tabs.update(selected=1)
with gr.Blocks() as demo:
with gr.Tabs() as tabs:
with gr.TabItem("Train", id=0):
t = gr.Textbox()
with gr.TabItem("Inference", id=1):
i = gr.Image()
btn = gr.Button()
btn.click(change_tab, None, tabs)
demo.launch()

View File

@@ -1,18 +0,0 @@
from pilot.embedding_engine.csv_embedding import CSVEmbedding
# path = "/Users/chenketing/Downloads/share_ireserve双写数据异常2.xlsx"
path = "xx.csv"
model_name = "your_path/all-MiniLM-L6-v2"
vector_store_path = "your_path/"
pdf_embedding = CSVEmbedding(
file_path=path,
model_name=model_name,
vector_store_config={
"vector_store_name": "url",
"vector_store_path": "vector_store_path",
},
)
pdf_embedding.source_embedding()
print("success")

View File

@@ -1,18 +0,0 @@
from pilot.embedding_engine.pdf_embedding import PDFEmbedding
path = "xxx.pdf"
path = "your_path/OceanBase-数据库-V4.1.0-应用开发.pdf"
model_name = "your_path/all-MiniLM-L6-v2"
vector_store_path = "your_path/"
pdf_embedding = PDFEmbedding(
file_path=path,
model_name=model_name,
vector_store_config={
"vector_store_name": "ob-pdf",
"vector_store_path": vector_store_path,
},
)
pdf_embedding.source_embedding()
print("success")

View File

@@ -1,17 +0,0 @@
from pilot.embedding_engine.url_embedding import URLEmbedding
path = "https://www.understandingwar.org/backgrounder/russian-offensive-campaign-assessment-february-8-2023"
model_name = "your_path/all-MiniLM-L6-v2"
vector_store_path = "your_path"
pdf_embedding = URLEmbedding(
file_path=path,
model_name=model_name,
vector_store_config={
"vector_store_name": "url",
"vector_store_path": "vector_store_path",
},
)
pdf_embedding.source_embedding()
print("success")

View File

@@ -1,67 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import dashscope
import requests
import hashlib
from http import HTTPStatus
from dashscope import Generation
def call_with_messages():
messages = [
{"role": "system", "content": "你是生活助手机器人。"},
{"role": "user", "content": "如何做西红柿鸡蛋?"},
]
gen = Generation()
response = gen.call(
Generation.Models.qwen_turbo,
messages=messages,
stream=True,
top_p=0.8,
result_format="message", # set the result to be "message" format.
)
for response in response:
# The response status_code is HTTPStatus.OK indicate success,
# otherwise indicate request is failed, you can get error code
# and message from code and message.
if response.status_code == HTTPStatus.OK:
print(response.output) # The output text
print(response.usage) # The usage information
else:
print(response.code) # The error code.
print(response.message) # The error message.
def build_access_token(api_key: str, secret_key: str) -> str:
"""
Generate Access token according AK, SK
"""
url = "https://aip.baidubce.com/oauth/2.0/token"
params = {
"grant_type": "client_credentials",
"client_id": api_key,
"client_secret": secret_key,
}
res = requests.get(url=url, params=params)
if res.status_code == 200:
return res.json().get("access_token")
def _calculate_md5(text: str) -> str:
md5 = hashlib.md5()
md5.update(text.encode("utf-8"))
encrypted = md5.hexdigest()
return encrypted
def baichuan_call():
url = "https://api.baichuan-ai.com/v1/stream/chat"
if __name__ == "__main__":
call_with_messages()

View File

@@ -1,257 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import torch
from langchain.embeddings.huggingface import HuggingFaceEmbeddings
from langchain.llms.base import LLM
from llama_index import (
GPTListIndex,
GPTVectorStoreIndex,
LangchainEmbedding,
LLMPredictor,
PromptHelper,
SimpleDirectoryReader,
)
from transformers import pipeline
class FlanLLM(LLM):
model_name = "google/flan-t5-large"
pipeline = pipeline(
"text2text-generation",
model=model_name,
device=0,
model_kwargs={"torch_dtype": torch.bfloat16},
)
def _call(self, prompt, stop=None):
return self.pipeline(prompt, max_length=9999)[0]["generated_text"]
def _identifying_params(self):
return {"name_of_model": self.model_name}
def _llm_type(self):
return "custome"
llm_predictor = LLMPredictor(llm=FlanLLM())
hfemb = HuggingFaceEmbeddings()
embed_model = LangchainEmbedding(hfemb)
text1 = """
执行计划是对一条 SQL 查询语句在数据库中执行过程的描述。用户可以通过 EXPLAIN 命令查看优化器针对指定 SQL 生成的逻辑执行计划。
如果要分析某条 SQL 的性能问题,通常需要先查看 SQL 的执行计划,排查每一步 SQL 执行是否存在问题。所以读懂执行计划是 SQL 优化的先决条件,而了解执行计划的算子是理解 EXPLAIN 命令的关键。
OceanBase 数据库的执行计划命令有三种模式EXPLAIN BASIC、EXPLAIN 和 EXPLAIN EXTENDED。这三种模式对执行计划展现不同粒度的细节信息:
EXPLAIN BASIC 命令用于最基本的计划展示。
EXPLAIN EXTENDED 命令用于最详细的计划展示(通常在排查问题时使用这种展示模式)。
EXPLAIN 命令所展示的信息可以帮助普通用户了解整个计划的执行方式。
EXPLAIN 命令格式如下:
EXPLAIN [BASIC | EXTENDED | PARTITIONS | FORMAT = format_name] [PRETTY | PRETTY_COLOR] explainable_stmt
format_name:
{ TRADITIONAL | JSON }
explainable_stmt:
{ SELECT statement
| DELETE statement
| INSERT statement
| REPLACE statement
| UPDATE statement }
EXPLAIN 命令适用于 SELECT、DELETE、INSERT、REPLACE 和 UPDATE 语句,显示优化器所提供的有关语句执行计划的信息,包括如何处理该语句,如何联接表以及以何种顺序联接表等信息。
一般来说,可以使用 EXPLAIN EXTENDED 命令,将表扫描的范围段展示出来。使用 EXPLAIN OUTLINE 命令可以显示 Outline 信息。
FORMAT 选项可用于选择输出格式。TRADITIONAL 表示以表格格式显示输出这也是默认设置。JSON 表示以 JSON 格式显示信息。
使用 EXPLAIN PARTITITIONS 也可用于检查涉及分区表的查询。如果检查针对非分区表的查询,则不会产生错误,但 PARTIONS 列的值始终为 NULL。
对于复杂的执行计划,可以使用 PRETTY 或者 PRETTY_COLOR 选项将计划树中的父节点和子节点使用树线或彩色树线连接起来,使得执行计划展示更方便阅读。示例如下:
obclient> CREATE TABLE p1table(c1 INT ,c2 INT) PARTITION BY HASH(c1) PARTITIONS 2;
Query OK, 0 rows affected
obclient> CREATE TABLE p2table(c1 INT ,c2 INT) PARTITION BY HASH(c1) PARTITIONS 4;
Query OK, 0 rows affected
obclient> EXPLAIN EXTENDED PRETTY_COLOR SELECT * FROM p1table p1 JOIN p2table p2 ON p1.c1=p2.c2\G
*************************** 1. row ***************************
Query Plan: ==========================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------------------------
|0 |PX COORDINATOR | |1 |278 |
|1 | EXCHANGE OUT DISTR |:EX10001|1 |277 |
|2 | HASH JOIN | |1 |276 |
|3 | ├PX PARTITION ITERATOR | |1 |92 |
|4 | │ TABLE SCAN |P1 |1 |92 |
|5 | └EXCHANGE IN DISTR | |1 |184 |
|6 | EXCHANGE OUT DISTR (PKEY)|:EX10000|1 |184 |
|7 | PX PARTITION ITERATOR | |1 |183 |
|8 | TABLE SCAN |P2 |1 |183 |
==========================================================
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(P1.C1, P1.C2, P2.C1, P2.C2)]), filter(nil)
1 - output([INTERNAL_FUNCTION(P1.C1, P1.C2, P2.C1, P2.C2)]), filter(nil), dop=1
2 - output([P1.C1], [P2.C2], [P1.C2], [P2.C1]), filter(nil),
equal_conds([P1.C1 = P2.C2]), other_conds(nil)
3 - output([P1.C1], [P1.C2]), filter(nil)
4 - output([P1.C1], [P1.C2]), filter(nil),
access([P1.C1], [P1.C2]), partitions(p[0-1])
5 - output([P2.C2], [P2.C1]), filter(nil)
6 - (#keys=1, [P2.C2]), output([P2.C2], [P2.C1]), filter(nil), dop=1
7 - output([P2.C1], [P2.C2]), filter(nil)
8 - output([P2.C1], [P2.C2]), filter(nil),
access([P2.C1], [P2.C2]), partitions(p[0-3])
1 row in set
## 执行计划形状与算子信息
在数据库系统中,执行计划在内部通常是以树的形式来表示的,但是不同的数据库会选择不同的方式展示给用户。
如下示例分别为 PostgreSQL 数据库、Oracle 数据库和 OceanBase 数据库对于 TPCDS Q3 的计划展示。
```sql
obclient> SELECT /*TPC-DS Q3*/ *
FROM (SELECT dt.d_year,
item.i_brand_id brand_id,
item.i_brand brand,
Sum(ss_net_profit) sum_agg
FROM date_dim dt,
store_sales,
item
WHERE dt.d_date_sk = store_sales.ss_sold_date_sk
AND store_sales.ss_item_sk = item.i_item_sk
AND item.i_manufact_id = 914
AND dt.d_moy = 11
GROUP BY dt.d_year,
item.i_brand,
item.i_brand_id
ORDER BY dt.d_year,
sum_agg DESC,
brand_id)
WHERE ROWNUM <= 100;
PostgreSQL 数据库执行计划展示如下:
Limit (cost=13986.86..13987.20 rows=27 width=91)
Sort (cost=13986.86..13986.93 rows=27 width=65)
Sort Key: dt.d_year, (sum(store_sales.ss_net_profit)), item.i_brand_id
HashAggregate (cost=13985.95..13986.22 rows=27 width=65)
Merge Join (cost=13884.21..13983.91 rows=204 width=65)
Merge Cond: (dt.d_date_sk = store_sales.ss_sold_date_sk)
Index Scan using date_dim_pkey on date_dim dt (cost=0.00..3494.62 rows=6080 width=8)
Filter: (d_moy = 11)
Sort (cost=12170.87..12177.27 rows=2560 width=65)
Sort Key: store_sales.ss_sold_date_sk
Nested Loop (cost=6.02..12025.94 rows=2560 width=65)
Seq Scan on item (cost=0.00..1455.00 rows=16 width=59)
Filter: (i_manufact_id = 914)
Bitmap Heap Scan on store_sales (cost=6.02..658.94 rows=174 width=14)
Recheck Cond: (ss_item_sk = item.i_item_sk)
Bitmap Index Scan on store_sales_pkey (cost=0.00..5.97 rows=174 width=0)
Index Cond: (ss_item_sk = item.i_item_sk)
Oracle 数据库执行计划展示如下:
Plan hash value: 2331821367
--------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 100 | 9100 | 3688 (1)| 00:00:01 |
|* 1 | COUNT STOPKEY | | | | | |
| 2 | VIEW | | 2736 | 243K| 3688 (1)| 00:00:01 |
|* 3 | SORT ORDER BY STOPKEY | | 2736 | 256K| 3688 (1)| 00:00:01 |
| 4 | HASH GROUP BY | | 2736 | 256K| 3688 (1)| 00:00:01 |
|* 5 | HASH JOIN | | 2736 | 256K| 3686 (1)| 00:00:01 |
|* 6 | TABLE ACCESS FULL | DATE_DIM | 6087 | 79131 | 376 (1)| 00:00:01 |
| 7 | NESTED LOOPS | | 2865 | 232K| 3310 (1)| 00:00:01 |
| 8 | NESTED LOOPS | | 2865 | 232K| 3310 (1)| 00:00:01 |
|* 9 | TABLE ACCESS FULL | ITEM | 18 | 1188 | 375 (0)| 00:00:01 |
|* 10 | INDEX RANGE SCAN | SYS_C0010069 | 159 | | 2 (0)| 00:00:01 |
| 11 | TABLE ACCESS BY INDEX ROWID| STORE_SALES | 159 | 2703 | 163 (0)| 00:00:01 |
--------------------------------------------------------------------------------------------------
OceanBase 数据库执行计划展示如下:
|ID|OPERATOR |NAME |EST. ROWS|COST |
-------------------------------------------------------
|0 |LIMIT | |100 |81141|
|1 | TOP-N SORT | |100 |81127|
|2 | HASH GROUP BY | |2924 |68551|
|3 | HASH JOIN | |2924 |65004|
|4 | SUBPLAN SCAN |VIEW1 |2953 |19070|
|5 | HASH GROUP BY | |2953 |18662|
|6 | NESTED-LOOP JOIN| |2953 |15080|
|7 | TABLE SCAN |ITEM |19 |11841|
|8 | TABLE SCAN |STORE_SALES|161 |73 |
|9 | TABLE SCAN |DT |6088 |29401|
=======================================================
由示例可见OceanBase 数据库的计划展示与 Oracle 数据库类似。
OceanBase 数据库执行计划中的各列的含义如下:
列名 含义
ID 执行树按照前序遍历的方式得到的编号(从 0 开始)。
OPERATOR 操作算子的名称。
NAME 对应表操作的表名(索引名)。
EST. ROWS 估算该操作算子的输出行数。
COST 该操作算子的执行代价(微秒)。
OceanBase 数据库 EXPLAIN 命令输出的第一部分是执行计划的树形结构展示。其中每一个操作在树中的层次通过其在 operator 中的缩进予以展示,层次最深的优先执行,层次相同的以特定算子的执行顺序为标准来执行。
问题: update a not exists (b…)
我一开始以为 B是驱动表B的数据挺多的 后来看到NLAJ是说左边的表关联右边的表
所以这个的驱动表是不是实际是A用A的匹配B的这个理解有问题吗
回答: 没错 A 驱动 B的
问题: 光知道最下最右的是驱动表了 所以一开始搞得有点懵 :sweat_smile:
回答: nlj应该原理应该都是左表(驱动表)的记录探测右表(被驱动表) 选哪张成为左表或右表就基于一些其他考量了,比如数据量, 而anti join/semi join只是对 not exist/exist的一种优化相关的原理和资料网上可以查阅一下
问题: 也就是nlj 就是按照之前理解的谁先执行 谁就是驱动表 也就是执行计划中的最右的表
而anti join/semi join谁在not exist左面谁就是驱动表。这么理解对吧
回答: nlj也是左表的表是驱动表这个要了解下计划执行方面的基本原理取左表的一行数据再遍历右表一旦满足连接条件就可以返回数据
anti/semi只是因为not exists/exist的语义只是返回左表数据改成anti join是一种计划优化连接的方式比子查询更优
"""
from llama_index import Document
text_list = [text1]
documents = [Document(t) for t in text_list]
num_output = 250
max_input_size = 512
max_chunk_overlap = 20
prompt_helper = PromptHelper(max_input_size, num_output, max_chunk_overlap)
index = GPTListIndex(
documents,
embed_model=embed_model,
llm_predictor=llm_predictor,
prompt_helper=prompt_helper,
)
index.save_to_disk("index.json")
if __name__ == "__main__":
import logging
logging.getLogger().setLevel(logging.CRITICAL)
for d in documents:
print(d)
response = index.query("数据库的执行计划命令有多少?")
print(response)

87
pilot/awel/__init__.py Normal file
View File

@@ -0,0 +1,87 @@
"""Agentic Workflow Expression Language (AWEL)
Note:
AWEL is still an experimental feature and only opens the lowest level API.
The stability of this API cannot be guaranteed at present.
"""
from pilot.component import SystemApp
from .dag.base import DAGContext, DAG
from .operator.base import BaseOperator, WorkflowRunner
from .operator.common_operator import (
JoinOperator,
ReduceStreamOperator,
MapOperator,
BranchOperator,
InputOperator,
BranchFunc,
)
from .operator.stream_operator import (
StreamifyAbsOperator,
UnstreamifyAbsOperator,
TransformStreamAbsOperator,
)
from .task.base import TaskState, TaskOutput, TaskContext, InputContext, InputSource
from .task.task_impl import (
SimpleInputSource,
SimpleCallDataInputSource,
DefaultTaskContext,
DefaultInputContext,
SimpleTaskOutput,
SimpleStreamTaskOutput,
_is_async_iterator,
)
from .trigger.http_trigger import HttpTrigger
from .runner.local_runner import DefaultWorkflowRunner
__all__ = [
"initialize_awel",
"DAGContext",
"DAG",
"BaseOperator",
"JoinOperator",
"ReduceStreamOperator",
"MapOperator",
"BranchOperator",
"InputOperator",
"BranchFunc",
"WorkflowRunner",
"TaskState",
"TaskOutput",
"TaskContext",
"InputContext",
"InputSource",
"DefaultWorkflowRunner",
"SimpleInputSource",
"SimpleCallDataInputSource",
"DefaultTaskContext",
"DefaultInputContext",
"SimpleTaskOutput",
"SimpleStreamTaskOutput",
"StreamifyAbsOperator",
"UnstreamifyAbsOperator",
"TransformStreamAbsOperator",
"HttpTrigger",
]
def initialize_awel(system_app: SystemApp, dag_filepath: str):
from .dag.dag_manager import DAGManager
from .dag.base import DAGVar
from .trigger.trigger_manager import DefaultTriggerManager
from .operator.base import initialize_runner
DAGVar.set_current_system_app(system_app)
system_app.register(DefaultTriggerManager)
dag_manager = DAGManager(system_app, dag_filepath)
system_app.register_instance(dag_manager)
initialize_runner(DefaultWorkflowRunner())
# Load all dags
dag_manager.load_dags()

7
pilot/awel/base.py Normal file
View File

@@ -0,0 +1,7 @@
from abc import ABC, abstractmethod
class Trigger(ABC):
@abstractmethod
async def trigger(self) -> None:
"""Trigger the workflow or a specific operation in the workflow."""

364
pilot/awel/dag/base.py Normal file
View File

@@ -0,0 +1,364 @@
from abc import ABC, abstractmethod
from typing import Optional, Dict, List, Sequence, Union, Any, Set
import uuid
import contextvars
import threading
import asyncio
import logging
from collections import deque
from functools import cache
from concurrent.futures import Executor
from pilot.component import SystemApp
from ..resource.base import ResourceGroup
from ..task.base import TaskContext
logger = logging.getLogger(__name__)
DependencyType = Union["DependencyMixin", Sequence["DependencyMixin"]]
def _is_async_context():
try:
loop = asyncio.get_running_loop()
return asyncio.current_task(loop=loop) is not None
except RuntimeError:
return False
class DependencyMixin(ABC):
@abstractmethod
def set_upstream(self, nodes: DependencyType) -> "DependencyMixin":
"""Set one or more upstream nodes for this node.
Args:
nodes (DependencyType): Upstream nodes to be set to current node.
Returns:
DependencyMixin: Returns self to allow method chaining.
Raises:
ValueError: If no upstream nodes are provided or if an argument is not a DependencyMixin.
"""
@abstractmethod
def set_downstream(self, nodes: DependencyType) -> "DependencyMixin":
"""Set one or more downstream nodes for this node.
Args:
nodes (DependencyType): Downstream nodes to be set to current node.
Returns:
DependencyMixin: Returns self to allow method chaining.
Raises:
ValueError: If no downstream nodes are provided or if an argument is not a DependencyMixin.
"""
def __lshift__(self, nodes: DependencyType) -> DependencyType:
"""Implements self << nodes
Example:
.. code-block:: python
# means node.set_upstream(input_node)
node << input_node
# means node2.set_upstream([input_node])
node2 << [input_node]
"""
self.set_upstream(nodes)
return nodes
def __rshift__(self, nodes: DependencyType) -> DependencyType:
"""Implements self >> nodes
Example:
.. code-block:: python
# means node.set_downstream(next_node)
node >> next_node
# means node2.set_downstream([next_node])
node2 >> [next_node]
"""
self.set_downstream(nodes)
return nodes
def __rrshift__(self, nodes: DependencyType) -> "DependencyMixin":
"""Implements [node] >> self"""
self.__lshift__(nodes)
return self
def __rlshift__(self, nodes: DependencyType) -> "DependencyMixin":
"""Implements [node] << self"""
self.__rshift__(nodes)
return self
class DAGVar:
_thread_local = threading.local()
_async_local = contextvars.ContextVar("current_dag_stack", default=deque())
_system_app: SystemApp = None
_executor: Executor = None
@classmethod
def enter_dag(cls, dag) -> None:
is_async = _is_async_context()
if is_async:
stack = cls._async_local.get()
stack.append(dag)
cls._async_local.set(stack)
else:
if not hasattr(cls._thread_local, "current_dag_stack"):
cls._thread_local.current_dag_stack = deque()
cls._thread_local.current_dag_stack.append(dag)
@classmethod
def exit_dag(cls) -> None:
is_async = _is_async_context()
if is_async:
stack = cls._async_local.get()
if stack:
stack.pop()
cls._async_local.set(stack)
else:
if (
hasattr(cls._thread_local, "current_dag_stack")
and cls._thread_local.current_dag_stack
):
cls._thread_local.current_dag_stack.pop()
@classmethod
def get_current_dag(cls) -> Optional["DAG"]:
is_async = _is_async_context()
if is_async:
stack = cls._async_local.get()
return stack[-1] if stack else None
else:
if (
hasattr(cls._thread_local, "current_dag_stack")
and cls._thread_local.current_dag_stack
):
return cls._thread_local.current_dag_stack[-1]
return None
@classmethod
def get_current_system_app(cls) -> SystemApp:
if not cls._system_app:
raise RuntimeError("System APP not set for DAGVar")
return cls._system_app
@classmethod
def set_current_system_app(cls, system_app: SystemApp) -> None:
if cls._system_app:
logger.warn("System APP has already set, nothing to do")
else:
cls._system_app = system_app
@classmethod
def get_executor(cls) -> Executor:
return cls._executor
@classmethod
def set_executor(cls, executor: Executor) -> None:
cls._executor = executor
class DAGNode(DependencyMixin, ABC):
resource_group: Optional[ResourceGroup] = None
"""The resource group of current DAGNode"""
def __init__(
self,
dag: Optional["DAG"] = None,
node_id: Optional[str] = None,
node_name: Optional[str] = None,
system_app: Optional[SystemApp] = None,
executor: Optional[Executor] = None,
) -> None:
super().__init__()
self._upstream: List["DAGNode"] = []
self._downstream: List["DAGNode"] = []
self._dag: Optional["DAG"] = dag or DAGVar.get_current_dag()
self._system_app: Optional[SystemApp] = (
system_app or DAGVar.get_current_system_app()
)
self._executor: Optional[Executor] = executor or DAGVar.get_executor()
if not node_id and self._dag:
node_id = self._dag._new_node_id()
self._node_id: str = node_id
self._node_name: str = node_name
@property
def node_id(self) -> str:
return self._node_id
@property
def system_app(self) -> SystemApp:
return self._system_app
def set_node_id(self, node_id: str) -> None:
self._node_id = node_id
def __hash__(self) -> int:
if self.node_id:
return hash(self.node_id)
else:
return super().__hash__()
def __eq__(self, other: Any) -> bool:
if not isinstance(other, DAGNode):
return False
return self.node_id == other.node_id
@property
def node_name(self) -> str:
return self._node_name
@property
def dag(self) -> "DAG":
return self._dag
def set_upstream(self, nodes: DependencyType) -> "DAGNode":
self.set_dependency(nodes)
def set_downstream(self, nodes: DependencyType) -> "DAGNode":
self.set_dependency(nodes, is_upstream=False)
@property
def upstream(self) -> List["DAGNode"]:
return self._upstream
@property
def downstream(self) -> List["DAGNode"]:
return self._downstream
def set_dependency(self, nodes: DependencyType, is_upstream: bool = True) -> None:
if not isinstance(nodes, Sequence):
nodes = [nodes]
if not all(isinstance(node, DAGNode) for node in nodes):
raise ValueError(
"all nodes to set dependency to current node must be instance of 'DAGNode'"
)
nodes: Sequence[DAGNode] = nodes
dags = set([node.dag for node in nodes if node.dag])
if self.dag:
dags.add(self.dag)
if not dags:
raise ValueError("set dependency to current node must in a DAG context")
if len(dags) != 1:
raise ValueError(
"set dependency to current node just support in one DAG context"
)
dag = dags.pop()
self._dag = dag
dag._append_node(self)
for node in nodes:
if is_upstream and node not in self.upstream:
node._dag = dag
dag._append_node(node)
self._upstream.append(node)
node._downstream.append(self)
elif node not in self._downstream:
node._dag = dag
dag._append_node(node)
self._downstream.append(node)
node._upstream.append(self)
class DAGContext:
def __init__(self) -> None:
self._curr_task_ctx = None
self._share_data: Dict[str, Any] = {}
@property
def current_task_context(self) -> TaskContext:
return self._curr_task_ctx
def set_current_task_context(self, _curr_task_ctx: TaskContext) -> None:
self._curr_task_ctx = _curr_task_ctx
async def get_share_data(self, key: str) -> Any:
return self._share_data.get(key)
async def save_to_share_data(self, key: str, data: Any) -> None:
self._share_data[key] = data
class DAG:
def __init__(
self, dag_id: str, resource_group: Optional[ResourceGroup] = None
) -> None:
self._dag_id = dag_id
self.node_map: Dict[str, DAGNode] = {}
self._root_nodes: Set[DAGNode] = None
self._leaf_nodes: Set[DAGNode] = None
self._trigger_nodes: Set[DAGNode] = None
def _append_node(self, node: DAGNode) -> None:
self.node_map[node.node_id] = node
# clear cached nodes
self._root_nodes = None
self._leaf_nodes = None
def _new_node_id(self) -> str:
return str(uuid.uuid4())
@property
def dag_id(self) -> str:
return self._dag_id
def _build(self) -> None:
from ..operator.common_operator import TriggerOperator
nodes = set()
for _, node in self.node_map.items():
nodes = nodes.union(_get_nodes(node))
self._root_nodes = list(set(filter(lambda x: not x.upstream, nodes)))
self._leaf_nodes = list(set(filter(lambda x: not x.downstream, nodes)))
self._trigger_nodes = list(
set(filter(lambda x: isinstance(x, TriggerOperator), nodes))
)
@property
def root_nodes(self) -> List[DAGNode]:
if not self._root_nodes:
self._build()
return self._root_nodes
@property
def leaf_nodes(self) -> List[DAGNode]:
if not self._leaf_nodes:
self._build()
return self._leaf_nodes
@property
def trigger_nodes(self):
if not self._trigger_nodes:
self._build()
return self._trigger_nodes
def __enter__(self):
DAGVar.enter_dag(self)
return self
def __exit__(self, exc_type, exc_val, exc_tb):
DAGVar.exit_dag()
def _get_nodes(node: DAGNode, is_upstream: Optional[bool] = True) -> set[DAGNode]:
nodes = set()
if not node:
return nodes
nodes.add(node)
stream_nodes = node.upstream if is_upstream else node.downstream
for node in stream_nodes:
nodes = nodes.union(_get_nodes(node, is_upstream))
return nodes

View File

@@ -0,0 +1,42 @@
from typing import Dict, Optional
import logging
from pilot.component import BaseComponent, ComponentType, SystemApp
from .loader import DAGLoader, LocalFileDAGLoader
from .base import DAG
logger = logging.getLogger(__name__)
class DAGManager(BaseComponent):
name = ComponentType.AWEL_DAG_MANAGER
def __init__(self, system_app: SystemApp, dag_filepath: str):
super().__init__(system_app)
self.dag_loader = LocalFileDAGLoader(dag_filepath)
self.system_app = system_app
self.dag_map: Dict[str, DAG] = {}
def init_app(self, system_app: SystemApp):
self.system_app = system_app
def load_dags(self):
dags = self.dag_loader.load_dags()
triggers = []
for dag in dags:
dag_id = dag.dag_id
if dag_id in self.dag_map:
raise ValueError(f"Load DAG error, DAG ID {dag_id} has already exist")
triggers += dag.trigger_nodes
from ..trigger.trigger_manager import DefaultTriggerManager
trigger_manager: DefaultTriggerManager = self.system_app.get_component(
ComponentType.AWEL_TRIGGER_MANAGER,
DefaultTriggerManager,
default_component=None,
)
if trigger_manager:
for trigger in triggers:
trigger_manager.register_trigger(trigger)
trigger_manager.after_register()
else:
logger.warn("No trigger manager, not register dag trigger")

93
pilot/awel/dag/loader.py Normal file
View File

@@ -0,0 +1,93 @@
from abc import ABC, abstractmethod
from typing import List
import os
import hashlib
import sys
import logging
import traceback
from .base import DAG
logger = logging.getLogger(__name__)
class DAGLoader(ABC):
@abstractmethod
def load_dags(self) -> List[DAG]:
"""Load dags"""
class LocalFileDAGLoader(DAGLoader):
def __init__(self, filepath: str) -> None:
super().__init__()
self._filepath = filepath
def load_dags(self) -> List[DAG]:
if not os.path.exists(self._filepath):
return []
if os.path.isdir(self._filepath):
return _process_directory(self._filepath)
else:
return _process_file(self._filepath)
def _process_directory(directory: str) -> List[DAG]:
dags = []
for file in os.listdir(directory):
if file.endswith(".py"):
filepath = os.path.join(directory, file)
dags += _process_file(filepath)
return dags
def _process_file(filepath) -> List[DAG]:
mods = _load_modules_from_file(filepath)
results = _process_modules(mods)
return results
def _load_modules_from_file(filepath: str):
import importlib
import importlib.machinery
import importlib.util
logger.info(f"Importing {filepath}")
org_mod_name, _ = os.path.splitext(os.path.split(filepath)[-1])
path_hash = hashlib.sha1(filepath.encode("utf-8")).hexdigest()
mod_name = f"unusual_prefix_{path_hash}_{org_mod_name}"
if mod_name in sys.modules:
del sys.modules[mod_name]
def parse(mod_name, filepath):
try:
loader = importlib.machinery.SourceFileLoader(mod_name, filepath)
spec = importlib.util.spec_from_loader(mod_name, loader)
new_module = importlib.util.module_from_spec(spec)
sys.modules[spec.name] = new_module
loader.exec_module(new_module)
return [new_module]
except Exception as e:
msg = traceback.format_exc()
logger.error(f"Failed to import: {filepath}, error message: {msg}")
# TODO save error message
return []
return parse(mod_name, filepath)
def _process_modules(mods) -> List[DAG]:
top_level_dags = (
(o, m) for m in mods for o in m.__dict__.values() if isinstance(o, DAG)
)
found_dags = []
for dag, mod in top_level_dags:
try:
# TODO validate dag params
logger.info(f"Found dag {dag} from mod {mod} and model file {mod.__file__}")
found_dags.append(dag)
except Exception:
msg = traceback.format_exc()
logger.error(f"Failed to dag file, error message: {msg}")
return found_dags

View File

View File

@@ -0,0 +1,51 @@
import pytest
import threading
import asyncio
from ..dag import DAG, DAGContext
def test_dag_context_sync():
dag1 = DAG("dag1")
dag2 = DAG("dag2")
with dag1:
assert DAGContext.get_current_dag() == dag1
with dag2:
assert DAGContext.get_current_dag() == dag2
assert DAGContext.get_current_dag() == dag1
assert DAGContext.get_current_dag() is None
def test_dag_context_threading():
def thread_function(dag):
DAGContext.enter_dag(dag)
assert DAGContext.get_current_dag() == dag
DAGContext.exit_dag()
dag1 = DAG("dag1")
dag2 = DAG("dag2")
thread1 = threading.Thread(target=thread_function, args=(dag1,))
thread2 = threading.Thread(target=thread_function, args=(dag2,))
thread1.start()
thread2.start()
thread1.join()
thread2.join()
assert DAGContext.get_current_dag() is None
@pytest.mark.asyncio
async def test_dag_context_async():
async def async_function(dag):
DAGContext.enter_dag(dag)
assert DAGContext.get_current_dag() == dag
DAGContext.exit_dag()
dag1 = DAG("dag1")
dag2 = DAG("dag2")
await asyncio.gather(async_function(dag1), async_function(dag2))
assert DAGContext.get_current_dag() is None

View File

206
pilot/awel/operator/base.py Normal file
View File

@@ -0,0 +1,206 @@
from abc import ABC, abstractmethod, ABCMeta
from types import FunctionType
from typing import (
List,
Generic,
TypeVar,
AsyncIterator,
Union,
Any,
Dict,
Optional,
cast,
)
import functools
from inspect import signature
from pilot.component import SystemApp, ComponentType
from pilot.utils.executor_utils import (
ExecutorFactory,
DefaultExecutorFactory,
blocking_func_to_async,
BlockingFunction,
)
from ..dag.base import DAGNode, DAGContext, DAGVar, DAG
from ..task.base import (
TaskContext,
TaskOutput,
TaskState,
OUT,
T,
InputContext,
InputSource,
)
F = TypeVar("F", bound=FunctionType)
CALL_DATA = Union[Dict, Dict[str, Dict]]
class WorkflowRunner(ABC, Generic[T]):
"""Abstract base class representing a runner for executing workflows in a DAG.
This class defines the interface for executing workflows within the DAG,
handling the flow from one DAG node to another.
"""
@abstractmethod
async def execute_workflow(
self, node: "BaseOperator", call_data: Optional[CALL_DATA] = None
) -> DAGContext:
"""Execute the workflow starting from a given operator.
Args:
node (RunnableDAGNode): The starting node of the workflow to be executed.
call_data (CALL_DATA): The data pass to root operator node.
Returns:
DAGContext: The context after executing the workflow, containing the final state and data.
"""
default_runner: WorkflowRunner = None
class BaseOperatorMeta(ABCMeta):
"""Metaclass of BaseOperator."""
@classmethod
def _apply_defaults(cls, func: F) -> F:
sig_cache = signature(func)
@functools.wraps(func)
def apply_defaults(self: "BaseOperator", *args: Any, **kwargs: Any) -> Any:
dag: Optional[DAG] = kwargs.get("dag") or DAGVar.get_current_dag()
task_id: Optional[str] = kwargs.get("task_id")
system_app: Optional[SystemApp] = (
kwargs.get("system_app") or DAGVar.get_current_system_app()
)
executor = kwargs.get("executor") or DAGVar.get_executor()
if not executor:
if system_app:
executor = system_app.get_component(
ComponentType.EXECUTOR_DEFAULT, ExecutorFactory
).create()
else:
executor = DefaultExecutorFactory().create()
DAGVar.set_executor(executor)
if not task_id and dag:
task_id = dag._new_node_id()
runner: Optional[WorkflowRunner] = kwargs.get("runner") or default_runner
# print(f"self: {self}, kwargs dag: {kwargs.get('dag')}, kwargs: {kwargs}")
# for arg in sig_cache.parameters:
# if arg not in kwargs:
# kwargs[arg] = default_args[arg]
if not kwargs.get("dag"):
kwargs["dag"] = dag
if not kwargs.get("task_id"):
kwargs["task_id"] = task_id
if not kwargs.get("runner"):
kwargs["runner"] = runner
if not kwargs.get("system_app"):
kwargs["system_app"] = system_app
if not kwargs.get("executor"):
kwargs["executor"] = executor
real_obj = func(self, *args, **kwargs)
return real_obj
return cast(T, apply_defaults)
def __new__(cls, name, bases, namespace, **kwargs):
new_cls = super().__new__(cls, name, bases, namespace, **kwargs)
new_cls.__init__ = cls._apply_defaults(new_cls.__init__)
return new_cls
class BaseOperator(DAGNode, ABC, Generic[OUT], metaclass=BaseOperatorMeta):
"""Abstract base class for operator nodes that can be executed within a workflow.
This class extends DAGNode by adding execution capabilities.
"""
def __init__(
self,
task_id: Optional[str] = None,
task_name: Optional[str] = None,
dag: Optional[DAG] = None,
runner: WorkflowRunner = None,
**kwargs,
) -> None:
"""Initializes a BaseOperator with an optional workflow runner.
Args:
runner (WorkflowRunner, optional): The runner used to execute the workflow. Defaults to None.
"""
super().__init__(node_id=task_id, node_name=task_name, dag=dag, **kwargs)
if not runner:
from pilot.awel import DefaultWorkflowRunner
runner = DefaultWorkflowRunner()
self._runner: WorkflowRunner = runner
self._dag_ctx: DAGContext = None
@property
def current_dag_context(self) -> DAGContext:
return self._dag_ctx
async def _run(self, dag_ctx: DAGContext) -> TaskOutput[OUT]:
if not self.node_id:
raise ValueError(f"The DAG Node ID can't be empty, current node {self}")
self._dag_ctx = dag_ctx
return await self._do_run(dag_ctx)
@abstractmethod
async def _do_run(self, dag_ctx: DAGContext) -> TaskOutput[OUT]:
"""
Abstract method to run the task within the DAG node.
Args:
dag_ctx (DAGContext): The context of the DAG when this node is run.
Returns:
TaskOutput[OUT]: The task output after this node has been run.
"""
async def call(self, call_data: Optional[CALL_DATA] = None) -> OUT:
"""Execute the node and return the output.
This method is a high-level wrapper for executing the node.
Args:
call_data (CALL_DATA): The data pass to root operator node.
Returns:
OUT: The output of the node after execution.
"""
out_ctx = await self._runner.execute_workflow(self, call_data)
return out_ctx.current_task_context.task_output.output
async def call_stream(
self, call_data: Optional[CALL_DATA] = None
) -> AsyncIterator[OUT]:
"""Execute the node and return the output as a stream.
This method is used for nodes where the output is a stream.
Args:
call_data (CALL_DATA): The data pass to root operator node.
Returns:
AsyncIterator[OUT]: An asynchronous iterator over the output stream.
"""
out_ctx = await self._runner.execute_workflow(self, call_data)
return out_ctx.current_task_context.task_output.output_stream
async def blocking_func_to_async(
self, func: BlockingFunction, *args, **kwargs
) -> Any:
return await blocking_func_to_async(self._executor, func, *args, **kwargs)
def initialize_runner(runner: WorkflowRunner):
global default_runner
default_runner = runner

View File

@@ -0,0 +1,246 @@
from typing import Generic, Dict, List, Union, Callable, Any, AsyncIterator, Awaitable
import asyncio
import logging
from ..dag.base import DAGContext
from ..task.base import (
TaskContext,
TaskOutput,
IN,
OUT,
InputContext,
InputSource,
)
from .base import BaseOperator
logger = logging.getLogger(__name__)
class JoinOperator(BaseOperator, Generic[OUT]):
"""Operator that joins inputs using a custom combine function.
This node type is useful for combining the outputs of upstream nodes.
"""
def __init__(self, combine_function, **kwargs):
super().__init__(**kwargs)
if not callable(combine_function):
raise ValueError("combine_function must be callable")
self.combine_function = combine_function
async def _do_run(self, dag_ctx: DAGContext) -> TaskOutput[OUT]:
"""Run the join operation on the DAG context's inputs.
Args:
dag_ctx (DAGContext): The current context of the DAG.
Returns:
TaskOutput[OUT]: The task output after this node has been run.
"""
curr_task_ctx: TaskContext[OUT] = dag_ctx.current_task_context
input_ctx: InputContext = await curr_task_ctx.task_input.map_all(
self.combine_function
)
# All join result store in the first parent output
join_output = input_ctx.parent_outputs[0].task_output
curr_task_ctx.set_task_output(join_output)
return join_output
class ReduceStreamOperator(BaseOperator, Generic[IN, OUT]):
def __init__(self, reduce_function=None, **kwargs):
"""Initializes a ReduceStreamOperator with a combine function.
Args:
combine_function: A function that defines how to combine inputs.
Raises:
ValueError: If the combine_function is not callable.
"""
super().__init__(**kwargs)
if reduce_function and not callable(reduce_function):
raise ValueError("reduce_function must be callable")
self.reduce_function = reduce_function
async def _do_run(self, dag_ctx: DAGContext) -> TaskOutput[OUT]:
"""Run the join operation on the DAG context's inputs.
Args:
dag_ctx (DAGContext): The current context of the DAG.
Returns:
TaskOutput[OUT]: The task output after this node has been run.
"""
curr_task_ctx: TaskContext[OUT] = dag_ctx.current_task_context
task_input = curr_task_ctx.task_input
if not task_input.check_stream():
raise ValueError("ReduceStreamOperator expects stream data")
if not task_input.check_single_parent():
raise ValueError("ReduceStreamOperator expects single parent")
reduce_function = self.reduce_function or self.reduce
input_ctx: InputContext = await task_input.reduce(reduce_function)
# All join result store in the first parent output
reduce_output = input_ctx.parent_outputs[0].task_output
curr_task_ctx.set_task_output(reduce_output)
return reduce_output
async def reduce(self, input_value: AsyncIterator[IN]) -> OUT:
raise NotImplementedError
class MapOperator(BaseOperator, Generic[IN, OUT]):
"""Map operator that applies a mapping function to its inputs.
This operator transforms its input data using a provided mapping function and
passes the transformed data downstream.
"""
def __init__(self, map_function=None, **kwargs):
"""Initializes a MapDAGNode with a mapping function.
Args:
map_function: A function that defines how to map the input data.
Raises:
ValueError: If the map_function is not callable.
"""
super().__init__(**kwargs)
if map_function and not callable(map_function):
raise ValueError("map_function must be callable")
self.map_function = map_function
async def _do_run(self, dag_ctx: DAGContext) -> TaskOutput[OUT]:
"""Run the mapping operation on the DAG context's inputs.
This method applies the mapping function to the input context and updates
the DAG context with the new data.
Args:
dag_ctx (DAGContext[IN]): The current context of the DAG.
Returns:
TaskOutput[OUT]: The task output after this node has been run.
Raises:
ValueError: If not a single parent or the map_function is not callable
"""
curr_task_ctx: TaskContext[OUT] = dag_ctx.current_task_context
if not curr_task_ctx.task_input.check_single_parent():
num_parents = len(curr_task_ctx.task_input.parent_outputs)
raise ValueError(
f"task {curr_task_ctx.task_id} MapDAGNode expects single parent, now number of parents: {num_parents}"
)
map_function = self.map_function or self.map
input_ctx: InputContext = await curr_task_ctx.task_input.map(map_function)
# All join result store in the first parent output
reduce_output = input_ctx.parent_outputs[0].task_output
curr_task_ctx.set_task_output(reduce_output)
return reduce_output
async def map(self, input_value: IN) -> OUT:
raise NotImplementedError
BranchFunc = Union[Callable[[IN], bool], Callable[[IN], Awaitable[bool]]]
class BranchOperator(BaseOperator, Generic[IN, OUT]):
"""Operator node that branches the workflow based on a provided function.
This node filters its input data using a branching function and
allows for conditional paths in the workflow.
"""
def __init__(
self, branches: Dict[BranchFunc[IN], Union[BaseOperator, str]], **kwargs
):
"""
Initializes a BranchDAGNode with a branching function.
Args:
branches (Dict[BranchFunc[IN], Union[BaseOperator, str]]): Dict of function that defines the branching condition.
Raises:
ValueError: If the branch_function is not callable.
"""
super().__init__(**kwargs)
if branches:
for branch_function, value in branches.items():
if not callable(branch_function):
raise ValueError("branch_function must be callable")
if isinstance(value, BaseOperator):
branches[branch_function] = value.node_name or value.node_name
self._branches = branches
async def _do_run(self, dag_ctx: DAGContext) -> TaskOutput[OUT]:
"""Run the branching operation on the DAG context's inputs.
This method applies the branching function to the input context to determine
the path of execution in the workflow.
Args:
dag_ctx (DAGContext[IN]): The current context of the DAG.
Returns:
TaskOutput[OUT]: The task output after this node has been run.
"""
curr_task_ctx: TaskContext[OUT] = dag_ctx.current_task_context
task_input = curr_task_ctx.task_input
if task_input.check_stream():
raise ValueError("BranchDAGNode expects no stream data")
if not task_input.check_single_parent():
raise ValueError("BranchDAGNode expects single parent")
branches = self._branches
if not branches:
branches = await self.branchs()
branch_func_tasks = []
branch_nodes: List[str] = []
for func, node_name in branches.items():
branch_nodes.append(node_name)
branch_func_tasks.append(
curr_task_ctx.task_input.predicate_map(func, failed_value=None)
)
branch_input_ctxs: List[InputContext] = await asyncio.gather(*branch_func_tasks)
parent_output = task_input.parent_outputs[0].task_output
curr_task_ctx.set_task_output(parent_output)
skip_node_names = []
for i, ctx in enumerate(branch_input_ctxs):
node_name = branch_nodes[i]
branch_out = ctx.parent_outputs[0].task_output
logger.info(
f"branch_input_ctxs {i} result {branch_out.output}, is_empty: {branch_out.is_empty}"
)
if ctx.parent_outputs[0].task_output.is_empty:
logger.info(f"Skip node name {node_name}")
skip_node_names.append(node_name)
curr_task_ctx.update_metadata("skip_node_names", skip_node_names)
return parent_output
async def branchs(self) -> Dict[BranchFunc[IN], Union[BaseOperator, str]]:
raise NotImplementedError
class InputOperator(BaseOperator, Generic[OUT]):
def __init__(self, input_source: InputSource[OUT], **kwargs) -> None:
super().__init__(**kwargs)
self._input_source = input_source
async def _do_run(self, dag_ctx: DAGContext) -> TaskOutput[OUT]:
curr_task_ctx: TaskContext[OUT] = dag_ctx.current_task_context
task_output = await self._input_source.read(curr_task_ctx)
curr_task_ctx.set_task_output(task_output)
return task_output
class TriggerOperator(InputOperator, Generic[OUT]):
def __init__(self, **kwargs) -> None:
from ..task.task_impl import SimpleCallDataInputSource
super().__init__(input_source=SimpleCallDataInputSource(), **kwargs)

View File

@@ -0,0 +1,90 @@
from abc import ABC, abstractmethod
from typing import Generic, AsyncIterator
from ..task.base import OUT, IN, TaskOutput, TaskContext
from ..dag.base import DAGContext
from .base import BaseOperator
class StreamifyAbsOperator(BaseOperator[OUT], ABC, Generic[IN, OUT]):
async def _do_run(self, dag_ctx: DAGContext) -> TaskOutput[OUT]:
curr_task_ctx: TaskContext[OUT] = dag_ctx.current_task_context
output = await curr_task_ctx.task_input.parent_outputs[0].task_output.streamify(
self.streamify
)
curr_task_ctx.set_task_output(output)
return output
@abstractmethod
async def streamify(self, input_value: IN) -> AsyncIterator[OUT]:
"""Convert a value of IN to an AsyncIterator[OUT]
Args:
input_value (IN): The data of parent operator's output
Example:
.. code-block:: python
class MyStreamOperator(StreamifyAbsOperator[int, int]):
async def streamify(self, input_value: int) -> AsyncIterator[int]
for i in range(input_value):
yield i
"""
class UnstreamifyAbsOperator(BaseOperator[OUT], Generic[IN, OUT]):
async def _do_run(self, dag_ctx: DAGContext) -> TaskOutput[OUT]:
curr_task_ctx: TaskContext[OUT] = dag_ctx.current_task_context
output = await curr_task_ctx.task_input.parent_outputs[
0
].task_output.unstreamify(self.unstreamify)
curr_task_ctx.set_task_output(output)
return output
@abstractmethod
async def unstreamify(self, input_value: AsyncIterator[IN]) -> OUT:
"""Convert a value of AsyncIterator[IN] to an OUT.
Args:
input_value (AsyncIterator[IN])): The data of parent operator's output
Example:
.. code-block:: python
class MyUnstreamOperator(UnstreamifyAbsOperator[int, int]):
async def unstreamify(self, input_value: AsyncIterator[int]) -> int
value_cnt = 0
async for v in input_value:
value_cnt += 1
return value_cnt
"""
class TransformStreamAbsOperator(BaseOperator[OUT], Generic[IN, OUT]):
async def _do_run(self, dag_ctx: DAGContext) -> TaskOutput[OUT]:
curr_task_ctx: TaskContext[OUT] = dag_ctx.current_task_context
output = await curr_task_ctx.task_input.parent_outputs[
0
].task_output.transform_stream(self.transform_stream)
curr_task_ctx.set_task_output(output)
return output
@abstractmethod
async def transform_stream(
self, input_value: AsyncIterator[IN]
) -> AsyncIterator[OUT]:
"""Transform an AsyncIterator[IN] to another AsyncIterator[OUT] using a given function.
Args:
input_value (AsyncIterator[IN])): The data of parent operator's output
Example:
.. code-block:: python
class MyTransformStreamOperator(TransformStreamAbsOperator[int, int]):
async def unstreamify(self, input_value: AsyncIterator[int]) -> AsyncIterator[int]
async for v in input_value:
yield v + 1
"""

View File

View File

@@ -0,0 +1,8 @@
from abc import ABC, abstractmethod
class ResourceGroup(ABC):
@property
@abstractmethod
def name(self) -> str:
"""The name of current resource group"""

View File

View File

@@ -0,0 +1,82 @@
from typing import List, Set, Optional, Dict
import uuid
import logging
from ..dag.base import DAG
from ..operator.base import BaseOperator, CALL_DATA
logger = logging.getLogger(__name__)
class DAGNodeInstance:
def __init__(self, node_instance: DAG) -> None:
pass
class DAGInstance:
def __init__(self, dag: DAG) -> None:
self._dag = dag
class JobManager:
def __init__(
self,
root_nodes: List[BaseOperator],
all_nodes: List[BaseOperator],
end_node: BaseOperator,
id2call_data: Dict[str, Dict],
) -> None:
self._root_nodes = root_nodes
self._all_nodes = all_nodes
self._end_node = end_node
self._id2node_data = id2call_data
@staticmethod
def build_from_end_node(
end_node: BaseOperator, call_data: Optional[CALL_DATA] = None
) -> "JobManager":
nodes = _build_from_end_node(end_node)
root_nodes = _get_root_nodes(nodes)
id2call_data = _save_call_data(root_nodes, call_data)
return JobManager(root_nodes, nodes, end_node, id2call_data)
def get_call_data_by_id(self, node_id: str) -> Optional[Dict]:
return self._id2node_data.get(node_id)
def _save_call_data(
root_nodes: List[BaseOperator], call_data: CALL_DATA
) -> Dict[str, Dict]:
id2call_data = {}
logger.debug(f"_save_call_data: {call_data}, root_nodes: {root_nodes}")
if not call_data:
return id2call_data
if len(root_nodes) == 1:
node = root_nodes[0]
logger.info(f"Save call data to node {node.node_id}, call_data: {call_data}")
id2call_data[node.node_id] = call_data
else:
for node in root_nodes:
node_id = node.node_id
logger.info(
f"Save call data to node {node.node_id}, call_data: {call_data.get(node_id)}"
)
id2call_data[node_id] = call_data.get(node_id)
return id2call_data
def _build_from_end_node(end_node: BaseOperator) -> List[BaseOperator]:
nodes = []
if isinstance(end_node, BaseOperator):
task_id = end_node.node_id
if not task_id:
task_id = str(uuid.uuid4())
end_node.set_node_id(task_id)
nodes.append(end_node)
for node in end_node.upstream:
nodes += _build_from_end_node(node)
return nodes
def _get_root_nodes(nodes: List[BaseOperator]) -> List[BaseOperator]:
return list(set(filter(lambda x: not x.upstream, nodes)))

View File

@@ -0,0 +1,106 @@
from typing import Dict, Optional, Set, List
import logging
from ..dag.base import DAGContext
from ..operator.base import WorkflowRunner, BaseOperator, CALL_DATA
from ..operator.common_operator import BranchOperator, JoinOperator, TriggerOperator
from ..task.base import TaskContext, TaskState
from ..task.task_impl import DefaultInputContext, DefaultTaskContext, SimpleTaskOutput
from .job_manager import JobManager
logger = logging.getLogger(__name__)
class DefaultWorkflowRunner(WorkflowRunner):
async def execute_workflow(
self, node: BaseOperator, call_data: Optional[CALL_DATA] = None
) -> DAGContext:
# Create DAG context
dag_ctx = DAGContext()
job_manager = JobManager.build_from_end_node(node, call_data)
logger.info(
f"Begin run workflow from end operator, id: {node.node_id}, call_data: {call_data}"
)
dag = node.dag
# Save node output
node_outputs: Dict[str, TaskContext] = {}
skip_node_ids = set()
await self._execute_node(
job_manager, node, dag_ctx, node_outputs, skip_node_ids
)
return dag_ctx
async def _execute_node(
self,
job_manager: JobManager,
node: BaseOperator,
dag_ctx: DAGContext,
node_outputs: Dict[str, TaskContext],
skip_node_ids: Set[str],
):
# Skip run node
if node.node_id in node_outputs:
return
# Run all upstream node
for upstream_node in node.upstream:
if isinstance(upstream_node, BaseOperator):
await self._execute_node(
job_manager, upstream_node, dag_ctx, node_outputs, skip_node_ids
)
inputs = [
node_outputs[upstream_node.node_id] for upstream_node in node.upstream
]
input_ctx = DefaultInputContext(inputs)
task_ctx = DefaultTaskContext(node.node_id, TaskState.INIT, task_output=None)
task_ctx.set_call_data(job_manager.get_call_data_by_id(node.node_id))
task_ctx.set_task_input(input_ctx)
dag_ctx.set_current_task_context(task_ctx)
task_ctx.set_current_state(TaskState.RUNNING)
if node.node_id in skip_node_ids:
task_ctx.set_current_state(TaskState.SKIP)
task_ctx.set_task_output(SimpleTaskOutput(None))
node_outputs[node.node_id] = task_ctx
return
try:
logger.debug(
f"Begin run operator, node id: {node.node_id}, node name: {node.node_name}, cls: {node}"
)
await node._run(dag_ctx)
node_outputs[node.node_id] = dag_ctx.current_task_context
task_ctx.set_current_state(TaskState.SUCCESS)
if isinstance(node, BranchOperator):
skip_nodes = task_ctx.metadata.get("skip_node_names", [])
logger.debug(
f"Current is branch operator, skip node names: {skip_nodes}"
)
_skip_current_downstream_by_node_name(node, skip_nodes, skip_node_ids)
except Exception as e:
logger.info(f"Run operator {node.node_id} error, error message: {str(e)}")
task_ctx.set_current_state(TaskState.FAILED)
raise e
def _skip_current_downstream_by_node_name(
branch_node: BranchOperator, skip_nodes: List[str], skip_node_ids: Set[str]
):
if not skip_nodes:
return
for child in branch_node.downstream:
if child.node_name in skip_nodes:
logger.info(f"Skip node name {child.node_name}, node id {child.node_id}")
_skip_downstream_by_id(child, skip_node_ids)
def _skip_downstream_by_id(node: BaseOperator, skip_node_ids: Set[str]):
if isinstance(node, JoinOperator):
# Not skip join node
return
skip_node_ids.add(node.node_id)
for child in node.downstream:
_skip_downstream_by_id(child, skip_node_ids)

View File

367
pilot/awel/task/base.py Normal file
View File

@@ -0,0 +1,367 @@
from abc import ABC, abstractmethod
from enum import Enum
from typing import (
TypeVar,
Generic,
Optional,
AsyncIterator,
Union,
Callable,
Any,
Dict,
List,
)
IN = TypeVar("IN")
OUT = TypeVar("OUT")
T = TypeVar("T")
class TaskState(str, Enum):
"""Enumeration representing the state of a task in the workflow.
This Enum defines various states a task can be in during its lifecycle in the DAG.
"""
INIT = "init" # Initial state of the task, not yet started
SKIP = "skip" # State indicating the task was skipped
RUNNING = "running" # State indicating the task is currently running
SUCCESS = "success" # State indicating the task completed successfully
FAILED = "failed" # State indicating the task failed during execution
class TaskOutput(ABC, Generic[T]):
"""Abstract base class representing the output of a task.
This class encapsulates the output of a task and provides methods to access the output data.
It can be subclassed to implement specific output behaviors.
"""
@property
def is_stream(self) -> bool:
"""Check if the output is a stream.
Returns:
bool: True if the output is a stream, False otherwise.
"""
return False
@property
def is_empty(self) -> bool:
"""Check if the output is empty.
Returns:
bool: True if the output is empty, False otherwise.
"""
return False
@property
def output(self) -> Optional[T]:
"""Return the output of the task.
Returns:
T: The output of the task. None if the output is empty.
"""
raise NotImplementedError
@property
def output_stream(self) -> Optional[AsyncIterator[T]]:
"""Return the output of the task as an asynchronous stream.
Returns:
AsyncIterator[T]: An asynchronous iterator over the output. None if the output is empty.
"""
raise NotImplementedError
@abstractmethod
def set_output(self, output_data: Union[T, AsyncIterator[T]]) -> None:
"""Set the output data to current object.
Args:
output_data (Union[T, AsyncIterator[T]]): Output data.
"""
@abstractmethod
def new_output(self) -> "TaskOutput[T]":
"""Create new output object"""
async def map(self, map_func) -> "TaskOutput[T]":
"""Apply a mapping function to the task's output.
Args:
map_func: A function to apply to the task's output.
Returns:
TaskOutput[T]: The result of applying the mapping function.
"""
raise NotImplementedError
async def reduce(self, reduce_func) -> "TaskOutput[T]":
"""Apply a reducing function to the task's output.
Stream TaskOutput to Nonstream TaskOutput.
Args:
reduce_func: A reducing function to apply to the task's output.
Returns:
TaskOutput[T]: The result of applying the reducing function.
"""
raise NotImplementedError
async def streamify(
self, transform_func: Callable[[T], AsyncIterator[T]]
) -> "TaskOutput[T]":
"""Convert a value of type T to an AsyncIterator[T] using a transform function.
Args:
transform_func (Callable[[T], AsyncIterator[T]]): Function to transform a T value into an AsyncIterator[T].
Returns:
TaskOutput[T]: The result of applying the reducing function.
"""
raise NotImplementedError
async def transform_stream(
self, transform_func: Callable[[AsyncIterator[T]], AsyncIterator[T]]
) -> "TaskOutput[T]":
"""Transform an AsyncIterator[T] to another AsyncIterator[T] using a given function.
Args:
transform_func (Callable[[AsyncIterator[T]], AsyncIterator[T]]): Function to apply to the AsyncIterator[T].
Returns:
TaskOutput[T]: The result of applying the reducing function.
"""
raise NotImplementedError
async def unstreamify(
self, transform_func: Callable[[AsyncIterator[T]], T]
) -> "TaskOutput[T]":
"""Convert an AsyncIterator[T] to a value of type T using a transform function.
Args:
transform_func (Callable[[AsyncIterator[T]], T]): Function to transform an AsyncIterator[T] into a T value.
Returns:
TaskOutput[T]: The result of applying the reducing function.
"""
raise NotImplementedError
async def check_condition(self, condition_func) -> bool:
"""Check if current output meets a given condition.
Args:
condition_func: A function to determine if the condition is met.
Returns:
bool: True if current output meet the condition, False otherwise.
"""
raise NotImplementedError
class TaskContext(ABC, Generic[T]):
"""Abstract base class representing the context of a task within a DAG.
This class provides the interface for accessing task-related information
and manipulating task output.
"""
@property
@abstractmethod
def task_id(self) -> str:
"""Return the unique identifier of the task.
Returns:
str: The unique identifier of the task.
"""
@property
@abstractmethod
def task_input(self) -> "InputContext":
"""Return the InputContext of current task.
Returns:
InputContext: The InputContext of current task.
"""
@abstractmethod
def set_task_input(self, input_ctx: "InputContext") -> None:
"""Set the InputContext object to current task.
Args:
input_ctx (InputContext): The InputContext of current task
"""
@property
@abstractmethod
def task_output(self) -> TaskOutput[T]:
"""Return the output object of the task.
Returns:
TaskOutput[T]: The output object of the task.
"""
@abstractmethod
def set_task_output(self, task_output: TaskOutput[T]) -> None:
"""Set the output object to current task."""
@property
@abstractmethod
def current_state(self) -> TaskState:
"""Get the current state of the task.
Returns:
TaskState: The current state of the task.
"""
@abstractmethod
def set_current_state(self, task_state: TaskState) -> None:
"""Set current task state
Args:
task_state (TaskState): The task state to be set.
"""
@abstractmethod
def new_ctx(self) -> "TaskContext":
"""Create new task context
Returns:
TaskContext: A new instance of a TaskContext.
"""
@property
@abstractmethod
def metadata(self) -> Dict[str, Any]:
"""Get the metadata of current task
Returns:
Dict[str, Any]: The metadata
"""
def update_metadata(self, key: str, value: Any) -> None:
"""Update metadata with key and value
Args:
key (str): The key of metadata
value (str): The value to be add to metadata
"""
self.metadata[key] = value
@property
def call_data(self) -> Optional[Dict]:
"""Get the call data for current data"""
return self.metadata.get("call_data")
def set_call_data(self, call_data: Dict) -> None:
"""Set call data for current task"""
self.update_metadata("call_data", call_data)
class InputContext(ABC):
"""Abstract base class representing the context of inputs to a operator node.
This class defines methods to manipulate and access the inputs for a operator node.
"""
@property
@abstractmethod
def parent_outputs(self) -> List[TaskContext]:
"""Get the outputs from the parent nodes.
Returns:
List[TaskContext]: A list of contexts of the parent nodes' outputs.
"""
@abstractmethod
async def map(self, map_func: Callable[[Any], Any]) -> "InputContext":
"""Apply a mapping function to the inputs.
Args:
map_func (Callable[[Any], Any]): A function to be applied to the inputs.
Returns:
InputContext: A new InputContext instance with the mapped inputs.
"""
@abstractmethod
async def map_all(self, map_func: Callable[..., Any]) -> "InputContext":
"""Apply a mapping function to all inputs.
Args:
map_func (Callable[..., Any]): A function to be applied to all inputs.
Returns:
InputContext: A new InputContext instance with the mapped inputs.
"""
@abstractmethod
async def reduce(self, reduce_func: Callable[[Any], Any]) -> "InputContext":
"""Apply a reducing function to the inputs.
Args:
reduce_func (Callable[[Any], Any]): A function that reduces the inputs.
Returns:
InputContext: A new InputContext instance with the reduced inputs.
"""
@abstractmethod
async def filter(self, filter_func: Callable[[Any], bool]) -> "InputContext":
"""Filter the inputs based on a provided function.
Args:
filter_func (Callable[[Any], bool]): A function that returns True for inputs to keep.
Returns:
InputContext: A new InputContext instance with the filtered inputs.
"""
@abstractmethod
async def predicate_map(
self, predicate_func: Callable[[Any], bool], failed_value: Any = None
) -> "InputContext":
"""Predicate the inputs based on a provided function.
Args:
predicate_func (Callable[[Any], bool]): A function that returns True for inputs is predicate True.
failed_value (Any): The value to be set if the return value of predicate function is False
Returns:
InputContext: A new InputContext instance with the predicate inputs.
"""
def check_single_parent(self) -> bool:
"""Check if there is only a single parent output.
Returns:
bool: True if there is only one parent output, False otherwise.
"""
return len(self.parent_outputs) == 1
def check_stream(self, skip_empty: bool = False) -> bool:
"""Check if all parent outputs are streams.
Args:
skip_empty (bool): Skip empty output or not.
Returns:
bool: True if all parent outputs are streams, False otherwise.
"""
for out in self.parent_outputs:
if out.task_output.is_empty and skip_empty:
continue
if not (out.task_output and out.task_output.is_stream):
return False
return True
class InputSource(ABC, Generic[T]):
"""Abstract base class representing the source of inputs to a DAG node."""
@abstractmethod
async def read(self, task_ctx: TaskContext) -> TaskOutput[T]:
"""Read the data from current input source.
Returns:
TaskOutput[T]: The output object read from current source
"""

View File

@@ -0,0 +1,339 @@
from abc import ABC, abstractmethod
from typing import (
Callable,
Coroutine,
Iterator,
AsyncIterator,
List,
Generic,
TypeVar,
Any,
Tuple,
Dict,
Union,
)
import asyncio
import logging
from .base import TaskOutput, TaskContext, TaskState, InputContext, InputSource, T
logger = logging.getLogger(__name__)
async def _reduce_stream(stream: AsyncIterator, reduce_function) -> Any:
# Init accumulator
try:
accumulator = await stream.__anext__()
except StopAsyncIteration:
raise ValueError("Stream is empty")
is_async = asyncio.iscoroutinefunction(reduce_function)
async for element in stream:
if is_async:
accumulator = await reduce_function(accumulator, element)
else:
accumulator = reduce_function(accumulator, element)
return accumulator
class SimpleTaskOutput(TaskOutput[T], Generic[T]):
def __init__(self, data: T) -> None:
super().__init__()
self._data = data
@property
def output(self) -> T:
return self._data
def set_output(self, output_data: T | AsyncIterator[T]) -> None:
self._data = output_data
def new_output(self) -> TaskOutput[T]:
return SimpleTaskOutput(None)
@property
def is_empty(self) -> bool:
return not self._data
async def _apply_func(self, func) -> Any:
if asyncio.iscoroutinefunction(func):
out = await func(self._data)
else:
out = func(self._data)
return out
async def map(self, map_func) -> TaskOutput[T]:
out = await self._apply_func(map_func)
return SimpleTaskOutput(out)
async def check_condition(self, condition_func) -> bool:
return await self._apply_func(condition_func)
async def streamify(
self, transform_func: Callable[[T], AsyncIterator[T]]
) -> TaskOutput[T]:
out = await self._apply_func(transform_func)
return SimpleStreamTaskOutput(out)
class SimpleStreamTaskOutput(TaskOutput[T], Generic[T]):
def __init__(self, data: AsyncIterator[T]) -> None:
super().__init__()
self._data = data
@property
def is_stream(self) -> bool:
return True
@property
def is_empty(self) -> bool:
return not self._data
@property
def output_stream(self) -> AsyncIterator[T]:
return self._data
def set_output(self, output_data: T | AsyncIterator[T]) -> None:
self._data = output_data
def new_output(self) -> TaskOutput[T]:
return SimpleStreamTaskOutput(None)
async def map(self, map_func) -> TaskOutput[T]:
is_async = asyncio.iscoroutinefunction(map_func)
async def new_iter() -> AsyncIterator[T]:
async for out in self._data:
if is_async:
out = await map_func(out)
else:
out = map_func(out)
yield out
return SimpleStreamTaskOutput(new_iter())
async def reduce(self, reduce_func) -> TaskOutput[T]:
out = await _reduce_stream(self._data, reduce_func)
return SimpleTaskOutput(out)
async def unstreamify(
self, transform_func: Callable[[AsyncIterator[T]], T]
) -> TaskOutput[T]:
if asyncio.iscoroutinefunction(transform_func):
out = await transform_func(self._data)
else:
out = transform_func(self._data)
return SimpleTaskOutput(out)
async def transform_stream(
self, transform_func: Callable[[AsyncIterator[T]], AsyncIterator[T]]
) -> TaskOutput[T]:
if asyncio.iscoroutinefunction(transform_func):
out = await transform_func(self._data)
else:
out = transform_func(self._data)
return SimpleStreamTaskOutput(out)
def _is_async_iterator(obj):
return (
hasattr(obj, "__anext__")
and callable(getattr(obj, "__anext__", None))
and hasattr(obj, "__aiter__")
and callable(getattr(obj, "__aiter__", None))
)
class BaseInputSource(InputSource, ABC):
def __init__(self) -> None:
super().__init__()
self._is_read = False
@abstractmethod
def _read_data(self, task_ctx: TaskContext) -> Any:
"""Read data with task context"""
async def read(self, task_ctx: TaskContext) -> Coroutine[Any, Any, TaskOutput]:
data = self._read_data(task_ctx)
if _is_async_iterator(data):
if self._is_read:
raise ValueError(f"Input iterator {data} has been read!")
output = SimpleStreamTaskOutput(data)
else:
output = SimpleTaskOutput(data)
self._is_read = True
return output
class SimpleInputSource(BaseInputSource):
def __init__(self, data: Any) -> None:
super().__init__()
self._data = data
def _read_data(self, task_ctx: TaskContext) -> Any:
return self._data
class SimpleCallDataInputSource(BaseInputSource):
def __init__(self) -> None:
super().__init__()
def _read_data(self, task_ctx: TaskContext) -> Any:
call_data = task_ctx.call_data
data = call_data.get("data") if call_data else None
if not (call_data and data):
raise ValueError("No call data for current SimpleCallDataInputSource")
return data
class DefaultTaskContext(TaskContext, Generic[T]):
def __init__(
self, task_id: str, task_state: TaskState, task_output: TaskOutput[T]
) -> None:
super().__init__()
self._task_id = task_id
self._task_state = task_state
self._output = task_output
self._task_input = None
self._metadata = {}
@property
def task_id(self) -> str:
return self._task_id
@property
def task_input(self) -> InputContext:
return self._task_input
def set_task_input(self, input_ctx: "InputContext") -> None:
self._task_input = input_ctx
@property
def task_output(self) -> TaskOutput:
return self._output
def set_task_output(self, task_output: TaskOutput) -> None:
self._output = task_output
@property
def current_state(self) -> TaskState:
return self._task_state
def set_current_state(self, task_state: TaskState) -> None:
self._task_state = task_state
def new_ctx(self) -> TaskContext:
new_output = self._output.new_output()
return DefaultTaskContext(self._task_id, self._task_state, new_output)
@property
def metadata(self) -> Dict[str, Any]:
return self._metadata
class DefaultInputContext(InputContext):
def __init__(self, outputs: List[TaskContext]) -> None:
super().__init__()
self._outputs = outputs
@property
def parent_outputs(self) -> List[TaskContext]:
return self._outputs
async def _apply_func(
self, func: Callable[[Any], Any], apply_type: str = "map"
) -> Tuple[List[TaskContext], List[TaskOutput]]:
new_outputs: List[TaskContext] = []
map_tasks = []
for out in self._outputs:
new_outputs.append(out.new_ctx())
result = None
if apply_type == "map":
result = out.task_output.map(func)
elif apply_type == "reduce":
result = out.task_output.reduce(func)
elif apply_type == "check_condition":
result = out.task_output.check_condition(func)
else:
raise ValueError(f"Unsupport apply type {apply_type}")
map_tasks.append(result)
results = await asyncio.gather(*map_tasks)
return new_outputs, results
async def map(self, map_func: Callable[[Any], Any]) -> InputContext:
new_outputs, results = await self._apply_func(map_func)
for i, task_ctx in enumerate(new_outputs):
task_ctx: TaskContext = task_ctx
task_ctx.set_task_output(results[i])
return DefaultInputContext(new_outputs)
async def map_all(self, map_func: Callable[..., Any]) -> InputContext:
if not self._outputs:
return DefaultInputContext([])
# Some parent may be empty
not_empty_idx = 0
for i, p in enumerate(self._outputs):
if p.task_output.is_empty:
continue
not_empty_idx = i
break
# All output is empty?
is_steam = self._outputs[not_empty_idx].task_output.is_stream
if is_steam:
if not self.check_stream(skip_empty=True):
raise ValueError(
"The output in all tasks must has same output format to map_all"
)
outputs = []
for out in self._outputs:
if out.task_output.is_stream:
outputs.append(out.task_output.output_stream)
else:
outputs.append(out.task_output.output)
if asyncio.iscoroutinefunction(map_func):
map_res = await map_func(*outputs)
else:
map_res = map_func(*outputs)
single_output: TaskContext = self._outputs[not_empty_idx].new_ctx()
single_output.task_output.set_output(map_res)
logger.debug(
f"Current map_all map_res: {map_res}, is steam: {single_output.task_output.is_stream}"
)
return DefaultInputContext([single_output])
async def reduce(self, reduce_func: Callable[[Any], Any]) -> InputContext:
if not self.check_stream():
raise ValueError(
"The output in all tasks must has same output format of stream to apply reduce function"
)
new_outputs, results = await self._apply_func(reduce_func, apply_type="reduce")
for i, task_ctx in enumerate(new_outputs):
task_ctx: TaskContext = task_ctx
task_ctx.set_task_output(results[i])
return DefaultInputContext(new_outputs)
async def filter(self, filter_func: Callable[[Any], bool]) -> InputContext:
new_outputs, results = await self._apply_func(
filter_func, apply_type="check_condition"
)
result_outputs = []
for i, task_ctx in enumerate(new_outputs):
if results[i]:
result_outputs.append(task_ctx)
return DefaultInputContext(result_outputs)
async def predicate_map(
self, predicate_func: Callable[[Any], bool], failed_value: Any = None
) -> "InputContext":
new_outputs, results = await self._apply_func(
predicate_func, apply_type="check_condition"
)
result_outputs = []
for i, task_ctx in enumerate(new_outputs):
task_ctx: TaskContext = task_ctx
if results[i]:
task_ctx.task_output.set_output(True)
result_outputs.append(task_ctx)
else:
task_ctx.task_output.set_output(failed_value)
result_outputs.append(task_ctx)
return DefaultInputContext(result_outputs)

View File

View File

@@ -0,0 +1,102 @@
import pytest
import pytest_asyncio
from typing import AsyncIterator, List
from contextlib import contextmanager, asynccontextmanager
from .. import (
WorkflowRunner,
InputOperator,
DAGContext,
TaskState,
DefaultWorkflowRunner,
SimpleInputSource,
)
from ..task.task_impl import _is_async_iterator
@pytest.fixture
def runner():
return DefaultWorkflowRunner()
def _create_stream(num_nodes) -> List[AsyncIterator[int]]:
iters = []
for _ in range(num_nodes):
async def stream_iter():
for i in range(10):
yield i
stream_iter = stream_iter()
assert _is_async_iterator(stream_iter)
iters.append(stream_iter)
return iters
def _create_stream_from(output_streams: List[List[int]]) -> List[AsyncIterator[int]]:
iters = []
for single_stream in output_streams:
async def stream_iter():
for i in single_stream:
yield i
stream_iter = stream_iter()
assert _is_async_iterator(stream_iter)
iters.append(stream_iter)
return iters
@asynccontextmanager
async def _create_input_node(**kwargs):
num_nodes = kwargs.get("num_nodes")
is_stream = kwargs.get("is_stream", False)
if is_stream:
outputs = kwargs.get("output_streams")
if outputs:
if num_nodes and num_nodes != len(outputs):
raise ValueError(
f"num_nodes {num_nodes} != the length of output_streams {len(outputs)}"
)
outputs = _create_stream_from(outputs)
else:
num_nodes = num_nodes or 1
outputs = _create_stream(num_nodes)
else:
outputs = kwargs.get("outputs", ["Hello."])
nodes = []
for output in outputs:
print(f"output: {output}")
input_source = SimpleInputSource(output)
input_node = InputOperator(input_source)
nodes.append(input_node)
yield nodes
@pytest_asyncio.fixture
async def input_node(request):
param = getattr(request, "param", {})
async with _create_input_node(**param) as input_nodes:
yield input_nodes[0]
@pytest_asyncio.fixture
async def stream_input_node(request):
param = getattr(request, "param", {})
param["is_stream"] = True
async with _create_input_node(**param) as input_nodes:
yield input_nodes[0]
@pytest_asyncio.fixture
async def input_nodes(request):
param = getattr(request, "param", {})
async with _create_input_node(**param) as input_nodes:
yield input_nodes
@pytest_asyncio.fixture
async def stream_input_nodes(request):
param = getattr(request, "param", {})
param["is_stream"] = True
async with _create_input_node(**param) as input_nodes:
yield input_nodes

View File

@@ -0,0 +1,51 @@
import pytest
from typing import List
from .. import (
DAG,
WorkflowRunner,
DAGContext,
TaskState,
InputOperator,
MapOperator,
JoinOperator,
BranchOperator,
ReduceStreamOperator,
SimpleInputSource,
)
from .conftest import (
runner,
input_node,
input_nodes,
stream_input_node,
stream_input_nodes,
_is_async_iterator,
)
def _register_dag_to_fastapi_app(dag):
# TODO
pass
@pytest.mark.asyncio
async def test_http_operator(runner: WorkflowRunner, stream_input_node: InputOperator):
with DAG("test_map") as dag:
pass
# http_req_task = HttpRequestOperator(endpoint="/api/completions")
# db_task = DBQueryOperator(table_name="user_info")
# prompt_task = PromptTemplateOperator(
# system_prompt="You are an AI designed to solve the user's goals with given commands, please follow the constraints of the system's input for your answers."
# )
# llm_task = ChatGPTLLMOperator(model="chagpt-3.5")
# output_parser_task = CommonOutputParserOperator()
# http_res_task = HttpResponseOperator()
# (
# http_req_task
# >> db_task
# >> prompt_task
# >> llm_task
# >> output_parser_task
# >> http_res_task
# )
_register_dag_to_fastapi_app(dag)

View File

@@ -0,0 +1,141 @@
import pytest
from typing import List
from .. import (
DAG,
WorkflowRunner,
DAGContext,
TaskState,
InputOperator,
MapOperator,
JoinOperator,
BranchOperator,
ReduceStreamOperator,
SimpleInputSource,
)
from .conftest import (
runner,
input_node,
input_nodes,
stream_input_node,
stream_input_nodes,
_is_async_iterator,
)
@pytest.mark.asyncio
async def test_input_node(runner: WorkflowRunner):
input_node = InputOperator(SimpleInputSource("hello"))
res: DAGContext[str] = await runner.execute_workflow(input_node)
assert res.current_task_context.current_state == TaskState.SUCCESS
assert res.current_task_context.task_output.output == "hello"
async def new_steam_iter(n: int):
for i in range(n):
yield i
num_iter = 10
steam_input_node = InputOperator(SimpleInputSource(new_steam_iter(num_iter)))
res: DAGContext[str] = await runner.execute_workflow(steam_input_node)
assert res.current_task_context.current_state == TaskState.SUCCESS
output_steam = res.current_task_context.task_output.output_stream
assert output_steam
assert _is_async_iterator(output_steam)
i = 0
async for x in output_steam:
assert x == i
i += 1
@pytest.mark.asyncio
async def test_map_node(runner: WorkflowRunner, stream_input_node: InputOperator):
with DAG("test_map") as dag:
map_node = MapOperator(lambda x: x * 2)
stream_input_node >> map_node
res: DAGContext[int] = await runner.execute_workflow(map_node)
output_steam = res.current_task_context.task_output.output_stream
assert output_steam
i = 0
async for x in output_steam:
assert x == i * 2
i += 1
@pytest.mark.asyncio
@pytest.mark.parametrize(
"stream_input_node, expect_sum",
[
({"output_streams": [[0, 1, 2, 3]]}, 6),
({"output_streams": [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]}, 55),
],
indirect=["stream_input_node"],
)
async def test_reduce_node(
runner: WorkflowRunner, stream_input_node: InputOperator, expect_sum: int
):
with DAG("test_reduce_node") as dag:
reduce_node = ReduceStreamOperator(lambda x, y: x + y)
stream_input_node >> reduce_node
res: DAGContext[int] = await runner.execute_workflow(reduce_node)
assert res.current_task_context.current_state == TaskState.SUCCESS
assert not res.current_task_context.task_output.is_stream
assert res.current_task_context.task_output.output == expect_sum
@pytest.mark.asyncio
@pytest.mark.parametrize(
"input_nodes",
[
({"outputs": [0, 1, 2]}),
],
indirect=["input_nodes"],
)
async def test_join_node(runner: WorkflowRunner, input_nodes: List[InputOperator]):
def join_func(p1, p2, p3) -> int:
return p1 + p2 + p3
with DAG("test_join_node") as dag:
join_node = JoinOperator(join_func)
for input_node in input_nodes:
input_node >> join_node
res: DAGContext[int] = await runner.execute_workflow(join_node)
assert res.current_task_context.current_state == TaskState.SUCCESS
assert not res.current_task_context.task_output.is_stream
assert res.current_task_context.task_output.output == 3
@pytest.mark.asyncio
@pytest.mark.parametrize(
"input_node, is_odd",
[
({"outputs": [0]}, False),
({"outputs": [1]}, True),
],
indirect=["input_node"],
)
async def test_branch_node(
runner: WorkflowRunner, input_node: InputOperator, is_odd: bool
):
def join_func(o1, o2) -> int:
print(f"join func result, o1: {o1}, o2: {o2}")
return o1 or o2
with DAG("test_join_node") as dag:
odd_node = MapOperator(
lambda x: 999, task_id="odd_node", task_name="odd_node_name"
)
even_node = MapOperator(
lambda x: 888, task_id="even_node", task_name="even_node_name"
)
join_node = JoinOperator(join_func)
branch_node = BranchOperator(
{lambda x: x % 2 == 1: odd_node, lambda x: x % 2 == 0: even_node}
)
branch_node >> odd_node >> join_node
branch_node >> even_node >> join_node
input_node >> branch_node
res: DAGContext[int] = await runner.execute_workflow(join_node)
assert res.current_task_context.current_state == TaskState.SUCCESS
expect_res = 999 if is_odd else 888
assert res.current_task_context.task_output.output == expect_res

View File

View File

@@ -0,0 +1,11 @@
from __future__ import annotations
from abc import ABC, abstractmethod
from ..operator.common_operator import TriggerOperator
class Trigger(TriggerOperator, ABC):
@abstractmethod
async def trigger(self) -> None:
"""Trigger the workflow or a specific operation in the workflow."""

View File

@@ -0,0 +1,137 @@
from __future__ import annotations
from typing import Union, Type, List, TYPE_CHECKING, Optional, Any, Dict
from starlette.requests import Request
from starlette.responses import Response
from pydantic import BaseModel
import logging
from .base import Trigger
from ..dag.base import DAG
from ..operator.base import BaseOperator
if TYPE_CHECKING:
from fastapi import APIRouter, FastAPI
RequestBody = Union[Request, Type[BaseModel], str]
logger = logging.getLogger(__name__)
class HttpTrigger(Trigger):
def __init__(
self,
endpoint: str,
methods: Optional[Union[str, List[str]]] = "GET",
request_body: Optional[RequestBody] = None,
streaming_response: Optional[bool] = False,
response_model: Optional[Type] = None,
response_headers: Optional[Dict[str, str]] = None,
response_media_type: Optional[str] = None,
status_code: Optional[int] = 200,
router_tags: Optional[List[str]] = None,
**kwargs,
) -> None:
super().__init__(**kwargs)
if not endpoint.startswith("/"):
endpoint = "/" + endpoint
self._endpoint = endpoint
self._methods = methods
self._req_body = request_body
self._streaming_response = streaming_response
self._response_model = response_model
self._status_code = status_code
self._router_tags = router_tags
self._response_headers = response_headers
self._response_media_type = response_media_type
self._end_node: BaseOperator = None
async def trigger(self) -> None:
pass
def mount_to_router(self, router: "APIRouter") -> None:
from fastapi import Depends
methods = self._methods if isinstance(self._methods, list) else [self._methods]
def create_route_function(name, req_body_cls: Optional[Type[BaseModel]]):
async def _request_body_dependency(request: Request):
return await _parse_request_body(request, self._req_body)
async def route_function(body=Depends(_request_body_dependency)):
return await _trigger_dag(
body,
self.dag,
self._streaming_response,
self._response_headers,
self._response_media_type,
)
route_function.__name__ = name
return route_function
function_name = f"AWEL_trigger_route_{self._endpoint.replace('/', '_')}"
request_model = (
self._req_body
if isinstance(self._req_body, type)
and issubclass(self._req_body, BaseModel)
else None
)
dynamic_route_function = create_route_function(function_name, request_model)
logger.info(
f"mount router function {dynamic_route_function}({function_name}), endpoint: {self._endpoint}, methods: {methods}"
)
router.api_route(
self._endpoint,
methods=methods,
response_model=self._response_model,
status_code=self._status_code,
tags=self._router_tags,
)(dynamic_route_function)
async def _parse_request_body(
request: Request, request_body_cls: Optional[Type[BaseModel]]
):
if not request_body_cls:
return None
if request.method == "POST":
json_data = await request.json()
return request_body_cls(**json_data)
elif request.method == "GET":
return request_body_cls(**request.query_params)
else:
return request
async def _trigger_dag(
body: Any,
dag: DAG,
streaming_response: Optional[bool] = False,
response_headers: Optional[Dict[str, str]] = None,
response_media_type: Optional[str] = None,
) -> Any:
from fastapi.responses import StreamingResponse
end_node = dag.leaf_nodes
if len(end_node) != 1:
raise ValueError("HttpTrigger just support one leaf node in dag")
end_node = end_node[0]
if not streaming_response:
return await end_node.call(call_data={"data": body})
else:
headers = response_headers
media_type = response_media_type if response_media_type else "text/event-stream"
if not headers:
headers = {
"Content-Type": "text/event-stream",
"Cache-Control": "no-cache",
"Connection": "keep-alive",
"Transfer-Encoding": "chunked",
}
return StreamingResponse(
end_node.call_stream(call_data={"data": body}),
headers=headers,
media_type=media_type,
)

View File

@@ -0,0 +1,74 @@
from abc import ABC, abstractmethod
from typing import Any, TYPE_CHECKING, Optional
import logging
if TYPE_CHECKING:
from fastapi import APIRouter
from pilot.component import SystemApp, BaseComponent, ComponentType
logger = logging.getLogger(__name__)
class TriggerManager(ABC):
@abstractmethod
def register_trigger(self, trigger: Any) -> None:
""" "Register a trigger to current manager"""
class HttpTriggerManager(TriggerManager):
def __init__(
self,
router: Optional["APIRouter"] = None,
router_prefix: Optional[str] = "/api/v1/awel/trigger",
) -> None:
if not router:
from fastapi import APIRouter
router = APIRouter()
self._router_prefix = router_prefix
self._router = router
self._trigger_map = {}
def register_trigger(self, trigger: Any) -> None:
from .http_trigger import HttpTrigger
if not isinstance(trigger, HttpTrigger):
raise ValueError(f"Current trigger {trigger} not an object of HttpTrigger")
trigger: HttpTrigger = trigger
trigger_id = trigger.node_id
if trigger_id not in self._trigger_map:
trigger.mount_to_router(self._router)
self._trigger_map[trigger_id] = trigger
def _init_app(self, system_app: SystemApp):
logger.info(
f"Include router {self._router} to prefix path {self._router_prefix}"
)
system_app.app.include_router(
self._router, prefix=self._router_prefix, tags=["AWEL"]
)
class DefaultTriggerManager(TriggerManager, BaseComponent):
name = ComponentType.AWEL_TRIGGER_MANAGER
def __init__(self, system_app: SystemApp | None = None):
self.system_app = system_app
self.http_trigger = HttpTriggerManager()
super().__init__(None)
def init_app(self, system_app: SystemApp):
self.system_app = system_app
def register_trigger(self, trigger: Any) -> None:
from .http_trigger import HttpTrigger
if isinstance(trigger, HttpTrigger):
logger.info(f"Register trigger {trigger}")
self.http_trigger.register_trigger(trigger)
else:
raise ValueError(f"Unsupport trigger: {trigger}")
def after_register(self) -> None:
self.http_trigger._init_app(self.system_app)

View File

@@ -5,7 +5,9 @@ import time
import json
import logging
import xml.etree.ElementTree as ET
import pandas as pd
from pilot.common.json_utils import serialize
from datetime import datetime
from typing import Any, Callable, Optional, List
from pydantic import BaseModel
@@ -184,6 +186,8 @@ class PluginStatus(BaseModel):
start_time = datetime.now().timestamp() * 1000
end_time: int = None
df: Any = None
class ApiCall:
agent_prefix = "<api-call>"
@@ -191,7 +195,12 @@ class ApiCall:
name_prefix = "<name>"
name_end = "</name>"
def __init__(self, plugin_generator: Any = None, display_registry: Any = None):
def __init__(
self,
plugin_generator: Any = None,
display_registry: Any = None,
backend_rendering: bool = False,
):
# self.name: str = ""
# self.status: Status = Status.TODO.value
# self.logo_url: str = None
@@ -204,6 +213,7 @@ class ApiCall:
self.plugin_generator = plugin_generator
self.display_registry = display_registry
self.start_time = datetime.now().timestamp() * 1000
self.backend_rendering: bool = False
def __repr__(self):
return f"ApiCall(name={self.name}, status={self.status}, args={self.args})"
@@ -227,7 +237,7 @@ class ApiCall:
i += 1
return False
def __check_last_plugin_call_ready(self, all_context):
def check_last_plugin_call_ready(self, all_context):
start_agent_count = all_context.count(self.agent_prefix)
end_agent_count = all_context.count(self.agent_end)
@@ -236,7 +246,14 @@ class ApiCall:
return False
def __deal_error_md_tags(self, all_context, api_context, include_end: bool = True):
error_md_tags = ["```", "```python", "```xml", "```json", "```markdown"]
error_md_tags = [
"```",
"```python",
"```xml",
"```json",
"```markdown",
"```sql",
]
if include_end == False:
md_tag_end = ""
else:
@@ -255,7 +272,6 @@ class ApiCall:
return all_context
def api_view_context(self, all_context: str, display_mode: bool = False):
error_mk_tags = ["```", "```python", "```xml"]
call_context_map = extract_content_open_ending(
all_context, self.agent_prefix, self.agent_end, True
)
@@ -263,32 +279,18 @@ class ApiCall:
api_status = self.plugin_status_map.get(api_context)
if api_status is not None:
if display_mode:
if api_status.api_result:
all_context = self.__deal_error_md_tags(
all_context, api_context
)
all_context = self.__deal_error_md_tags(all_context, api_context)
if Status.FAILED.value == api_status.status:
all_context = all_context.replace(
api_context, api_status.api_result
api_context,
f'\n<span style="color:red">Error:</span>{api_status.err_msg}\n'
+ self.to_view_antv_vis(api_status),
)
else:
if api_status.status == Status.FAILED.value:
all_context = self.__deal_error_md_tags(
all_context, api_context
)
all_context = all_context.replace(
api_context,
f"""\n<span style=\"color:red\">ERROR!</span>{api_status.err_msg}\n """,
)
else:
cost = (api_status.end_time - self.start_time) / 1000
cost_str = "{:.2f}".format(cost)
all_context = self.__deal_error_md_tags(
all_context, api_context
)
all_context = all_context.replace(
api_context,
f'\n<span style="color:green">Waiting...{cost_str}S</span>\n',
)
all_context = all_context.replace(
api_context, self.to_view_antv_vis(api_status)
)
else:
all_context = self.__deal_error_md_tags(
all_context, api_context, False
@@ -302,8 +304,8 @@ class ApiCall:
now_time = datetime.now().timestamp() * 1000
cost = (now_time - self.start_time) / 1000
cost_str = "{:.2f}".format(cost)
for tag in error_mk_tags:
all_context = all_context.replace(tag + api_context, api_context)
all_context = self.__deal_error_md_tags(all_context, api_context)
all_context = all_context.replace(
api_context,
f'\n<span style="color:green">Waiting...{cost_str}S</span>\n',
@@ -348,7 +350,8 @@ class ApiCall:
if api_status.api_result:
param["result"] = api_status.api_result
return json.dumps(param)
return json.dumps(param, default=serialize, ensure_ascii=False)
def to_view_text(self, api_status: PluginStatus):
api_call_element = ET.Element("dbgpt-view")
@@ -356,10 +359,45 @@ class ApiCall:
result = ET.tostring(api_call_element, encoding="utf-8")
return result.decode("utf-8")
def to_view_antv_vis(self, api_status: PluginStatus):
if self.backend_rendering:
html_table = api_status.df.to_html(
index=False, escape=False, sparsify=False
)
table_str = "".join(html_table.split())
table_str = table_str.replace("\n", " ")
html = f""" \n<div><b>[SQL]{api_status.args["sql"]}</b></div><div class="w-full overflow-auto">{table_str}</div>\n """
return html
else:
api_call_element = ET.Element("chart-view")
api_call_element.attrib["content"] = self.__to_antv_vis_param(api_status)
api_call_element.text = "\n"
# api_call_element.set("content", self.__to_antv_vis_param(api_status))
# api_call_element.text = self.__to_antv_vis_param(api_status)
result = ET.tostring(api_call_element, encoding="utf-8")
return result.decode("utf-8")
# return f'<chart-view content="{self.__to_antv_vis_param(api_status)}">'
def __to_antv_vis_param(self, api_status: PluginStatus):
param = {}
if api_status.name:
param["type"] = api_status.name
if api_status.args:
param["sql"] = api_status.args["sql"]
# if api_status.err_msg:
# param["err_msg"] = api_status.err_msg
if api_status.api_result:
param["data"] = api_status.api_result
else:
param["data"] = []
return json.dumps(param, ensure_ascii=False)
def run(self, llm_text):
if self.__is_need_wait_plugin_call(llm_text):
# wait api call generate complete
if self.__check_last_plugin_call_ready(llm_text):
if self.check_last_plugin_call_ready(llm_text):
self.update_from_context(llm_text)
for key, value in self.plugin_status_map.items():
if value.status == Status.TODO.value:
@@ -379,7 +417,7 @@ class ApiCall:
def run_display_sql(self, llm_text, sql_run_func):
if self.__is_need_wait_plugin_call(llm_text):
# wait api call generate complete
if self.__check_last_plugin_call_ready(llm_text):
if self.check_last_plugin_call_ready(llm_text):
self.update_from_context(llm_text)
for key, value in self.plugin_status_map.items():
if value.status == Status.TODO.value:
@@ -391,6 +429,7 @@ class ApiCall:
param = {
"df": sql_run_func(sql),
}
value.df = param["df"]
if self.display_registry.is_valid_command(value.name):
value.api_result = self.display_registry.call(
value.name, **param
@@ -406,3 +445,49 @@ class ApiCall:
value.err_msg = str(e)
value.end_time = datetime.now().timestamp() * 1000
return self.api_view_context(llm_text, True)
def display_sql_llmvis(self, llm_text, sql_run_func):
"""
Render charts using the Antv standard protocol
Args:
llm_text: LLM response text
sql_run_func: sql run function
Returns:
ChartView protocol text
"""
try:
if self.__is_need_wait_plugin_call(llm_text):
# wait api call generate complete
if self.check_last_plugin_call_ready(llm_text):
self.update_from_context(llm_text)
for key, value in self.plugin_status_map.items():
if value.status == Status.TODO.value:
value.status = Status.RUNNING.value
logging.info(f"sql展示执行:{value.name},{value.args}")
try:
sql = value.args["sql"]
if sql is not None and len(sql) > 0:
data_df = sql_run_func(sql)
value.df = data_df
value.api_result = json.loads(
data_df.to_json(
orient="records",
date_format="iso",
date_unit="s",
)
)
value.status = Status.COMPLETED.value
else:
value.status = Status.FAILED.value
value.err_msg = "No executable sql"
except Exception as e:
value.status = Status.FAILED.value
value.err_msg = str(e)
value.end_time = datetime.now().timestamp() * 1000
except Exception as e:
logging.error("Api parsing exception", e)
raise ValueError("Api parsing exception," + str(e))
return self.api_view_context(llm_text, True)

View File

@@ -1,7 +1,6 @@
from pandas import DataFrame
from pilot.base_modules.agent.commands.command_mange import command
from pilot.configs.config import Config
import pandas as pd
import uuid
import os

View File

@@ -83,7 +83,7 @@ async def agent_hub_update(update_param: PluginHubParam = Body()):
return Result.succ(None)
except Exception as e:
logger.error("Agent Hub Update Error!", e)
return Result.faild(code="E0020", msg=f"Agent Hub Update Error! {e}")
return Result.failed(code="E0020", msg=f"Agent Hub Update Error! {e}")
@router.post("/v1/agent/query", response_model=Result[str])
@@ -133,7 +133,7 @@ async def agent_install(plugin_name: str, user: str = None):
return Result.succ(None)
except Exception as e:
logger.error("Plugin Install Error!", e)
return Result.faild(code="E0021", msg=f"Plugin Install Error {e}")
return Result.failed(code="E0021", msg=f"Plugin Install Error {e}")
@router.post("/v1/agent/uninstall", response_model=Result[str])
@@ -147,7 +147,7 @@ async def agent_uninstall(plugin_name: str, user: str = None):
return Result.succ(None)
except Exception as e:
logger.error("Plugin Uninstall Error!", e)
return Result.faild(code="E0022", msg=f"Plugin Uninstall Error {e}")
return Result.failed(code="E0022", msg=f"Plugin Uninstall Error {e}")
@router.post("/v1/personal/agent/upload", response_model=Result[str])
@@ -160,4 +160,4 @@ async def personal_agent_upload(doc_file: UploadFile = File(...), user: str = No
return Result.succ(None)
except Exception as e:
logger.error("Upload Personal Plugin Error!", e)
return Result.faild(code="E0023", msg=f"Upload Personal Plugin Error {e}")
return Result.failed(code="E0023", msg=f"Upload Personal Plugin Error {e}")

View File

View File

@@ -4,7 +4,12 @@ from sqlalchemy import Column, Integer, String, Index, DateTime, func
from sqlalchemy import UniqueConstraint
from pilot.base_modules.meta_data.base_dao import BaseDao
from pilot.base_modules.meta_data.meta_data import Base, engine, session
from pilot.base_modules.meta_data.meta_data import (
Base,
engine,
session,
META_DATA_DATABASE,
)
class MyPluginEntity(Base):
@@ -27,7 +32,7 @@ class MyPluginEntity(Base):
succ_count = Column(
Integer, nullable=True, default=0, comment="plugin total success count"
)
created_at = Column(
gmt_created = Column(
DateTime, default=datetime.utcnow, comment="plugin install time"
)
UniqueConstraint("user_code", "name", name="uk_name")
@@ -36,7 +41,10 @@ class MyPluginEntity(Base):
class MyPluginDao(BaseDao[MyPluginEntity]):
def __init__(self):
super().__init__(
database="dbgpt", orm_base=Base, db_engine=engine, session=session
database=META_DATA_DATABASE,
orm_base=Base,
db_engine=engine,
session=session,
)
def add(self, engity: MyPluginEntity):
@@ -50,7 +58,7 @@ class MyPluginDao(BaseDao[MyPluginEntity]):
version=engity.version,
use_count=engity.use_count or 0,
succ_count=engity.succ_count or 0,
created_at=datetime.now(),
gmt_created=datetime.now(),
)
session.add(my_plugin)
session.commit()

View File

@@ -6,9 +6,14 @@ from sqlalchemy import UniqueConstraint
from pilot.base_modules.meta_data.meta_data import Base
from pilot.base_modules.meta_data.base_dao import BaseDao
from pilot.base_modules.meta_data.meta_data import Base, engine, session
from pilot.base_modules.meta_data.meta_data import (
Base,
engine,
session,
META_DATA_DATABASE,
)
# TODO We should consider that the production environment does not have permission to execute the DDL
char_set_sql = DDL("ALTER TABLE plugin_hub CONVERT TO CHARACTER SET utf8mb4")
@@ -30,7 +35,9 @@ class PluginHubEntity(Base):
storage_channel = Column(String(255), comment="plugin storage channel")
storage_url = Column(String(255), comment="plugin download url")
download_param = Column(String(255), comment="plugin download param")
created_at = Column(DateTime, default=datetime.utcnow, comment="plugin upload time")
gmt_created = Column(
DateTime, default=datetime.utcnow, comment="plugin upload time"
)
installed = Column(Integer, default=False, comment="plugin already installed count")
UniqueConstraint("name", name="uk_name")
@@ -40,7 +47,10 @@ class PluginHubEntity(Base):
class PluginHubDao(BaseDao[PluginHubEntity]):
def __init__(self):
super().__init__(
database="dbgpt", orm_base=Base, db_engine=engine, session=session
database=META_DATA_DATABASE,
orm_base=Base,
db_engine=engine,
session=session,
)
def add(self, engity: PluginHubEntity):
@@ -54,7 +64,7 @@ class PluginHubDao(BaseDao[PluginHubEntity]):
version=engity.version,
storage_channel=engity.storage_channel,
storage_url=engity.storage_url,
created_at=timezone.localize(datetime.now()),
gmt_created=timezone.localize(datetime.now()),
)
session.add(plugin_hub)
session.commit()

View File

@@ -12,7 +12,7 @@ from ..db.my_plugin_db import MyPluginDao, MyPluginEntity
from ..common.schema import PluginStorageType
from ..plugins_util import scan_plugins, update_from_git
logger = logging.getLogger("agent_hub")
logger = logging.getLogger(__name__)
Default_User = "default"
DEFAULT_PLUGIN_REPO = "https://github.com/eosphoros-ai/DB-GPT-Plugins.git"
TEMP_PLUGIN_PATH = ""

View File

@@ -9,6 +9,7 @@ import requests
import git
import threading
import datetime
import logging
from pathlib import Path
from typing import List
from urllib.parse import urlparse
@@ -19,7 +20,8 @@ from auto_gpt_plugin_template import AutoGPTPluginTemplate
from pilot.configs.config import Config
from pilot.configs.model_config import PLUGINS_DIR
from pilot.logs import logger
logger = logging.getLogger(__name__)
def inspect_zip_for_modules(zip_path: str, debug: bool = False) -> list[str]:
@@ -109,7 +111,7 @@ def load_native_plugins(cfg: Config):
print("save file")
cfg.set_plugins(scan_plugins(cfg.debug_mode))
else:
print("get file faildresponse code", response.status_code)
print("get file failedresponse code", response.status_code)
except Exception as e:
print("load plugin from git exception!" + str(e))

Some files were not shown because too many files have changed in this diff Show More