mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
263 lines
7.5 KiB
TOML
263 lines
7.5 KiB
TOML
[project]
|
|
requires-python = ">=3.10,<3.13"
|
|
|
|
[build-system]
|
|
requires = ["poetry-core"]
|
|
build-backend = "poetry.core.masonry.api"
|
|
|
|
[tool.ruff]
|
|
exclude = [
|
|
]
|
|
line-length = 120
|
|
|
|
[tool.ruff.lint]
|
|
preview = true
|
|
select = [
|
|
"B", # flake8-bugbear rules
|
|
"C4", # flake8-comprehensions
|
|
"F", # pyflakes rules
|
|
"I", # isort rules
|
|
"UP", # pyupgrade rules
|
|
"B035", # static-key-dict-comprehension
|
|
"E101", # mixed-spaces-and-tabs
|
|
"E111", # indentation-with-invalid-multiple
|
|
"E112", # no-indented-block
|
|
"E113", # unexpected-indentation
|
|
"E115", # no-indented-block-comment
|
|
"E116", # unexpected-indentation-comment
|
|
"E117", # over-indented
|
|
"RUF019", # unnecessary-key-check
|
|
"RUF100", # unused-noqa
|
|
"RUF101", # redirected-noqa
|
|
"S506", # unsafe-yaml-load
|
|
"SIM116", # if-else-block-instead-of-dict-lookup
|
|
"SIM401", # if-else-block-instead-of-dict-get
|
|
"SIM910", # dict-get-with-none-default
|
|
"W191", # tab-indentation
|
|
"W605", # invalid-escape-sequence
|
|
"F601", # multi-value-repeated-key-literal
|
|
"F602", # multi-value-repeated-key-variable
|
|
]
|
|
ignore = [
|
|
"F403", # undefined-local-with-import-star
|
|
"F405", # undefined-local-with-import-star-usage
|
|
"F821", # undefined-name
|
|
"F841", # unused-variable
|
|
"UP007", # non-pep604-annotation
|
|
"UP032", # f-string
|
|
"B005", # strip-with-multi-characters
|
|
"B006", # mutable-argument-default
|
|
"B007", # unused-loop-control-variable
|
|
"B026", # star-arg-unpacking-after-keyword-arg
|
|
# "B901", # return-in-generator
|
|
"B904", # raise-without-from-inside-except
|
|
"B905", # zip-without-explicit-strict
|
|
]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
"app.py" = [
|
|
"F401", # unused-import
|
|
"F811", # redefined-while-unused
|
|
]
|
|
"__init__.py" = [
|
|
"F401", # unused-import
|
|
"F811", # redefined-while-unused
|
|
]
|
|
"tests/*" = [
|
|
"F401", # unused-import
|
|
"F811", # redefined-while-unused
|
|
]
|
|
|
|
[tool.ruff.format]
|
|
exclude = [
|
|
"core/**/*.py",
|
|
"controllers/**/*.py",
|
|
"models/**/*.py",
|
|
"migrations/**/*",
|
|
"services/**/*.py",
|
|
"tasks/**/*.py",
|
|
"tests/**/*.py",
|
|
"configs/**/*.py",
|
|
]
|
|
|
|
[tool.pytest_env]
|
|
OPENAI_API_KEY = "sk-IamNotARealKeyJustForMockTestKawaiiiiiiiiii"
|
|
UPSTAGE_API_KEY = "up-aaaaaaaaaaaaaaaaaaaa"
|
|
AZURE_OPENAI_API_BASE = "https://difyai-openai.openai.azure.com"
|
|
AZURE_OPENAI_API_KEY = "xxxxb1707exxxxxxxxxxaaxxxxxf94"
|
|
ANTHROPIC_API_KEY = "sk-ant-api11-IamNotARealKeyJustForMockTestKawaiiiiiiiiii-NotBaka-ASkksz"
|
|
CHATGLM_API_BASE = "http://a.abc.com:11451"
|
|
XINFERENCE_SERVER_URL = "http://a.abc.com:11451"
|
|
XINFERENCE_GENERATION_MODEL_UID = "generate"
|
|
XINFERENCE_CHAT_MODEL_UID = "chat"
|
|
XINFERENCE_EMBEDDINGS_MODEL_UID = "embedding"
|
|
XINFERENCE_RERANK_MODEL_UID = "rerank"
|
|
GOOGLE_API_KEY = "abcdefghijklmnopqrstuvwxyz"
|
|
HUGGINGFACE_API_KEY = "hf-awuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwu"
|
|
HUGGINGFACE_TEXT_GEN_ENDPOINT_URL = "a"
|
|
HUGGINGFACE_TEXT2TEXT_GEN_ENDPOINT_URL = "b"
|
|
HUGGINGFACE_EMBEDDINGS_ENDPOINT_URL = "c"
|
|
MOCK_SWITCH = "true"
|
|
CODE_MAX_STRING_LENGTH = "80000"
|
|
CODE_EXECUTION_ENDPOINT = "http://127.0.0.1:8194"
|
|
CODE_EXECUTION_API_KEY = "dify-sandbox"
|
|
FIRECRAWL_API_KEY = "fc-"
|
|
TEI_EMBEDDING_SERVER_URL = "http://a.abc.com:11451"
|
|
TEI_RERANK_SERVER_URL = "http://a.abc.com:11451"
|
|
|
|
[tool.poetry]
|
|
name = "dify-api"
|
|
package-mode = false
|
|
|
|
############################################################
|
|
# Main dependencies
|
|
############################################################
|
|
|
|
[tool.poetry.dependencies]
|
|
anthropic = "~0.23.1"
|
|
authlib = "1.3.1"
|
|
azure-identity = "1.16.1"
|
|
azure-storage-blob = "12.13.0"
|
|
beautifulsoup4 = "4.12.2"
|
|
boto3 = "1.34.148"
|
|
bs4 = "~0.0.1"
|
|
cachetools = "~5.3.0"
|
|
celery = "~5.3.6"
|
|
chardet = "~5.1.0"
|
|
cohere = "~5.2.4"
|
|
cos-python-sdk-v5 = "1.9.30"
|
|
dashscope = { version = "~1.17.0", extras = ["tokenizer"] }
|
|
flask = "~3.0.1"
|
|
flask-compress = "~1.14"
|
|
flask-cors = "~4.0.0"
|
|
flask-login = "~0.6.3"
|
|
flask-migrate = "~4.0.5"
|
|
flask-restful = "~0.3.10"
|
|
Flask-SQLAlchemy = "~3.1.1"
|
|
gevent = "~23.9.1"
|
|
gmpy2 = "~2.2.1"
|
|
google-ai-generativelanguage = "0.6.1"
|
|
google-api-core = "2.18.0"
|
|
google-api-python-client = "2.90.0"
|
|
google-auth = "2.29.0"
|
|
google-auth-httplib2 = "0.2.0"
|
|
google-cloud-aiplatform = "1.49.0"
|
|
google-cloud-storage = "2.16.0"
|
|
google-generativeai = "0.5.0"
|
|
googleapis-common-protos = "1.63.0"
|
|
gunicorn = "~22.0.0"
|
|
httpx = { version = "~0.27.0", extras = ["socks"] }
|
|
huggingface-hub = "~0.16.4"
|
|
jieba = "0.42.1"
|
|
langfuse = "^2.36.1"
|
|
langsmith = "^0.1.77"
|
|
mailchimp-transactional = "~1.0.50"
|
|
markdown = "~3.5.1"
|
|
novita-client = "^0.5.7"
|
|
numpy = "~1.26.4"
|
|
openai = "~1.29.0"
|
|
openpyxl = "~3.1.5"
|
|
oss2 = "2.18.5"
|
|
pandas = { version = "~2.2.2", extras = ["performance", "excel"] }
|
|
psycopg2-binary = "~2.9.6"
|
|
pycryptodome = "3.19.1"
|
|
pydantic = "~2.8.2"
|
|
pydantic-settings = "~2.3.4"
|
|
pydantic_extra_types = "~2.9.0"
|
|
pyjwt = "~2.8.0"
|
|
pypdfium2 = "~4.17.0"
|
|
python = ">=3.10,<3.13"
|
|
python-docx = "~1.1.0"
|
|
python-dotenv = "1.0.0"
|
|
pyyaml = "~6.0.1"
|
|
readabilipy = "0.2.0"
|
|
redis = { version = "~5.0.3", extras = ["hiredis"] }
|
|
replicate = "~0.22.0"
|
|
resend = "~0.7.0"
|
|
scikit-learn = "^1.5.1"
|
|
sentry-sdk = { version = "~1.44.1", extras = ["flask"] }
|
|
sqlalchemy = "~2.0.29"
|
|
tencentcloud-sdk-python-hunyuan = "~3.0.1158"
|
|
tiktoken = "~0.7.0"
|
|
tokenizers = "~0.15.0"
|
|
transformers = "~4.35.0"
|
|
unstructured = { version = "~0.10.27", extras = ["docx", "epub", "md", "msg", "ppt", "pptx"] }
|
|
websocket-client = "~1.7.0"
|
|
werkzeug = "~3.0.1"
|
|
xinference-client = "0.13.3"
|
|
yarl = "~1.9.4"
|
|
zhipuai = "1.0.7"
|
|
# Before adding new dependency, consider place it in alphabet order (a-z) and suitable group.
|
|
|
|
############################################################
|
|
# Related transparent dependencies with pinned verion
|
|
# required by main implementations
|
|
############################################################
|
|
[tool.poetry.group.indriect.dependencies]
|
|
kaleido = "0.2.1"
|
|
rank-bm25 = "~0.2.2"
|
|
safetensors = "~0.4.3"
|
|
|
|
############################################################
|
|
# Tool dependencies required by tool implementations
|
|
############################################################
|
|
|
|
[tool.poetry.group.tool.dependencies]
|
|
arxiv = "2.1.0"
|
|
cloudscraper = "1.2.71"
|
|
matplotlib = "~3.8.2"
|
|
newspaper3k = "0.2.8"
|
|
duckduckgo-search = "^6.2.6"
|
|
jsonpath-ng = "1.6.1"
|
|
numexpr = "~2.9.0"
|
|
opensearch-py = "2.4.0"
|
|
qrcode = "~7.4.2"
|
|
twilio = "~9.0.4"
|
|
vanna = { version = "0.5.5", extras = ["postgres", "mysql", "clickhouse", "duckdb"] }
|
|
wikipedia = "1.4.0"
|
|
yfinance = "~0.2.40"
|
|
nltk = "3.8.1"
|
|
############################################################
|
|
# VDB dependencies required by vector store clients
|
|
############################################################
|
|
|
|
[tool.poetry.group.vdb.dependencies]
|
|
alibabacloud_gpdb20160503 = "~3.8.0"
|
|
alibabacloud_tea_openapi = "~0.3.9"
|
|
chromadb = "0.5.1"
|
|
clickhouse-connect = "~0.7.16"
|
|
elasticsearch = "8.14.0"
|
|
oracledb = "~2.2.1"
|
|
pgvecto-rs = { version = "~0.2.1", extras = ['sqlalchemy'] }
|
|
pgvector = "0.2.5"
|
|
pymilvus = "~2.4.4"
|
|
tcvectordb = "1.3.2"
|
|
tidb-vector = "0.0.9"
|
|
qdrant-client = "1.7.3"
|
|
weaviate-client = "~3.21.0"
|
|
|
|
############################################################
|
|
# Dev dependencies for running tests
|
|
############################################################
|
|
|
|
[tool.poetry.group.dev]
|
|
optional = true
|
|
|
|
[tool.poetry.group.dev.dependencies]
|
|
coverage = "~7.2.4"
|
|
pytest = "~8.1.1"
|
|
pytest-benchmark = "~4.0.0"
|
|
pytest-env = "~1.1.3"
|
|
pytest-mock = "~3.14.0"
|
|
|
|
############################################################
|
|
# Lint dependencies for code style linting
|
|
############################################################
|
|
|
|
[tool.poetry.group.lint]
|
|
optional = true
|
|
|
|
[tool.poetry.group.lint.dependencies]
|
|
dotenv-linter = "~0.5.0"
|
|
ruff = "~0.6.1"
|