Skip to content

Commit ef6920e

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/dialogue_count
2 parents bacbd24 + 1d8385f commit ef6920e

File tree

187 files changed

+5484
-1098
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+5484
-1098
lines changed

.github/workflows/db-migration-test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ jobs:
4848
cp .env.example .env
4949
5050
- name: Run DB Migration
51+
env:
52+
DEBUG: true
5153
run: |
5254
cd api
5355
poetry run python -m flask upgrade-db

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ Deploy Dify to Cloud Platform with a single click using [terraform](https://www.
147147
##### Google Cloud
148148
- [Google Cloud Terraform by @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
149149

150+
#### Using AWS CDK for Deployment
151+
152+
Deploy Dify to AWS with [CDK](https://aws.amazon.com/cdk/)
153+
154+
##### AWS
155+
- [AWS CDK by @KevinZhao](https://github.com/aws-samples/solution-for-deploying-dify-on-aws)
156+
150157
## Contributing
151158

152159
For those who'd like to contribute code, see our [Contribution Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md).

README_AR.md

+14
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ docker compose up -d
190190
##### Google Cloud
191191
- [Google Cloud Terraform بواسطة @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
192192

193+
#### استخدام AWS CDK للنشر
194+
195+
انشر Dify على AWS باستخدام [CDK](https://aws.amazon.com/cdk/)
196+
197+
##### AWS
198+
- [AWS CDK بواسطة @KevinZhao](https://github.com/aws-samples/solution-for-deploying-dify-on-aws)
199+
193200
## المساهمة
194201

195202
لأولئك الذين يرغبون في المساهمة، انظر إلى [دليل المساهمة](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) لدينا.
@@ -222,3 +229,10 @@ docker compose up -d
222229
## الرخصة
223230

224231
هذا المستودع متاح تحت [رخصة البرنامج الحر Dify](LICENSE)، والتي تعتبر بشكل أساسي Apache 2.0 مع بعض القيود الإضافية.
232+
## الكشف عن الأمان
233+
234+
لحماية خصوصيتك، يرجى تجنب نشر مشكلات الأمان على GitHub. بدلاً من ذلك، أرسل أسئلتك إلى [email protected] وسنقدم لك إجابة أكثر تفصيلاً.
235+
236+
## الرخصة
237+
238+
هذا المستودع متاح تحت [رخصة البرنامج الحر Dify](LICENSE)، والتي تعتبر بشكل أساسي Apache 2.0 مع بعض القيود الإضافية.

README_CN.md

+7
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,13 @@ docker compose up -d
213213
##### Google Cloud
214214
- [Google Cloud Terraform by @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
215215

216+
#### 使用 AWS CDK 部署
217+
218+
使用 [CDK](https://aws.amazon.com/cdk/) 将 Dify 部署到 AWS
219+
220+
##### AWS
221+
- [AWS CDK by @KevinZhao](https://github.com/aws-samples/solution-for-deploying-dify-on-aws)
222+
216223
## Star History
217224

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

README_ES.md

+14
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,13 @@ Despliega Dify en una plataforma en la nube con un solo clic utilizando [terrafo
215215
##### Google Cloud
216216
- [Google Cloud Terraform por @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
217217

218+
#### Usando AWS CDK para el Despliegue
219+
220+
Despliegue Dify en AWS usando [CDK](https://aws.amazon.com/cdk/)
221+
222+
##### AWS
223+
- [AWS CDK por @KevinZhao](https://github.com/aws-samples/solution-for-deploying-dify-on-aws)
224+
218225
## Contribuir
219226

220227
Para aquellos que deseen contribuir con código, consulten nuestra [Guía de contribución](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md).
@@ -248,3 +255,10 @@ Para proteger tu privacidad, evita publicar problemas de seguridad en GitHub. En
248255
## Licencia
249256

250257
Este repositorio está disponible bajo la [Licencia de Código Abierto de Dify](LICENSE), que es esencialmente Apache 2.0 con algunas restricciones adicionales.
258+
## Divulgación de Seguridad
259+
260+
Para proteger tu privacidad, evita publicar problemas de seguridad en GitHub. En su lugar, envía tus preguntas a [email protected] y te proporcionaremos una respuesta más detallada.
261+
262+
## Licencia
263+
264+
Este repositorio está disponible bajo la [Licencia de Código Abierto de Dify](LICENSE), que es esencialmente Apache 2.0 con algunas restricciones adicionales.

README_FR.md

+14
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,13 @@ Déployez Dify sur une plateforme cloud en un clic en utilisant [terraform](http
213213
##### Google Cloud
214214
- [Google Cloud Terraform par @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
215215

216+
#### Utilisation d'AWS CDK pour le déploiement
217+
218+
Déployez Dify sur AWS en utilisant [CDK](https://aws.amazon.com/cdk/)
219+
220+
##### AWS
221+
- [AWS CDK par @KevinZhao](https://github.com/aws-samples/solution-for-deploying-dify-on-aws)
222+
216223
## Contribuer
217224

218225
Pour ceux qui souhaitent contribuer du code, consultez notre [Guide de contribution](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md).
@@ -246,3 +253,10 @@ Pour protéger votre vie privée, veuillez éviter de publier des problèmes de
246253
## Licence
247254

248255
Ce référentiel est disponible sous la [Licence open source Dify](LICENSE), qui est essentiellement l'Apache 2.0 avec quelques restrictions supplémentaires.
256+
## Divulgation de sécurité
257+
258+
Pour protéger votre vie privée, veuillez éviter de publier des problèmes de sécurité sur GitHub. Au lieu de cela, envoyez vos questions à [email protected] et nous vous fournirons une réponse plus détaillée.
259+
260+
## Licence
261+
262+
Ce référentiel est disponible sous la [Licence open source Dify](LICENSE), qui est essentiellement l'Apache 2.0 avec quelques restrictions supplémentaires.

README_JA.md

+7
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,13 @@ docker compose up -d
212212
##### Google Cloud
213213
- [@sotazumによるGoogle Cloud Terraform](https://github.com/DeNA/dify-google-cloud-terraform)
214214

215+
#### AWS CDK を使用したデプロイ
216+
217+
[CDK](https://aws.amazon.com/cdk/) を使用して、DifyをAWSにデプロイします
218+
219+
##### AWS
220+
- [@KevinZhaoによるAWS CDK](https://github.com/aws-samples/solution-for-deploying-dify-on-aws)
221+
215222
## 貢献
216223

217224
コードに貢献したい方は、[Contribution Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md)を参照してください。

README_KL.md

+7
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,13 @@ wa'logh nIqHom neH ghun deployment toy'wI' [terraform](https://www.terraform.io/
213213
##### Google Cloud
214214
- [Google Cloud Terraform qachlot @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
215215

216+
#### AWS CDK atorlugh pilersitsineq
217+
218+
wa'logh nIqHom neH ghun deployment toy'wI' [CDK](https://aws.amazon.com/cdk/) lo'laH.
219+
220+
##### AWS
221+
- [AWS CDK qachlot @KevinZhao](https://github.com/aws-samples/solution-for-deploying-dify-on-aws)
222+
216223
## Contributing
217224

218225
For those who'd like to contribute code, see our [Contribution Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md).

README_KR.md

+7
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,13 @@ Dify를 Kubernetes에 배포하고 프리미엄 스케일링 설정을 구성했
205205
##### Google Cloud
206206
- [sotazum의 Google Cloud Terraform](https://github.com/DeNA/dify-google-cloud-terraform)
207207

208+
#### AWS CDK를 사용한 배포
209+
210+
[CDK](https://aws.amazon.com/cdk/)를 사용하여 AWS에 Dify 배포
211+
212+
##### AWS
213+
- [KevinZhao의 AWS CDK](https://github.com/aws-samples/solution-for-deploying-dify-on-aws)
214+
208215
## 기여
209216

210217
코드에 기여하고 싶은 분들은 [기여 가이드](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md)를 참조하세요.

README_PT.md

+7
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,13 @@ Implante o Dify na Plataforma Cloud com um único clique usando [terraform](http
211211
##### Google Cloud
212212
- [Google Cloud Terraform por @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
213213

214+
#### Usando AWS CDK para Implantação
215+
216+
Implante o Dify na AWS usando [CDK](https://aws.amazon.com/cdk/)
217+
218+
##### AWS
219+
- [AWS CDK por @KevinZhao](https://github.com/aws-samples/solution-for-deploying-dify-on-aws)
220+
214221
## Contribuindo
215222

216223
Para aqueles que desejam contribuir com código, veja nosso [Guia de Contribuição](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md).

README_SI.md

+7
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,13 @@ namestite Dify v Cloud Platform z enim klikom z uporabo [terraform](https://www.
145145
##### Google Cloud
146146
- [Google Cloud Terraform by @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
147147

148+
#### Uporaba AWS CDK za uvajanje
149+
150+
Uvedite Dify v AWS z uporabo [CDK](https://aws.amazon.com/cdk/)
151+
152+
##### AWS
153+
- [AWS CDK by @KevinZhao](https://github.com/aws-samples/solution-for-deploying-dify-on-aws)
154+
148155
## Prispevam
149156

150157
Za tiste, ki bi radi prispevali kodo, si oglejte naš vodnik za prispevke . Hkrati vas prosimo, da podprete Dify tako, da ga delite na družbenih medijih ter na dogodkih in konferencah.

README_TR.md

+7
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,13 @@ Dify'ı bulut platformuna tek tıklamayla dağıtın [terraform](https://www.ter
211211
##### Google Cloud
212212
- [Google Cloud Terraform tarafından @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
213213

214+
#### AWS CDK ile Dağıtım
215+
216+
[CDK](https://aws.amazon.com/cdk/) kullanarak Dify'ı AWS'ye dağıtın
217+
218+
##### AWS
219+
- [AWS CDK tarafından @KevinZhao](https://github.com/aws-samples/solution-for-deploying-dify-on-aws)
220+
214221
## Katkıda Bulunma
215222

216223
Kod katkısında bulunmak isteyenler için [Katkı Kılavuzumuza](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) bakabilirsiniz.

README_VI.md

+7
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,13 @@ Triển khai Dify lên nền tảng đám mây với một cú nhấp chuột b
207207
##### Google Cloud
208208
- [Google Cloud Terraform bởi @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
209209

210+
#### Sử dụng AWS CDK để Triển khai
211+
212+
Triển khai Dify trên AWS bằng [CDK](https://aws.amazon.com/cdk/)
213+
214+
##### AWS
215+
- [AWS CDK bởi @KevinZhao](https://github.com/aws-samples/solution-for-deploying-dify-on-aws)
216+
210217
## Đóng góp
211218

212219
Đối với những người muốn đóng góp mã, xem [Hướng dẫn Đóng góp](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) của chúng tôi.

api/.env.example

+5-2
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ NOTION_INTERNAL_SECRET=you-internal-secret
329329
ETL_TYPE=dify
330330
UNSTRUCTURED_API_URL=
331331
UNSTRUCTURED_API_KEY=
332+
SCARF_NO_ANALYTICS=true
332333

333334
#ssrf
334335
SSRF_PROXY_HTTP_URL=
@@ -382,7 +383,7 @@ LOG_DATEFORMAT=%Y-%m-%d %H:%M:%S
382383
LOG_TZ=UTC
383384

384385
# Indexing configuration
385-
INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH=1000
386+
INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH=4000
386387

387388
# Workflow runtime configuration
388389
WORKFLOW_MAX_EXECUTION_STEPS=500
@@ -410,4 +411,6 @@ POSITION_PROVIDER_EXCLUDES=
410411
# Reset password token expiry minutes
411412
RESET_PASSWORD_TOKEN_EXPIRY_MINUTES=5
412413

413-
CREATE_TIDB_SERVICE_JOB_ENABLED=false
414+
CREATE_TIDB_SERVICE_JOB_ENABLED=false
415+
416+
RETRIEVAL_TOP_N=0

api/.ruff.toml

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
exclude = [
2+
"migrations/*",
3+
]
4+
line-length = 120
5+
6+
[format]
7+
quote-style = "double"
8+
9+
[lint]
10+
preview = true
11+
select = [
12+
"B", # flake8-bugbear rules
13+
"C4", # flake8-comprehensions
14+
"E", # pycodestyle E rules
15+
"F", # pyflakes rules
16+
"FURB", # refurb rules
17+
"I", # isort rules
18+
"N", # pep8-naming
19+
"PT", # flake8-pytest-style rules
20+
"PLC0208", # iteration-over-set
21+
"PLC2801", # unnecessary-dunder-call
22+
"PLC0414", # useless-import-alias
23+
"PLR0402", # manual-from-import
24+
"PLR1711", # useless-return
25+
"PLR1714", # repeated-equality-comparison
26+
"RUF013", # implicit-optional
27+
"RUF019", # unnecessary-key-check
28+
"RUF100", # unused-noqa
29+
"RUF101", # redirected-noqa
30+
"RUF200", # invalid-pyproject-toml
31+
"S506", # unsafe-yaml-load
32+
"SIM", # flake8-simplify rules
33+
"TRY400", # error-instead-of-exception
34+
"TRY401", # verbose-log-message
35+
"UP", # pyupgrade rules
36+
"W191", # tab-indentation
37+
"W605", # invalid-escape-sequence
38+
]
39+
40+
ignore = [
41+
"E402", # module-import-not-at-top-of-file
42+
"E711", # none-comparison
43+
"E712", # true-false-comparison
44+
"E721", # type-comparison
45+
"E722", # bare-except
46+
"E731", # lambda-assignment
47+
"F821", # undefined-name
48+
"F841", # unused-variable
49+
"FURB113", # repeated-append
50+
"FURB152", # math-constant
51+
"UP007", # non-pep604-annotation
52+
"UP032", # f-string
53+
"B005", # strip-with-multi-characters
54+
"B006", # mutable-argument-default
55+
"B007", # unused-loop-control-variable
56+
"B026", # star-arg-unpacking-after-keyword-arg
57+
"B904", # raise-without-from-inside-except
58+
"B905", # zip-without-explicit-strict
59+
"N806", # non-lowercase-variable-in-function
60+
"N815", # mixed-case-variable-in-class-scope
61+
"PT011", # pytest-raises-too-broad
62+
"SIM102", # collapsible-if
63+
"SIM103", # needless-bool
64+
"SIM105", # suppressible-exception
65+
"SIM107", # return-in-try-except-finally
66+
"SIM108", # if-else-block-instead-of-if-exp
67+
"SIM113", # eumerate-for-loop
68+
"SIM117", # multiple-with-statements
69+
"SIM210", # if-expr-with-true-false
70+
"SIM300", # yoda-conditions,
71+
]
72+
73+
[lint.per-file-ignores]
74+
"__init__.py" = [
75+
"F401", # unused-import
76+
"F811", # redefined-while-unused
77+
]
78+
"configs/*" = [
79+
"N802", # invalid-function-name
80+
]
81+
"libs/gmpy2_pkcs10aep_cipher.py" = [
82+
"N803", # invalid-argument-name
83+
]
84+
"tests/*" = [
85+
"F811", # redefined-while-unused
86+
"F401", # unused-import
87+
]
88+
89+
[lint.pyflakes]
90+
extend-generics = [
91+
"_pytest.monkeypatch",
92+
"tests.integration_tests",
93+
]

api/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ RUN apt-get update \
5555
&& echo "deb http://deb.debian.org/debian testing main" > /etc/apt/sources.list \
5656
&& apt-get update \
5757
# For Security
58-
&& apt-get install -y --no-install-recommends expat=2.6.4-1 libldap-2.5-0=2.5.18+dfsg-3+b1 perl=5.40.0-7 libsqlite3-0=3.46.1-1 zlib1g=1:1.3.dfsg+really1.3.1-1+b1 \
58+
&& apt-get install -y --no-install-recommends expat=2.6.4-1 libldap-2.5-0=2.5.18+dfsg-3+b1 perl=5.40.0-8 libsqlite3-0=3.46.1-1 zlib1g=1:1.3.dfsg+really1.3.1-1+b1 \
5959
# install a chinese font to support the use of tools like matplotlib
6060
&& apt-get install -y fonts-noto-cjk \
6161
&& apt-get autoremove -y \

0 commit comments

Comments
 (0)