pyproject.toml 8.0 KB

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