2024-02-06 13:21:13 +08:00
|
|
|
[project]
|
2024-08-02 21:14:36 +08:00
|
|
|
requires-python = ">=3.10,<3.13"
|
2024-02-06 13:21:13 +08:00
|
|
|
|
2024-06-18 13:27:03 +08:00
|
|
|
[build-system]
|
|
|
|
requires = ["poetry-core"]
|
|
|
|
build-backend = "poetry.core.masonry.api"
|
|
|
|
|
2024-02-06 13:21:13 +08:00
|
|
|
[tool.ruff]
|
2024-09-13 22:42:08 +08:00
|
|
|
exclude=[
|
|
|
|
"migrations/*",
|
|
|
|
]
|
2024-02-06 13:21:13 +08:00
|
|
|
line-length = 120
|
|
|
|
|
|
|
|
[tool.ruff.lint]
|
2024-06-17 10:04:28 +08:00
|
|
|
preview = true
|
2024-02-06 13:21:13 +08:00
|
|
|
select = [
|
2024-05-20 16:34:13 +08:00
|
|
|
"B", # flake8-bugbear rules
|
2024-06-27 11:21:31 +08:00
|
|
|
"C4", # flake8-comprehensions
|
2024-09-11 18:55:00 +08:00
|
|
|
"E", # pycodestyle E rules
|
2024-02-08 14:11:10 +08:00
|
|
|
"F", # pyflakes rules
|
2024-09-12 15:50:49 +08:00
|
|
|
"FURB", # refurb rules
|
2024-05-20 16:34:13 +08:00
|
|
|
"I", # isort rules
|
2024-09-11 16:40:52 +08:00
|
|
|
"N", # pep8-naming
|
2024-09-12 18:09:16 +08:00
|
|
|
"PT", # flake8-pytest-style rules
|
2024-09-13 22:42:08 +08:00
|
|
|
"PLC0208", # iteration-over-set
|
|
|
|
"PLC2801", # unnecessary-dunder-call
|
|
|
|
"PLC0414", # useless-import-alias
|
|
|
|
"PLR0402", # manual-from-import
|
|
|
|
"PLR1711", # useless-return
|
|
|
|
"PLR1714", # repeated-equality-comparison
|
2024-10-09 14:36:43 +08:00
|
|
|
"RUF013", # implicit-optional
|
2024-05-19 18:30:45 +08:00
|
|
|
"RUF019", # unnecessary-key-check
|
2024-06-05 14:05:15 +08:00
|
|
|
"RUF100", # unused-noqa
|
|
|
|
"RUF101", # redirected-noqa
|
2024-05-24 12:08:12 +08:00
|
|
|
"S506", # unsafe-yaml-load
|
2024-09-12 12:55:45 +08:00
|
|
|
"SIM", # flake8-simplify rules
|
|
|
|
"UP", # pyupgrade rules
|
2024-06-05 14:05:15 +08:00
|
|
|
"W191", # tab-indentation
|
2024-06-02 10:02:37 +08:00
|
|
|
"W605", # invalid-escape-sequence
|
2024-02-08 14:11:10 +08:00
|
|
|
]
|
|
|
|
ignore = [
|
2024-09-11 18:55:00 +08:00
|
|
|
"E402", # module-import-not-at-top-of-file
|
|
|
|
"E711", # none-comparison
|
|
|
|
"E712", # true-false-comparison
|
|
|
|
"E721", # type-comparison
|
|
|
|
"E722", # bare-except
|
|
|
|
"E731", # lambda-assignment
|
2024-02-08 14:11:10 +08:00
|
|
|
"F821", # undefined-name
|
|
|
|
"F841", # unused-variable
|
2024-09-12 15:50:49 +08:00
|
|
|
"FURB113", # repeated-append
|
|
|
|
"FURB152", # math-constant
|
2024-02-09 15:21:33 +08:00
|
|
|
"UP007", # non-pep604-annotation
|
|
|
|
"UP032", # f-string
|
2024-05-20 16:34:13 +08:00
|
|
|
"B005", # strip-with-multi-characters
|
|
|
|
"B006", # mutable-argument-default
|
|
|
|
"B007", # unused-loop-control-variable
|
|
|
|
"B026", # star-arg-unpacking-after-keyword-arg
|
|
|
|
"B904", # raise-without-from-inside-except
|
|
|
|
"B905", # zip-without-explicit-strict
|
2024-09-11 16:40:52 +08:00
|
|
|
"N806", # non-lowercase-variable-in-function
|
|
|
|
"N815", # mixed-case-variable-in-class-scope
|
2024-09-12 18:09:16 +08:00
|
|
|
"PT011", # pytest-raises-too-broad
|
2024-09-12 12:55:45 +08:00
|
|
|
"SIM102", # collapsible-if
|
|
|
|
"SIM103", # needless-bool
|
|
|
|
"SIM105", # suppressible-exception
|
|
|
|
"SIM107", # return-in-try-except-finally
|
|
|
|
"SIM108", # if-else-block-instead-of-if-exp
|
|
|
|
"SIM113", # eumerate-for-loop
|
|
|
|
"SIM117", # multiple-with-statements
|
|
|
|
"SIM210", # if-expr-with-true-false
|
2024-09-13 02:15:19 +08:00
|
|
|
"SIM300", # yoda-conditions,
|
2024-02-06 13:21:13 +08:00
|
|
|
]
|
2024-04-18 13:43:15 +08:00
|
|
|
|
2024-04-18 20:24:05 +08:00
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
|
|
"app.py" = [
|
|
|
|
]
|
|
|
|
"__init__.py" = [
|
|
|
|
"F401", # unused-import
|
|
|
|
"F811", # redefined-while-unused
|
|
|
|
]
|
2024-09-11 16:40:52 +08:00
|
|
|
"configs/*" = [
|
|
|
|
"N802", # invalid-function-name
|
|
|
|
]
|
|
|
|
"libs/gmpy2_pkcs10aep_cipher.py" = [
|
|
|
|
"N803", # invalid-argument-name
|
|
|
|
]
|
2024-09-12 14:00:36 +08:00
|
|
|
"tests/*" = [
|
|
|
|
"F811", # redefined-while-unused
|
2024-10-15 16:26:44 +08:00
|
|
|
"F401", # unused-import
|
2024-09-12 14:00:36 +08:00
|
|
|
]
|
2024-04-18 20:24:05 +08:00
|
|
|
|
2024-10-08 11:13:11 +08:00
|
|
|
[tool.ruff.lint.pyflakes]
|
2024-10-15 16:26:44 +08:00
|
|
|
extend-generics=[
|
2024-10-08 11:13:11 +08:00
|
|
|
"_pytest.monkeypatch",
|
|
|
|
"tests.integration_tests",
|
|
|
|
]
|
|
|
|
|
2024-06-26 16:30:28 +08:00
|
|
|
[tool.ruff.format]
|
2024-08-15 12:54:05 +08:00
|
|
|
exclude = [
|
|
|
|
]
|
2024-04-18 13:43:15 +08:00
|
|
|
|
2024-06-11 13:11:28 +08:00
|
|
|
[tool.poetry]
|
|
|
|
name = "dify-api"
|
2024-06-11 22:21:18 +08:00
|
|
|
package-mode = false
|
2024-06-11 13:11:28 +08:00
|
|
|
|
2024-06-27 17:52:54 +08:00
|
|
|
############################################################
|
2024-10-08 15:11:45 +08:00
|
|
|
# [ Main ] Dependency group
|
2024-06-27 17:52:54 +08:00
|
|
|
############################################################
|
|
|
|
|
2024-06-11 13:11:28 +08:00
|
|
|
[tool.poetry.dependencies]
|
2024-06-27 17:52:54 +08:00
|
|
|
anthropic = "~0.23.1"
|
|
|
|
authlib = "1.3.1"
|
2024-10-08 15:11:45 +08:00
|
|
|
azure-ai-inference = "~1.0.0b3"
|
|
|
|
azure-ai-ml = "~1.20.0"
|
2024-06-27 17:52:54 +08:00
|
|
|
azure-identity = "1.16.1"
|
2024-06-11 22:21:18 +08:00
|
|
|
beautifulsoup4 = "4.12.2"
|
2024-09-12 19:15:20 +08:00
|
|
|
boto3 = "1.35.17"
|
2024-06-27 17:52:54 +08:00
|
|
|
bs4 = "~0.0.1"
|
|
|
|
cachetools = "~5.3.0"
|
|
|
|
celery = "~5.3.6"
|
|
|
|
chardet = "~5.1.0"
|
|
|
|
cohere = "~5.2.4"
|
|
|
|
dashscope = { version = "~1.17.0", extras = ["tokenizer"] }
|
2024-06-11 22:21:18 +08:00
|
|
|
flask = "~3.0.1"
|
|
|
|
flask-compress = "~1.14"
|
2024-06-27 17:52:54 +08:00
|
|
|
flask-cors = "~4.0.0"
|
2024-06-11 22:21:18 +08:00
|
|
|
flask-login = "~0.6.3"
|
|
|
|
flask-migrate = "~4.0.5"
|
|
|
|
flask-restful = "~0.3.10"
|
2024-10-08 15:11:45 +08:00
|
|
|
flask-sqlalchemy = "~3.1.1"
|
2024-06-11 22:21:18 +08:00
|
|
|
gevent = "~23.9.1"
|
2024-08-02 21:14:36 +08:00
|
|
|
gmpy2 = "~2.2.1"
|
2024-09-22 13:38:08 +08:00
|
|
|
google-ai-generativelanguage = "0.6.9"
|
2024-06-11 22:21:18 +08:00
|
|
|
google-api-core = "2.18.0"
|
|
|
|
google-api-python-client = "2.90.0"
|
|
|
|
google-auth = "2.29.0"
|
2024-06-11 13:11:28 +08:00
|
|
|
google-auth-httplib2 = "0.2.0"
|
2024-06-27 17:52:54 +08:00
|
|
|
google-cloud-aiplatform = "1.49.0"
|
2024-09-22 13:38:08 +08:00
|
|
|
google-generativeai = "0.8.1"
|
2024-06-11 13:11:28 +08:00
|
|
|
googleapis-common-protos = "1.63.0"
|
2024-06-27 17:52:54 +08:00
|
|
|
gunicorn = "~22.0.0"
|
|
|
|
httpx = { version = "~0.27.0", extras = ["socks"] }
|
2024-06-11 22:21:18 +08:00
|
|
|
huggingface-hub = "~0.16.4"
|
2024-06-27 17:52:54 +08:00
|
|
|
jieba = "0.42.1"
|
2024-10-08 15:11:45 +08:00
|
|
|
langfuse = "~2.51.3"
|
|
|
|
langsmith = "~0.1.77"
|
2024-06-27 17:52:54 +08:00
|
|
|
mailchimp-transactional = "~1.0.50"
|
|
|
|
markdown = "~3.5.1"
|
2024-10-08 15:11:45 +08:00
|
|
|
nomic = "~3.1.2"
|
|
|
|
novita-client = "~0.5.7"
|
2024-06-27 17:52:54 +08:00
|
|
|
numpy = "~1.26.4"
|
2024-10-08 15:11:45 +08:00
|
|
|
oci = "~2.135.1"
|
2024-10-21 10:43:49 +08:00
|
|
|
openai = "~1.52.0"
|
2024-08-19 14:05:41 +08:00
|
|
|
openpyxl = "~3.1.5"
|
2024-06-11 22:21:18 +08:00
|
|
|
pandas = { version = "~2.2.2", extras = ["performance", "excel"] }
|
2024-06-27 17:52:54 +08:00
|
|
|
psycopg2-binary = "~2.9.6"
|
|
|
|
pycryptodome = "3.19.1"
|
2024-10-21 23:32:09 +08:00
|
|
|
pydantic = "~2.9.2"
|
|
|
|
pydantic-settings = "~2.6.0"
|
2024-07-16 13:40:58 +08:00
|
|
|
pydantic_extra_types = "~2.9.0"
|
2024-06-27 17:52:54 +08:00
|
|
|
pyjwt = "~2.8.0"
|
|
|
|
pypdfium2 = "~4.17.0"
|
2024-08-02 15:51:23 +08:00
|
|
|
python = ">=3.10,<3.13"
|
2024-06-27 17:52:54 +08:00
|
|
|
python-docx = "~1.1.0"
|
|
|
|
python-dotenv = "1.0.0"
|
2024-06-11 22:21:18 +08:00
|
|
|
pyyaml = "~6.0.1"
|
2024-06-27 17:52:54 +08:00
|
|
|
readabilipy = "0.2.0"
|
|
|
|
redis = { version = "~5.0.3", extras = ["hiredis"] }
|
|
|
|
replicate = "~0.22.0"
|
|
|
|
resend = "~0.7.0"
|
2024-10-08 15:11:45 +08:00
|
|
|
sagemaker = "2.231.0"
|
|
|
|
scikit-learn = "~1.5.1"
|
2024-07-24 04:49:03 +08:00
|
|
|
sentry-sdk = { version = "~1.44.1", extras = ["flask"] }
|
2024-06-27 17:52:54 +08:00
|
|
|
sqlalchemy = "~2.0.29"
|
2024-10-25 17:15:44 +08:00
|
|
|
starlette = "0.41.0"
|
2024-06-27 17:52:54 +08:00
|
|
|
tencentcloud-sdk-python-hunyuan = "~3.0.1158"
|
2024-10-15 16:26:44 +08:00
|
|
|
tiktoken = "~0.8.0"
|
2024-06-27 17:52:54 +08:00
|
|
|
tokenizers = "~0.15.0"
|
|
|
|
transformers = "~4.35.0"
|
2024-10-25 17:15:44 +08:00
|
|
|
unstructured = { version = "~0.16.1", extras = ["docx", "epub", "md", "msg", "ppt", "pptx"] }
|
2024-10-08 15:11:45 +08:00
|
|
|
validators = "0.21.0"
|
|
|
|
volcengine-python-sdk = {extras = ["ark"], version = "~1.0.98"}
|
2024-06-27 17:52:54 +08:00
|
|
|
websocket-client = "~1.7.0"
|
|
|
|
werkzeug = "~3.0.1"
|
2024-09-22 10:08:35 +08:00
|
|
|
xinference-client = "0.15.2"
|
2024-06-27 17:52:54 +08:00
|
|
|
yarl = "~1.9.4"
|
2024-10-14 10:53:45 +08:00
|
|
|
zhipuai = "~2.1.5"
|
2024-08-19 14:05:41 +08:00
|
|
|
# Before adding new dependency, consider place it in alphabet order (a-z) and suitable group.
|
|
|
|
|
|
|
|
############################################################
|
2024-10-08 15:11:45 +08:00
|
|
|
# [ Indirect ] dependency group
|
2024-09-14 09:45:49 +08:00
|
|
|
# Related transparent dependencies with pinned version
|
2024-08-19 14:05:41 +08:00
|
|
|
# required by main implementations
|
|
|
|
############################################################
|
2024-10-08 15:11:45 +08:00
|
|
|
[tool.poetry.group.indirect.dependencies]
|
2024-08-05 20:21:08 +08:00
|
|
|
kaleido = "0.2.1"
|
2024-08-19 14:05:41 +08:00
|
|
|
rank-bm25 = "~0.2.2"
|
|
|
|
safetensors = "~0.4.3"
|
2024-08-02 21:14:36 +08:00
|
|
|
|
2024-06-27 17:52:54 +08:00
|
|
|
############################################################
|
2024-10-08 15:11:45 +08:00
|
|
|
# [ Tools ] dependency group
|
2024-06-27 17:52:54 +08:00
|
|
|
############################################################
|
2024-10-08 15:11:45 +08:00
|
|
|
[tool.poetry.group.tools.dependencies]
|
2024-06-27 17:52:54 +08:00
|
|
|
arxiv = "2.1.0"
|
2024-08-19 14:05:41 +08:00
|
|
|
cloudscraper = "1.2.71"
|
2024-10-07 22:13:41 +08:00
|
|
|
duckduckgo-search = "~6.3.0"
|
2024-06-28 11:57:32 +08:00
|
|
|
jsonpath-ng = "1.6.1"
|
2024-10-08 15:11:45 +08:00
|
|
|
matplotlib = "~3.8.2"
|
|
|
|
newspaper3k = "0.2.8"
|
2024-10-25 17:15:44 +08:00
|
|
|
nltk = "3.9.1"
|
2024-06-27 17:52:54 +08:00
|
|
|
numexpr = "~2.9.0"
|
2024-10-21 10:43:49 +08:00
|
|
|
pydub = "~0.25.1"
|
2024-06-11 22:21:18 +08:00
|
|
|
qrcode = "~7.4.2"
|
2024-06-27 17:52:54 +08:00
|
|
|
twilio = "~9.0.4"
|
2024-10-10 17:39:26 +08:00
|
|
|
vanna = { version = "0.7.3", extras = ["postgres", "mysql", "clickhouse", "duckdb"] }
|
2024-06-27 17:52:54 +08:00
|
|
|
wikipedia = "1.4.0"
|
|
|
|
yfinance = "~0.2.40"
|
2024-10-08 15:11:45 +08:00
|
|
|
|
2024-06-27 17:52:54 +08:00
|
|
|
############################################################
|
2024-10-08 15:11:45 +08:00
|
|
|
# [ Storage ] dependency group
|
|
|
|
# Required for storage clients
|
2024-06-27 17:52:54 +08:00
|
|
|
############################################################
|
2024-10-08 15:11:45 +08:00
|
|
|
[tool.poetry.group.storage.dependencies]
|
2024-10-09 14:15:27 +08:00
|
|
|
azure-storage-blob = "12.13.0"
|
2024-10-08 15:11:45 +08:00
|
|
|
bce-python-sdk = "~0.9.23"
|
|
|
|
cos-python-sdk-v5 = "1.9.30"
|
|
|
|
esdk-obs-python = "3.24.6.1"
|
|
|
|
google-cloud-storage = "2.16.0"
|
|
|
|
oss2 = "2.18.5"
|
2024-10-11 22:48:57 +08:00
|
|
|
supabase = "~2.8.1"
|
2024-10-08 15:11:45 +08:00
|
|
|
tos = "~2.7.1"
|
2024-06-27 17:52:54 +08:00
|
|
|
|
2024-10-08 15:11:45 +08:00
|
|
|
############################################################
|
|
|
|
# [ VDB ] dependency group
|
|
|
|
# Required by vector store clients
|
|
|
|
############################################################
|
2024-06-27 17:52:54 +08:00
|
|
|
[tool.poetry.group.vdb.dependencies]
|
2024-08-19 14:05:41 +08:00
|
|
|
alibabacloud_gpdb20160503 = "~3.8.0"
|
|
|
|
alibabacloud_tea_openapi = "~0.3.9"
|
2024-07-24 12:50:11 +08:00
|
|
|
chromadb = "0.5.1"
|
2024-08-19 14:05:41 +08:00
|
|
|
clickhouse-connect = "~0.7.16"
|
2024-10-10 16:43:11 +08:00
|
|
|
elasticsearch = "8.14.0"
|
2024-10-12 17:37:01 +08:00
|
|
|
opensearch-py = "2.4.0"
|
2024-06-27 17:52:54 +08:00
|
|
|
oracledb = "~2.2.1"
|
2024-08-02 15:51:23 +08:00
|
|
|
pgvecto-rs = { version = "~0.2.1", extras = ['sqlalchemy'] }
|
2024-06-11 13:11:28 +08:00
|
|
|
pgvector = "0.2.5"
|
2024-07-29 19:56:45 +08:00
|
|
|
pymilvus = "~2.4.4"
|
2024-10-12 23:24:17 +08:00
|
|
|
pymochow = "1.3.1"
|
2024-10-08 15:11:45 +08:00
|
|
|
qdrant-client = "1.7.3"
|
2024-06-27 17:52:54 +08:00
|
|
|
tcvectordb = "1.3.2"
|
2024-06-11 22:21:18 +08:00
|
|
|
tidb-vector = "0.0.9"
|
2024-10-23 09:16:35 +08:00
|
|
|
upstash-vector = "0.6.0"
|
2024-10-13 21:26:05 +08:00
|
|
|
volcengine-compat = "~1.0.156"
|
2024-06-27 17:52:54 +08:00
|
|
|
weaviate-client = "~3.21.0"
|
|
|
|
|
|
|
|
############################################################
|
2024-10-08 15:11:45 +08:00
|
|
|
# [ Dev ] dependency group
|
|
|
|
# Required for development and running tests
|
2024-06-27 17:52:54 +08:00
|
|
|
############################################################
|
2024-06-12 14:43:03 +08:00
|
|
|
[tool.poetry.group.dev]
|
|
|
|
optional = true
|
2024-06-11 13:11:28 +08:00
|
|
|
[tool.poetry.group.dev.dependencies]
|
2024-06-11 22:21:18 +08:00
|
|
|
coverage = "~7.2.4"
|
2024-08-27 19:38:33 +08:00
|
|
|
pytest = "~8.3.2"
|
2024-06-11 22:21:18 +08:00
|
|
|
pytest-benchmark = "~4.0.0"
|
|
|
|
pytest-env = "~1.1.3"
|
|
|
|
pytest-mock = "~3.14.0"
|
2024-06-12 14:43:03 +08:00
|
|
|
|
2024-06-27 17:52:54 +08:00
|
|
|
############################################################
|
2024-10-08 15:11:45 +08:00
|
|
|
# [ Lint ] dependency group
|
|
|
|
# Required for code style linting
|
2024-06-27 17:52:54 +08:00
|
|
|
############################################################
|
2024-06-12 14:43:03 +08:00
|
|
|
[tool.poetry.group.lint]
|
|
|
|
optional = true
|
|
|
|
[tool.poetry.group.lint.dependencies]
|
2024-07-09 23:06:23 +08:00
|
|
|
dotenv-linter = "~0.5.0"
|
2024-10-08 11:13:11 +08:00
|
|
|
ruff = "~0.6.9"
|