pyproject.toml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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. "UP", # pyupgrade rules
  16. "B035", # static-key-dict-comprehension
  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. # "B901", # return-in-generator
  48. "B904", # raise-without-from-inside-except
  49. "B905", # zip-without-explicit-strict
  50. ]
  51. [tool.ruff.lint.per-file-ignores]
  52. "app.py" = [
  53. "F401", # unused-import
  54. "F811", # redefined-while-unused
  55. ]
  56. "__init__.py" = [
  57. "F401", # unused-import
  58. "F811", # redefined-while-unused
  59. ]
  60. "tests/*" = [
  61. "F401", # unused-import
  62. "F811", # redefined-while-unused
  63. ]
  64. [tool.ruff.format]
  65. exclude = [
  66. "core/**/*.py",
  67. "models/**/*.py",
  68. "migrations/**/*",
  69. ]
  70. [tool.pytest_env]
  71. OPENAI_API_KEY = "sk-IamNotARealKeyJustForMockTestKawaiiiiiiiiii"
  72. UPSTAGE_API_KEY = "up-aaaaaaaaaaaaaaaaaaaa"
  73. AZURE_OPENAI_API_BASE = "https://difyai-openai.openai.azure.com"
  74. AZURE_OPENAI_API_KEY = "xxxxb1707exxxxxxxxxxaaxxxxxf94"
  75. ANTHROPIC_API_KEY = "sk-ant-api11-IamNotARealKeyJustForMockTestKawaiiiiiiiiii-NotBaka-ASkksz"
  76. CHATGLM_API_BASE = "http://a.abc.com:11451"
  77. XINFERENCE_SERVER_URL = "http://a.abc.com:11451"
  78. XINFERENCE_GENERATION_MODEL_UID = "generate"
  79. XINFERENCE_CHAT_MODEL_UID = "chat"
  80. XINFERENCE_EMBEDDINGS_MODEL_UID = "embedding"
  81. XINFERENCE_RERANK_MODEL_UID = "rerank"
  82. GOOGLE_API_KEY = "abcdefghijklmnopqrstuvwxyz"
  83. HUGGINGFACE_API_KEY = "hf-awuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwu"
  84. HUGGINGFACE_TEXT_GEN_ENDPOINT_URL = "a"
  85. HUGGINGFACE_TEXT2TEXT_GEN_ENDPOINT_URL = "b"
  86. HUGGINGFACE_EMBEDDINGS_ENDPOINT_URL = "c"
  87. MOCK_SWITCH = "true"
  88. CODE_MAX_STRING_LENGTH = "80000"
  89. CODE_EXECUTION_ENDPOINT = "http://127.0.0.1:8194"
  90. CODE_EXECUTION_API_KEY = "dify-sandbox"
  91. FIRECRAWL_API_KEY = "fc-"
  92. TEI_EMBEDDING_SERVER_URL = "http://a.abc.com:11451"
  93. TEI_RERANK_SERVER_URL = "http://a.abc.com:11451"
  94. [tool.poetry]
  95. name = "dify-api"
  96. package-mode = false
  97. ############################################################
  98. # Main dependencies
  99. ############################################################
  100. [tool.poetry.dependencies]
  101. anthropic = "~0.23.1"
  102. authlib = "1.3.1"
  103. azure-identity = "1.16.1"
  104. azure-storage-blob = "12.13.0"
  105. beautifulsoup4 = "4.12.2"
  106. boto3 = "1.34.148"
  107. sagemaker = "2.231.0"
  108. bs4 = "~0.0.1"
  109. cachetools = "~5.3.0"
  110. celery = "~5.3.6"
  111. chardet = "~5.1.0"
  112. cohere = "~5.2.4"
  113. cos-python-sdk-v5 = "1.9.30"
  114. esdk-obs-python = "3.24.6.1"
  115. dashscope = { version = "~1.17.0", extras = ["tokenizer"] }
  116. flask = "~3.0.1"
  117. flask-compress = "~1.14"
  118. flask-cors = "~4.0.0"
  119. flask-login = "~0.6.3"
  120. flask-migrate = "~4.0.5"
  121. flask-restful = "~0.3.10"
  122. Flask-SQLAlchemy = "~3.1.1"
  123. gevent = "~23.9.1"
  124. gmpy2 = "~2.2.1"
  125. google-ai-generativelanguage = "0.6.1"
  126. google-api-core = "2.18.0"
  127. google-api-python-client = "2.90.0"
  128. google-auth = "2.29.0"
  129. google-auth-httplib2 = "0.2.0"
  130. google-cloud-aiplatform = "1.49.0"
  131. google-cloud-storage = "2.16.0"
  132. google-generativeai = "0.5.0"
  133. googleapis-common-protos = "1.63.0"
  134. gunicorn = "~22.0.0"
  135. httpx = { version = "~0.27.0", extras = ["socks"] }
  136. huggingface-hub = "~0.16.4"
  137. jieba = "0.42.1"
  138. langfuse = "^2.36.1"
  139. langsmith = "^0.1.77"
  140. mailchimp-transactional = "~1.0.50"
  141. markdown = "~3.5.1"
  142. novita-client = "^0.5.7"
  143. numpy = "~1.26.4"
  144. openai = "~1.29.0"
  145. openpyxl = "~3.1.5"
  146. oss2 = "2.18.5"
  147. pandas = { version = "~2.2.2", extras = ["performance", "excel"] }
  148. psycopg2-binary = "~2.9.6"
  149. pycryptodome = "3.19.1"
  150. pydantic = "~2.8.2"
  151. pydantic-settings = "~2.4.0"
  152. pydantic_extra_types = "~2.9.0"
  153. pyjwt = "~2.8.0"
  154. pypdfium2 = "~4.17.0"
  155. python = ">=3.10,<3.13"
  156. python-docx = "~1.1.0"
  157. python-dotenv = "1.0.0"
  158. pyyaml = "~6.0.1"
  159. readabilipy = "0.2.0"
  160. redis = { version = "~5.0.3", extras = ["hiredis"] }
  161. replicate = "~0.22.0"
  162. resend = "~0.7.0"
  163. scikit-learn = "^1.5.1"
  164. sentry-sdk = { version = "~1.44.1", extras = ["flask"] }
  165. sqlalchemy = "~2.0.29"
  166. tencentcloud-sdk-python-hunyuan = "~3.0.1158"
  167. tiktoken = "~0.7.0"
  168. tokenizers = "~0.15.0"
  169. transformers = "~4.35.0"
  170. unstructured = { version = "~0.10.27", extras = ["docx", "epub", "md", "msg", "ppt", "pptx"] }
  171. websocket-client = "~1.7.0"
  172. werkzeug = "~3.0.1"
  173. xinference-client = "0.13.3"
  174. yarl = "~1.9.4"
  175. zhipuai = "1.0.7"
  176. # Before adding new dependency, consider place it in alphabet order (a-z) and suitable group.
  177. ############################################################
  178. # Related transparent dependencies with pinned verion
  179. # required by main implementations
  180. ############################################################
  181. azure-ai-ml = "^1.19.0"
  182. azure-ai-inference = "^1.0.0b3"
  183. volcengine-python-sdk = {extras = ["ark"], version = "^1.0.98"}
  184. oci = "^2.133.0"
  185. [tool.poetry.group.indriect.dependencies]
  186. kaleido = "0.2.1"
  187. rank-bm25 = "~0.2.2"
  188. safetensors = "~0.4.3"
  189. ############################################################
  190. # Tool dependencies required by tool implementations
  191. ############################################################
  192. [tool.poetry.group.tool.dependencies]
  193. arxiv = "2.1.0"
  194. cloudscraper = "1.2.71"
  195. matplotlib = "~3.8.2"
  196. newspaper3k = "0.2.8"
  197. duckduckgo-search = "^6.2.6"
  198. jsonpath-ng = "1.6.1"
  199. numexpr = "~2.9.0"
  200. opensearch-py = "2.4.0"
  201. qrcode = "~7.4.2"
  202. twilio = "~9.0.4"
  203. vanna = { version = "0.5.5", extras = ["postgres", "mysql", "clickhouse", "duckdb"] }
  204. wikipedia = "1.4.0"
  205. yfinance = "~0.2.40"
  206. nltk = "3.8.1"
  207. ############################################################
  208. # VDB dependencies required by vector store clients
  209. ############################################################
  210. [tool.poetry.group.vdb.dependencies]
  211. alibabacloud_gpdb20160503 = "~3.8.0"
  212. alibabacloud_tea_openapi = "~0.3.9"
  213. chromadb = "0.5.1"
  214. clickhouse-connect = "~0.7.16"
  215. elasticsearch = "8.14.0"
  216. oracledb = "~2.2.1"
  217. pgvecto-rs = { version = "~0.2.1", extras = ['sqlalchemy'] }
  218. pgvector = "0.2.5"
  219. pymilvus = "~2.4.4"
  220. tcvectordb = "1.3.2"
  221. tidb-vector = "0.0.9"
  222. qdrant-client = "1.7.3"
  223. weaviate-client = "~3.21.0"
  224. ############################################################
  225. # Dev dependencies for running tests
  226. ############################################################
  227. [tool.poetry.group.dev]
  228. optional = true
  229. [tool.poetry.group.dev.dependencies]
  230. coverage = "~7.2.4"
  231. pytest = "~8.3.2"
  232. pytest-benchmark = "~4.0.0"
  233. pytest-env = "~1.1.3"
  234. pytest-mock = "~3.14.0"
  235. ############################################################
  236. # Lint dependencies for code style linting
  237. ############################################################
  238. [tool.poetry.group.lint]
  239. optional = true
  240. [tool.poetry.group.lint.dependencies]
  241. dotenv-linter = "~0.5.0"
  242. ruff = "~0.6.1"