pyproject.toml 7.8 KB

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