pyproject.toml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. [project]
  2. requires-python = ">=3.10,<3.13"
  3. [build-system]
  4. requires = ["poetry-core"]
  5. build-backend = "poetry.core.masonry.api"
  6. [tool.ruff]
  7. line-length = 120
  8. [tool.ruff.lint]
  9. preview = true
  10. select = [
  11. "B", # flake8-bugbear rules
  12. "C4", # flake8-comprehensions
  13. "F", # pyflakes rules
  14. "I", # isort rules
  15. "N", # pep8-naming
  16. "UP", # pyupgrade rules
  17. "E101", # mixed-spaces-and-tabs
  18. "E111", # indentation-with-invalid-multiple
  19. "E112", # no-indented-block
  20. "E113", # unexpected-indentation
  21. "E115", # no-indented-block-comment
  22. "E116", # unexpected-indentation-comment
  23. "E117", # over-indented
  24. "RUF019", # unnecessary-key-check
  25. "RUF100", # unused-noqa
  26. "RUF101", # redirected-noqa
  27. "S506", # unsafe-yaml-load
  28. "SIM116", # if-else-block-instead-of-dict-lookup
  29. "SIM401", # if-else-block-instead-of-dict-get
  30. "SIM910", # dict-get-with-none-default
  31. "W191", # tab-indentation
  32. "W605", # invalid-escape-sequence
  33. "F601", # multi-value-repeated-key-literal
  34. "F602", # multi-value-repeated-key-variable
  35. ]
  36. ignore = [
  37. "F403", # undefined-local-with-import-star
  38. "F405", # undefined-local-with-import-star-usage
  39. "F821", # undefined-name
  40. "F841", # unused-variable
  41. "UP007", # non-pep604-annotation
  42. "UP032", # f-string
  43. "B005", # strip-with-multi-characters
  44. "B006", # mutable-argument-default
  45. "B007", # unused-loop-control-variable
  46. "B026", # star-arg-unpacking-after-keyword-arg
  47. "B904", # raise-without-from-inside-except
  48. "B905", # zip-without-explicit-strict
  49. "N806", # non-lowercase-variable-in-function
  50. "N815", # mixed-case-variable-in-class-scope
  51. ]
  52. [tool.ruff.lint.per-file-ignores]
  53. "app.py" = [
  54. "F401", # unused-import
  55. "F811", # redefined-while-unused
  56. ]
  57. "__init__.py" = [
  58. "F401", # unused-import
  59. "F811", # redefined-while-unused
  60. ]
  61. "tests/*" = [
  62. "F401", # unused-import
  63. "F811", # redefined-while-unused
  64. ]
  65. "configs/*" = [
  66. "N802", # invalid-function-name
  67. ]
  68. "libs/gmpy2_pkcs10aep_cipher.py" = [
  69. "N803", # invalid-argument-name
  70. ]
  71. [tool.ruff.format]
  72. exclude = [
  73. "migrations/**/*",
  74. ]
  75. [tool.pytest_env]
  76. OPENAI_API_KEY = "sk-IamNotARealKeyJustForMockTestKawaiiiiiiiiii"
  77. UPSTAGE_API_KEY = "up-aaaaaaaaaaaaaaaaaaaa"
  78. AZURE_OPENAI_API_BASE = "https://difyai-openai.openai.azure.com"
  79. AZURE_OPENAI_API_KEY = "xxxxb1707exxxxxxxxxxaaxxxxxf94"
  80. ANTHROPIC_API_KEY = "sk-ant-api11-IamNotARealKeyJustForMockTestKawaiiiiiiiiii-NotBaka-ASkksz"
  81. CHATGLM_API_BASE = "http://a.abc.com:11451"
  82. XINFERENCE_SERVER_URL = "http://a.abc.com:11451"
  83. XINFERENCE_GENERATION_MODEL_UID = "generate"
  84. XINFERENCE_CHAT_MODEL_UID = "chat"
  85. XINFERENCE_EMBEDDINGS_MODEL_UID = "embedding"
  86. XINFERENCE_RERANK_MODEL_UID = "rerank"
  87. GOOGLE_API_KEY = "abcdefghijklmnopqrstuvwxyz"
  88. HUGGINGFACE_API_KEY = "hf-awuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwu"
  89. HUGGINGFACE_TEXT_GEN_ENDPOINT_URL = "a"
  90. HUGGINGFACE_TEXT2TEXT_GEN_ENDPOINT_URL = "b"
  91. HUGGINGFACE_EMBEDDINGS_ENDPOINT_URL = "c"
  92. MOCK_SWITCH = "true"
  93. CODE_MAX_STRING_LENGTH = "80000"
  94. CODE_EXECUTION_ENDPOINT = "http://127.0.0.1:8194"
  95. CODE_EXECUTION_API_KEY = "dify-sandbox"
  96. FIRECRAWL_API_KEY = "fc-"
  97. TEI_EMBEDDING_SERVER_URL = "http://a.abc.com:11451"
  98. TEI_RERANK_SERVER_URL = "http://a.abc.com:11451"
  99. [tool.poetry]
  100. name = "dify-api"
  101. package-mode = false
  102. ############################################################
  103. # Main dependencies
  104. ############################################################
  105. [tool.poetry.dependencies]
  106. anthropic = "~0.23.1"
  107. authlib = "1.3.1"
  108. azure-identity = "1.16.1"
  109. azure-storage-blob = "12.13.0"
  110. beautifulsoup4 = "4.12.2"
  111. boto3 = "1.34.148"
  112. sagemaker = "2.231.0"
  113. bs4 = "~0.0.1"
  114. cachetools = "~5.3.0"
  115. celery = "~5.3.6"
  116. chardet = "~5.1.0"
  117. cohere = "~5.2.4"
  118. cos-python-sdk-v5 = "1.9.30"
  119. esdk-obs-python = "3.24.6.1"
  120. dashscope = { version = "~1.17.0", extras = ["tokenizer"] }
  121. flask = "~3.0.1"
  122. flask-compress = "~1.14"
  123. flask-cors = "~4.0.0"
  124. flask-login = "~0.6.3"
  125. flask-migrate = "~4.0.5"
  126. flask-restful = "~0.3.10"
  127. Flask-SQLAlchemy = "~3.1.1"
  128. gevent = "~23.9.1"
  129. gmpy2 = "~2.2.1"
  130. google-ai-generativelanguage = "0.6.1"
  131. google-api-core = "2.18.0"
  132. google-api-python-client = "2.90.0"
  133. google-auth = "2.29.0"
  134. google-auth-httplib2 = "0.2.0"
  135. google-cloud-aiplatform = "1.49.0"
  136. google-cloud-storage = "2.16.0"
  137. google-generativeai = "0.5.0"
  138. googleapis-common-protos = "1.63.0"
  139. gunicorn = "~22.0.0"
  140. httpx = { version = "~0.27.0", extras = ["socks"] }
  141. huggingface-hub = "~0.16.4"
  142. jieba = "0.42.1"
  143. langfuse = "^2.36.1"
  144. langsmith = "^0.1.77"
  145. mailchimp-transactional = "~1.0.50"
  146. markdown = "~3.5.1"
  147. novita-client = "^0.5.7"
  148. numpy = "~1.26.4"
  149. openai = "~1.29.0"
  150. openpyxl = "~3.1.5"
  151. oss2 = "2.18.5"
  152. pandas = { version = "~2.2.2", extras = ["performance", "excel"] }
  153. psycopg2-binary = "~2.9.6"
  154. pycryptodome = "3.19.1"
  155. pydantic = "~2.8.2"
  156. pydantic-settings = "~2.4.0"
  157. pydantic_extra_types = "~2.9.0"
  158. pyjwt = "~2.8.0"
  159. pypdfium2 = "~4.17.0"
  160. python = ">=3.10,<3.13"
  161. python-docx = "~1.1.0"
  162. python-dotenv = "1.0.0"
  163. pyyaml = "~6.0.1"
  164. readabilipy = "0.2.0"
  165. redis = { version = "~5.0.3", extras = ["hiredis"] }
  166. replicate = "~0.22.0"
  167. resend = "~0.7.0"
  168. scikit-learn = "^1.5.1"
  169. sentry-sdk = { version = "~1.44.1", extras = ["flask"] }
  170. sqlalchemy = "~2.0.29"
  171. tencentcloud-sdk-python-hunyuan = "~3.0.1158"
  172. tiktoken = "~0.7.0"
  173. tokenizers = "~0.15.0"
  174. transformers = "~4.35.0"
  175. unstructured = { version = "~0.10.27", extras = ["docx", "epub", "md", "msg", "ppt", "pptx"] }
  176. websocket-client = "~1.7.0"
  177. werkzeug = "~3.0.1"
  178. xinference-client = "0.13.3"
  179. yarl = "~1.9.4"
  180. zhipuai = "1.0.7"
  181. # Before adding new dependency, consider place it in alphabet order (a-z) and suitable group.
  182. ############################################################
  183. # Related transparent dependencies with pinned verion
  184. # required by main implementations
  185. ############################################################
  186. azure-ai-ml = "^1.19.0"
  187. azure-ai-inference = "^1.0.0b3"
  188. volcengine-python-sdk = {extras = ["ark"], version = "^1.0.98"}
  189. oci = "^2.133.0"
  190. tos = "^2.7.1"
  191. [tool.poetry.group.indriect.dependencies]
  192. kaleido = "0.2.1"
  193. rank-bm25 = "~0.2.2"
  194. safetensors = "~0.4.3"
  195. ############################################################
  196. # Tool dependencies required by tool implementations
  197. ############################################################
  198. [tool.poetry.group.tool.dependencies]
  199. arxiv = "2.1.0"
  200. cloudscraper = "1.2.71"
  201. matplotlib = "~3.8.2"
  202. newspaper3k = "0.2.8"
  203. duckduckgo-search = "^6.2.6"
  204. jsonpath-ng = "1.6.1"
  205. numexpr = "~2.9.0"
  206. opensearch-py = "2.4.0"
  207. qrcode = "~7.4.2"
  208. twilio = "~9.0.4"
  209. vanna = { version = "0.5.5", extras = ["postgres", "mysql", "clickhouse", "duckdb"] }
  210. wikipedia = "1.4.0"
  211. yfinance = "~0.2.40"
  212. nltk = "3.8.1"
  213. ############################################################
  214. # VDB dependencies required by vector store clients
  215. ############################################################
  216. [tool.poetry.group.vdb.dependencies]
  217. alibabacloud_gpdb20160503 = "~3.8.0"
  218. alibabacloud_tea_openapi = "~0.3.9"
  219. chromadb = "0.5.1"
  220. clickhouse-connect = "~0.7.16"
  221. elasticsearch = "8.14.0"
  222. oracledb = "~2.2.1"
  223. pgvecto-rs = { version = "~0.2.1", extras = ['sqlalchemy'] }
  224. pgvector = "0.2.5"
  225. pymilvus = "~2.4.4"
  226. tcvectordb = "1.3.2"
  227. tidb-vector = "0.0.9"
  228. qdrant-client = "1.7.3"
  229. weaviate-client = "~3.21.0"
  230. ############################################################
  231. # Dev dependencies for running tests
  232. ############################################################
  233. [tool.poetry.group.dev]
  234. optional = true
  235. [tool.poetry.group.dev.dependencies]
  236. coverage = "~7.2.4"
  237. pytest = "~8.3.2"
  238. pytest-benchmark = "~4.0.0"
  239. pytest-env = "~1.1.3"
  240. pytest-mock = "~3.14.0"
  241. ############################################################
  242. # Lint dependencies for code style linting
  243. ############################################################
  244. [tool.poetry.group.lint]
  245. optional = true
  246. [tool.poetry.group.lint.dependencies]
  247. dotenv-linter = "~0.5.0"
  248. ruff = "~0.6.1"