pyproject.toml 8.2 KB

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