pyproject.toml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. "F", # pyflakes rules
  15. "I", # isort rules
  16. "UP", # pyupgrade rules
  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. "W191", # tab-indentation
  29. "W605", # invalid-escape-sequence
  30. ]
  31. ignore = [
  32. "F403", # undefined-local-with-import-star
  33. "F405", # undefined-local-with-import-star-usage
  34. "F821", # undefined-name
  35. "F841", # unused-variable
  36. "UP007", # non-pep604-annotation
  37. "UP032", # f-string
  38. "B005", # strip-with-multi-characters
  39. "B006", # mutable-argument-default
  40. "B007", # unused-loop-control-variable
  41. "B026", # star-arg-unpacking-after-keyword-arg
  42. "B901", # return-in-generator
  43. "B904", # raise-without-from-inside-except
  44. "B905", # zip-without-explicit-strict
  45. ]
  46. [tool.ruff.lint.per-file-ignores]
  47. "app.py" = [
  48. "F401", # unused-import
  49. "F811", # redefined-while-unused
  50. ]
  51. "__init__.py" = [
  52. "F401", # unused-import
  53. "F811", # redefined-while-unused
  54. ]
  55. "tests/*" = [
  56. "F401", # unused-import
  57. "F811", # redefined-while-unused
  58. ]
  59. [tool.pytest_env]
  60. OPENAI_API_KEY = "sk-IamNotARealKeyJustForMockTestKawaiiiiiiiiii"
  61. AZURE_OPENAI_API_BASE = "https://difyai-openai.openai.azure.com"
  62. AZURE_OPENAI_API_KEY = "xxxxb1707exxxxxxxxxxaaxxxxxf94"
  63. ANTHROPIC_API_KEY = "sk-ant-api11-IamNotARealKeyJustForMockTestKawaiiiiiiiiii-NotBaka-ASkksz"
  64. CHATGLM_API_BASE = "http://a.abc.com:11451"
  65. XINFERENCE_SERVER_URL = "http://a.abc.com:11451"
  66. XINFERENCE_GENERATION_MODEL_UID = "generate"
  67. XINFERENCE_CHAT_MODEL_UID = "chat"
  68. XINFERENCE_EMBEDDINGS_MODEL_UID = "embedding"
  69. XINFERENCE_RERANK_MODEL_UID = "rerank"
  70. GOOGLE_API_KEY = "abcdefghijklmnopqrstuvwxyz"
  71. HUGGINGFACE_API_KEY = "hf-awuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwu"
  72. HUGGINGFACE_TEXT_GEN_ENDPOINT_URL = "a"
  73. HUGGINGFACE_TEXT2TEXT_GEN_ENDPOINT_URL = "b"
  74. HUGGINGFACE_EMBEDDINGS_ENDPOINT_URL = "c"
  75. MOCK_SWITCH = "true"
  76. CODE_MAX_STRING_LENGTH = "80000"
  77. CODE_EXECUTION_ENDPOINT="http://127.0.0.1:8194"
  78. CODE_EXECUTION_API_KEY="dify-sandbox"
  79. FIRECRAWL_API_KEY = "fc-"
  80. [tool.poetry]
  81. name = "dify-api"
  82. package-mode = false
  83. [tool.poetry.dependencies]
  84. python = "^3.10"
  85. beautifulsoup4 = "4.12.2"
  86. flask = "~3.0.1"
  87. flask-sqlalchemy = "~3.0.5"
  88. sqlalchemy = "~2.0.29"
  89. flask-compress = "~1.14"
  90. flask-login = "~0.6.3"
  91. flask-migrate = "~4.0.5"
  92. flask-restful = "~0.3.10"
  93. flask-cors = "~4.0.0"
  94. gunicorn = "~22.0.0"
  95. gevent = "~23.9.1"
  96. openai = "~1.29.0"
  97. tiktoken = "~0.7.0"
  98. psycopg2-binary = "~2.9.6"
  99. pycryptodome = "3.19.1"
  100. python-dotenv = "1.0.0"
  101. authlib = "1.3.1"
  102. boto3 = "1.28.17"
  103. cachetools = "~5.3.0"
  104. weaviate-client = "~3.21.0"
  105. mailchimp-transactional = "~1.0.50"
  106. scikit-learn = "1.2.2"
  107. sentry-sdk = {version = "~1.39.2", extras = ["flask"]}
  108. sympy = "1.12"
  109. jieba = "0.42.1"
  110. celery = "~5.3.6"
  111. redis = {version = "~5.0.3", extras = ["hiredis"]}
  112. chardet = "~5.1.0"
  113. python-docx = "~1.1.0"
  114. pypdfium2 = "~4.17.0"
  115. resend = "~0.7.0"
  116. pyjwt = "~2.8.0"
  117. anthropic = "~0.23.1"
  118. newspaper3k = "0.2.8"
  119. wikipedia = "1.4.0"
  120. readabilipy = "0.2.0"
  121. google-ai-generativelanguage = "0.6.1"
  122. google-api-core = "2.18.0"
  123. google-api-python-client = "2.90.0"
  124. google-auth = "2.29.0"
  125. google-auth-httplib2 = "0.2.0"
  126. google-generativeai = "0.5.0"
  127. googleapis-common-protos = "1.63.0"
  128. google-cloud-storage = "2.16.0"
  129. replicate = "~0.22.0"
  130. websocket-client = "~1.7.0"
  131. dashscope = {version = "~1.17.0", extras = ["tokenizer"]}
  132. huggingface-hub = "~0.16.4"
  133. transformers = "~4.35.0"
  134. tokenizers = "~0.15.0"
  135. pandas = { version = "~2.2.2", extras = ["performance", "excel"] }
  136. xinference-client = "0.9.4"
  137. safetensors = "~0.4.3"
  138. zhipuai = "1.0.7"
  139. werkzeug = "~3.0.1"
  140. pymilvus = "2.3.1"
  141. qdrant-client = "1.7.3"
  142. cohere = "~5.2.4"
  143. pyyaml = "~6.0.1"
  144. numpy = "~1.26.4"
  145. unstructured = {version = "~0.10.27", extras = ["docx", "epub", "md", "msg", "ppt", "pptx"]}
  146. bs4 = "~0.0.1"
  147. markdown = "~3.5.1"
  148. httpx = {version = "~0.27.0", extras = ["socks"]}
  149. matplotlib = "~3.8.2"
  150. yfinance = "~0.2.40"
  151. pydub = "~0.25.1"
  152. gmpy2 = "~2.1.5"
  153. numexpr = "~2.9.0"
  154. duckduckgo-search = "~6.1.5"
  155. arxiv = "2.1.0"
  156. yarl = "~1.9.4"
  157. twilio = "~9.0.4"
  158. qrcode = "~7.4.2"
  159. azure-storage-blob = "12.13.0"
  160. azure-identity = "1.16.1"
  161. lxml = "5.1.0"
  162. xlrd = "~2.0.1"
  163. pydantic = "~2.7.4"
  164. pydantic_extra_types = "~2.8.1"
  165. pydantic-settings = "~2.3.3"
  166. pgvecto-rs = "0.1.4"
  167. firecrawl-py = "0.0.5"
  168. oss2 = "2.18.5"
  169. pgvector = "0.2.5"
  170. pymysql = "1.1.1"
  171. tidb-vector = "0.0.9"
  172. google-cloud-aiplatform = "1.49.0"
  173. vanna = {version = "0.5.5", extras = ["postgres", "mysql", "clickhouse", "duckdb"]}
  174. kaleido = "0.2.1"
  175. tencentcloud-sdk-python-hunyuan = "~3.0.1158"
  176. tcvectordb = "1.3.2"
  177. chromadb = "~0.5.1"
  178. tenacity = "~8.3.0"
  179. cos-python-sdk-v5 = "1.9.30"
  180. novita-client = "^0.5.6"
  181. opensearch-py = "2.4.0"
  182. oracledb = "~2.2.1"
  183. [tool.poetry.group.dev]
  184. optional = true
  185. [tool.poetry.group.dev.dependencies]
  186. coverage = "~7.2.4"
  187. pytest = "~8.1.1"
  188. pytest-benchmark = "~4.0.0"
  189. pytest-env = "~1.1.3"
  190. pytest-mock = "~3.14.0"
  191. [tool.poetry.group.lint]
  192. optional = true
  193. [tool.poetry.group.lint.dependencies]
  194. ruff = "~0.4.8"
  195. dotenv-linter = "~0.5.0"