pyproject.toml 7.0 KB

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