Skip to content

Commit

Permalink
merge 0.3.31-fix3 to master (#4) (#5)
Browse files Browse the repository at this point in the history
* Update README.md (langgenius#1525)

* fix: conversation rename always auto generate (langgenius#1530)

* new readme (langgenius#1528)

* doc: update readme (langgenius#1536)

* feat: optimize timezone of server (langgenius#1537)

* Doc/update readme patch 1 (langgenius#1538)

* feat: add code of conduct (langgenius#1541)

* fix: upload image (langgenius#1522)

* feat: remove plugin page (langgenius#1544)

* update images (langgenius#1548)

* update images (langgenius#1549)

* fix: upload file not clickable in firefox (langgenius#1552)

* feat: supports for new version of openllm (langgenius#1554)

* Add some interesting badges :) (langgenius#1558)

* Feat/add retriever rerank (langgenius#1560)



* Feat/jp and es (langgenius#1562)

* Update README_CN.md

* feat: add retriever rank fe (langgenius#1557)



* fix hybrid search reranking check (langgenius#1563)



* fix the error message (langgenius#1564)



* chore: retrieval docs links and enchance help doc translation (langgenius#1570)

* feat: fetch stream compatibility enhance (langgenius#1551)

* fix(web): Sidebar create new chat context (langgenius#1569)

* Feat/sdk vision support (langgenius#1531)



* fix(api): patch Windows timezone set (langgenius#1575)

* feat: configurable invite expiry time (langgenius#1573)

* fix:  some RAG retrieval bugs (langgenius#1577)



* fix: some text (langgenius#1579)

* fix multi retrieval with resource score issue (langgenius#1578)



* feat: add `supported_model_types` field and filter in provider list (langgenius#1581)

* Compatible model saving error (langgenius#1582)



* feat: bump version to 0.3.31 (langgenius#1584)

* fix: retrieval test page hide rerank model also hide  retrieval config (langgenius#1585)

* fix: chat on start bug (langgenius#1588)

* Update docker-compose.yaml (langgenius#1587)

* feat: bump version to 0.3.31-fix1 (langgenius#1589)

* fix: safari can not in (langgenius#1590)

* feat: add anthropic claude-2.1 support (langgenius#1591)

* feat: bump version to 0.3.31-fix2 (langgenius#1592)

* fix sql transaction error in statistic API (langgenius#1586)

* fix: chat token spent info style (langgenius#1597)

* fix weaviate hybrid search issue (langgenius#1600)



* feat: optimize db connections in thread (langgenius#1601)

* fix hybrid search when document is none (langgenius#1603)



* Fix/multi thread parameter (langgenius#1604)

* feat: bump version to 0.3.31-fix3 (langgenius#1606)

---------

Co-authored-by: Luyu Zhang <[email protected]>
Co-authored-by: takatost <[email protected]>
Co-authored-by: crazywoola <[email protected]>
Co-authored-by: zxhlyh <[email protected]>
Co-authored-by: Jyong <[email protected]>
Co-authored-by: jyong <[email protected]>
Co-authored-by: Joel <[email protected]>
Co-authored-by: Ricky <[email protected]>
Co-authored-by: Rhon Joe <[email protected]>
Co-authored-by: Garfield Dai <[email protected]>
Co-authored-by: Matri <[email protected]>
Co-authored-by: waltcow <[email protected]>
  • Loading branch information
13 people authored Nov 24, 2023
1 parent 1457cab commit d87728c
Show file tree
Hide file tree
Showing 206 changed files with 6,030 additions and 1,825 deletions.
43 changes: 43 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Dify 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

## Language Policy

To facilitate clear and effective communication, all discussions, comments, documentation, and pull requests in this project should be conducted in English. This ensures that all contributors can participate and collaborate effectively.


2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "🕷️ Bug report"
description: Report errors or unexpected behavior
description: Report errors or unexpected behavior [please use English :)]
labels:
- bug
body:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/document_issue.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "📚 Documentation Issue"
description: Report issues in our documentation
description: Report issues in our documentation [please use English :)]
labels:
- ducumentation
body:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "⭐ Feature or enhancement request"
description: Propose something new.
description: Propose something new. [please use English :)]
labels:
- enhancement
body:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/help_wanted.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "🤝 Help Wanted"
description: "Request help from the community"
description: "Request help from the community" [please use English :)]
labels:
- help-wanted
body:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/translation_issue.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "🌐 Localization/Translation issue"
description: Report incorrect translations.
description: Report incorrect translations. [please use English :)]
labels:
- translation
body:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/build-api-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ jobs:
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }}
type=ref,event=branch
type=sha,enable=true,priority=100,prefix=,suffix=,format=long
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=${{ github.ref_name }},enable=${{ startsWith(github.ref, 'refs/tags/') }}
- name: Build and push
uses: docker/build-push-action@v4
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/build-web-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ jobs:
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }}
type=ref,event=branch
type=sha,enable=true,priority=100,prefix=,suffix=,format=long
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=${{ github.ref_name }},enable=${{ startsWith(github.ref, 'refs/tags/') }}
- name: Build and push
uses: docker/build-push-action@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
steps:
- uses: actions/stale@v5
with:
days-before-issue-stale: 30
days-before-issue-stale: 15
days-before-issue-close: 3
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: "Close due to it's no longer active, if you have any questions, you can reopen it."
stale-pr-message: "Close due to it's no longer active, if you have any questions, you can reopen it."
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
any-of-labels: 'duplicate,question,invalid,wontfix,no-issue-activity,no-pr-activity,enhancement'
any-of-labels: 'duplicate,question,invalid,wontfix,no-issue-activity,no-pr-activity,enhancement,cant-reproduce,help-wanted'
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
- [] 支持自定义的OpenAI的**API服务**
- [] 支持**文件夹上传**和新的上传文件类型检查(不受限于单纯的文件后缀名)
- [] 提高QA分割时候的最大分段数量


# 路线图

## QA分割需要更多针对性改进
一般情况下文档分段设置为384~512之间为embedding模型所容乃的范围内最好,但是QA分割是将文档发送给LLM后得出N个问答对,可LLM目前Token上限已经在8K~32K之间了,大大超过了Embedding模型的范围
所以对于QA分割最好的方式是:
Expand All @@ -33,4 +31,3 @@
不仅是chatGPT4的多模态,而是利用多模态模型跟LLM模型一起工作
比如 [图像<=>文本模型BLIP](https://github.com/salesforce/BLIP)
这样我们可以在对话中上传多媒体文件(知识库也可以考虑将多模态纳入,但保存多媒体文件是一件很麻烦的事情)

154 changes: 53 additions & 101 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,63 @@
![](./images/describe-cn.jpg)
[![](./images/describe.png)](https://dify.ai)
<p align="center">
<a href="./README.md">English</a> |
<a href="./README_CN.md">简体中文</a> |
<a href="./README_JA.md">日本語</a> |
<a href="./README_ES.md">Español</a>
<a href="./README_ES.md">Español</a> |
<a href="./README_KL.md">Klingon</a>
</p>

<p align="center">
<a href="https://dify.ai" target="_blank">
<img alt="Static Badge" src="https://img.shields.io/badge/AI-Dify?logo=AI&logoColor=%20%23f5f5f5&label=Dify&labelColor=%20%23155EEF&color=%23EAECF0"></a>
<a href="https://discord.gg/FngNHpbcY7" target="_blank">
<img src="https://img.shields.io/discord/1082486657678311454?logo=discord"
alt="chat on Discord"></a>
<a href="https://twitter.com/intent/follow?screen_name=dify_ai" target="_blank">
<img src="https://img.shields.io/twitter/follow/dify_ai?style=social&logo=X"
alt="follow on Twitter"></a>
<a href="https://hub.docker.com/u/langgenius" target="_blank">
<img alt="Docker Pulls" src="https://img.shields.io/docker/pulls/langgenius/dify-web"></a>
</p>

Dify 是一个 LLM 应用开发平台,已经有超过 10 万个应用基于 Dify.AI 构建。它融合了 Backend as Service 和 LLMOps 的理念,涵盖了构建生成式 AI 原生应用所需的核心技术栈,包括一个内置 RAG 引擎。使用 Dify,你可以基于任何模型自部署类似 Assistants API 和 GPTs 的能力。

![](./images/demo.png)

#### [官方网站](https://dify.ai)[使用文档](https://docs.dify.ai/v/zh-hans) · [部署文档](https://docs.dify.ai/v/zh-hans/getting-started/install-self-hosted) · [FAQ](https://docs.dify.ai/v/zh-hans/getting-started/faq)[Twitter](https://twitter.com/dify_ai)[Discord](https://discord.gg/FngNHpbcY7)
## 为什么选择 Dify

**Dify** 是一个易用的 LLMOps 平台,基于不同的大型语言模型能力,让更多人可以简易地创建可持续运营的原生 AI 应用。Dify 提供多种类型应用的可视化编排,应用可开箱即用,也能以“后端即服务”的 API 提供服务
Dify 具有模型中立性,相较 LangChain 等硬编码开发库 Dify 是一个完整的、工程化的技术栈,而相较于 OpenAI 的 Assistants API 你可以完全将服务部署在本地

通过 Dify 创建的应用包含了:
| 功能 | Dify.AI | Assistants API | LangChain |
| --- | --- | --- | --- |
| 编程方式 | 面向 API | 面向 API | 面向 Python 代码 |
| 生态策略 | 开源 | 封闭且商用 | 开源 |
| RAG 引擎 | 支持 | 支持 | 不支持 |
| Prompt IDE | 包含 | 包含 | 没有 |
| 支持的 LLMs | 丰富 | 仅 GPT | 丰富 |
| 本地部署 | 支持 | 不支持 | 不适用 |

- 开箱即用的的 Web 站点,支持表单模式和聊天对话模式
- 一套 API 即可包含插件、上下文增强等能力,替你省下了后端代码的编写工作
- 可视化的对应用进行数据分析,查阅日志或进行标注

https://github.com/langgenius/dify/assets/100913391/f6e658d5-31b3-4c16-a0af-9e191da4d0f6
## 特点

## 核心能力
1. **模型支持:** 你可以在 Dify 上选择基于不同模型的能力来开发你的 AI 应用。Dify 兼容 Langchain,这意味着我们将逐步支持多种 LLMs ,目前支持的模型供应商:
![](./images/models.png)

- [x] **OpenAI**:GPT4、GPT3.5-turbo、GPT3.5-turbo-16k、text-davinci-003
- [x] **Azure OpenAI Service**
- [x] **Anthropic**:Claude2、Claude-instant
- [x] **Replicate**
- [x] **Hugging Face Hub**
- [x] **ChatGLM**
- [x] **Llama2**
- [x] **MiniMax**
- [x] **讯飞星火大模型**
- [x] **文心一言**
- [x] **通义千问**
**1. LLM支持**:与 OpenAI 的 GPT 系列模型集成,或者与开源的 Llama2 系列模型集成。事实上,Dify支持主流的商业模型和开源模型(本地部署或基于 MaaS)。

**2. Prompt IDE**:和团队一起在 Dify 协作,通过可视化的 Prompt 和应用编排工具开发 AI 应用。 支持无缝切换多种大型语言模型。

我们为所有注册云端版的用户免费提供以下资源(登录 [dify.ai](https://cloud.dify.ai) 即可使用):
* 200 次 OpenAI 模型的消息调用额度,用于创建基于 OpenAI 模型的 AI 应用
* 300 万 讯飞星火大模型 Token 的调用额度,用于创建基于讯飞星火大模型的 AI 应用
* 100 万 MiniMax Token 的调用额度,用于创建基于 MiniMax 模型的 AI 应用
2. **可视化编排 Prompt:** 通过界面化编写 prompt 并调试,只需几分钟即可发布一个 AI 应用。
3. **文本 Embedding 处理(数据集)**:全自动完成文本预处理,使用你的数据作为上下文,无需理解晦涩的概念和技术处理。支持 PDF、txt 等文件格式,支持从 Notion、网页、API 同步数据。
4. **基于 API 开发:** 后端即服务。您可以直接访问网页应用,也可以接入 API 集成到您的应用中,无需关注复杂的后端架构和部署过程。
5. **插件能力:** Dify 「智聊」平台已支持网页浏览、Google 搜索、Wikipedia 查询等第一方插件,可在对话中实现联网搜索、分析网页内容、展示 AI 的推理过程。
6. **团队 Workspace:** 团队成员可加入 Workspace 编辑、管理和使用团队内的 AI 应用。
6. **数据标注与改进:** 可视化查阅 AI 应用日志并对数据进行改进标注,观测 AI 的推理过程,不断提高其性能。(Coming soon)
-----------------------------
## Use cases
* [几分钟创建一个带有业务数据的官网 AI 智能客服](https://docs.dify.ai/v/zh-hans/use-cases/create-an-ai-chatbot-with-business-data-in-minutes)
* [构建一个 Notion AI 助手](https://docs.dify.ai/v/zh-hans/use-cases/build-an-notion-ai-assistant)
* [创建 Midjoureny 提示词机器人](https://docs.dify.ai/v/zh-hans/use-cases/create-a-midjoureny-prompt-word-robot-with-zero-code)
**3. RAG引擎**:包括各种基于全文索引或向量数据库嵌入的 RAG 能力,允许直接上传 PDF、TXT 等各种文本格式。

**4. Agent**:基于函数调用的 Agent框架,允许用户自定义配置,所见即所得。Dify 提供了基本的插件能力,如谷歌搜索。

## 使用云服务
**5. 持续运营**:监控和分析应用日志和性能,使用生产数据持续改进 Prompt、数据集或模型。

访问 [Dify.ai](https://cloud.dify.ai) 使用云端版。
## 在开始之前

- [网站](https://dify.ai)
- [文档](https://docs.dify.ai)
- [部署文档](https://docs.dify.ai/getting-started/install-self-hosted)
- [常见问题](https://docs.dify.ai/getting-started/faq)

## 安装社区版

Expand Down Expand Up @@ -83,80 +86,29 @@ docker compose up -d

### 配置

需要自定义配置,请参考我们的 [docker-compose.yml](docker/docker-compose.yaml) 文件中的注释,并手动设置环境配置,修改完毕后,请再次执行 `docker-compose up -d`

## Roadmap

我们正在开发中的功能:

- **数据集**,支持更多的数据集,通过网页、API 同步内容。用户可以根据自己的数据源构建 AI 应用程序。
- **插件**,我们将发布符合 ChatGPT 标准的插件,支持更多 Dify 自己的插件,支持用户自定义插件能力,以在应用程序中启用更多功能,例如以支持以目标为导向的分解推理任务。

## Q&A

**Q: 我能用 Dify 做什么?**

A: Dify 是一个简单且能力丰富的 LLM 开发和运营工具。你可以用它搭建商用级应用,个人助理。如果你想自己开发应用,Dify 也能为你省下接入 OpenAI 的后端工作,使用我们逐步提供的可视化运营能力,你可以持续的改进和训练你的 GPT 模型。

**Q: 如何使用 Dify “训练”自己的模型?**

A: 一个有价值的应用由 Prompt Engineering、上下文增强和 Fine-tune 三个环节组成。我们创造了一种 Prompt 结合编程语言的 Hybrid 编程方式(类似一个模版引擎),你可以轻松的完成长文本嵌入,或抓取用户输入的一个 Youtube 视频的字幕——这些都将作为上下文提交给 LLMs 进行计算。我们十分注重应用的可运营性,你的用户在使用 App 期间产生的数据,可进行分析、标记和持续训练。以上环节如果没有好的工具支持,可能会消耗你大量的时间。

**Q: 如果要创建一个自己的应用,我需要准备什么?**

A: 我们假定你已经有了 OpenAI 或 Claude 等模型的 API Key,如果没有请去注册一个。如果你已经有了一些内容可以作为训练上下文,就太好了。

**Q: 提供哪些界面语言?**

A: 支持英文、中文,你可以为我们贡献语言包并提供维护支持。
如果您需要自定义配置,请参考我们的 [docker-compose.yml](docker/docker-compose.yaml) 文件中的注释,并手动设置环境配置。更改后,请再次运行 `docker-compose up -d`。您可以在我们的[文档](https://docs.dify.ai/getting-started/install-self-hosted/environments)中查看所有环境变量的完整列表。

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=langgenius/dify&type=Date)](https://star-history.com/#langgenius/dify&Date)


## 贡献

我们欢迎你为 Dify 作出贡献帮助 Dify 变得更好。我们欢迎各种方式的贡献,提交代码、问题、新想法、或者分享你基于 Dify 创建出的各种有趣有用的 AI 应用。同时,我们也欢迎你在不同的活动、研讨会、社交媒体上分享 Dify。

### 贡献代码
为了确保正确审查,所有代码贡献 - 包括来自具有直接提交更改权限的贡献者 - 都必须提交 PR 请求并在合并分支之前得到核心开发人员的批准。

我们欢迎所有人提交 PR!如果您愿意提供帮助,可以在 [贡献指南](CONTRIBUTING_CN.md) 中了解有关如何为项目做出代码贡献的更多信息。

### 提交问题或想法
你可以通过 Dify 代码仓库新增 issues 来提交你的问题或想法。如遇到问题,请尽可能描述你遇到问题的操作步骤,以便我们更好地发现它。如果你对我们的产品有任何新想法,也欢迎向我们反馈,请尽可能多地分享你的见解,以便我们在社区中获得更多反馈和进一步讨论。

### 分享你的应用
我们鼓励所有社区成员分享他们基于 Dify 创造出的 AI 应用,它们可以是应用于不同情景或不同用户,这将有助于为希望基于 AI 能力创造的人们提供强大灵感!你可以通过 [Dify-user-case 仓库项目提交 issue](https://github.com/langgenius/dify-user-case) 来分享你的应用案例。

### 向别人分享 Dify
我们鼓励社区贡献者们积极展示你使用 Dify 的不同角度。你可以通过线下研讨会、博客或社交媒体上谈论或分享你使用 Dify 的任意功能,相信你独特的使用分享会给别人带来非常大的帮助!如果你需要任何指导帮助,欢迎联系我们 [email protected] ,你也可以在 twitter @Dify.AI 或在 [Discord 社区](https://discord.gg/FngNHpbcY7)交流来帮助你传播信息。
## 社区与支持

### 帮助别人
你还可以在 Discord、GitHub issues或其他社交平台上帮助需要帮助的人,指导别人解决使用过程中遇到的问题和分享使用经验。这也是个非常了不起的贡献!如果你希望成为 Dify 社区的维护者,请通过[Discord 社区](https://discord.gg/FngNHpbcY7) 联系官方团队或邮件联系我们 [email protected].
我们欢迎您为 Dify 做出贡献,以帮助改善 Dify。包括:提交代码、问题、新想法,或分享您基于 Dify 创建的有趣且有用的 AI 应用程序。同时,我们也欢迎您在不同的活动、会议和社交媒体上分享 Dify。

- [GitHub Issues](https://github.com/langgenius/dify/issues)。👉:使用 Dify.AI 时遇到的错误和问题,请参阅[贡献指南](CONTRIBUTING.md)
- [电子邮件支持](mailto:[email protected]?subject=[GitHub]Questions%20About%20Dify)。👉:关于使用 Dify.AI 的问题。
- [Discord](https://discord.gg/FngNHpbcY7)。👉:分享您的应用程序并与社区交流。
- [Twitter](https://twitter.com/dify_ai)。👉:分享您的应用程序并与社区交流。
- [商业许可](mailto:[email protected]?subject=[GitHub]Business%20License%20Inquiry)。👉:有关商业用途许可 Dify.AI 的商业咨询。
- [微信]() 👉:扫描下方二维码,添加微信好友,备注 Dify,我们将邀请您加入 Dify 社区。
<img src="./images/wechat.png" alt="wechat" width="100"/>

## 联系我们

如果您有任何问题、建议或合作意向,欢迎通过以下方式联系我们:

- 在我们的 [GitHub Repo](https://github.com/langgenius/dify) 上提交 Issue 或 PR
- 在我们的 [Discord 社区](https://discord.gg/FngNHpbcY7) 上加入讨论
- 发送邮件至 [email protected]

## 安全
## 安全问题

为了保护您的隐私,请避免在 GitHub 上发布安全问题。发送问题至 [email protected],我们将为您做更细致的解答。

## Citation

本软件使用了以下开源软件:

- Chase, H. (2022). LangChain [Computer software]. https://github.com/hwchase17/langchain

更多信息,请参考相应软件的官方网站或许可证文本。

## License

本仓库遵循 [Dify Open Source License](LICENSE) 开源协议。
Loading

0 comments on commit d87728c

Please sign in to comment.