wechaty-web-panel 1.6.87 → 1.6.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (421) hide show
  1. package/dist/cjs/src/bot/chatgpt/index.d.ts +60 -0
  2. package/dist/cjs/src/bot/chatgpt/index.js +239 -0
  3. package/dist/cjs/src/bot/coze/sdk/index.d.ts +45 -0
  4. package/dist/cjs/src/bot/coze/sdk/index.js +113 -0
  5. package/dist/cjs/src/bot/dify/sdk/index.d.ts +167 -0
  6. package/dist/cjs/src/bot/dify/sdk/index.js +471 -0
  7. package/dist/cjs/src/bot/dify/sdk/office.d.ts +143 -0
  8. package/dist/cjs/src/bot/dify/sdk/office.js +329 -0
  9. package/dist/cjs/src/bot/fastgpt/index.d.ts +13 -0
  10. package/dist/cjs/src/bot/fastgpt/index.js +96 -0
  11. package/dist/cjs/src/bot/qanything/index.d.ts +35 -0
  12. package/dist/cjs/src/bot/qanything/index.js +143 -0
  13. package/dist/cjs/src/botInstance/coze.d.ts +60 -0
  14. package/dist/cjs/src/botInstance/coze.js +164 -0
  15. package/dist/cjs/src/botInstance/cozev3.d.ts +51 -0
  16. package/dist/cjs/src/botInstance/cozev3.js +154 -0
  17. package/dist/cjs/src/botInstance/dify.d.ts +42 -0
  18. package/dist/cjs/src/botInstance/dify.js +153 -0
  19. package/dist/cjs/src/botInstance/fastgpt.d.ts +38 -0
  20. package/dist/cjs/src/botInstance/fastgpt.js +128 -0
  21. package/dist/cjs/src/botInstance/gpt4v.d.ts +9 -0
  22. package/dist/cjs/src/botInstance/gpt4v.js +103 -0
  23. package/dist/cjs/src/botInstance/officialOpenAi.d.ts +52 -0
  24. package/dist/cjs/src/botInstance/officialOpenAi.js +188 -0
  25. package/dist/cjs/src/botInstance/qany.d.ts +38 -0
  26. package/dist/cjs/src/botInstance/qany.js +141 -0
  27. package/dist/cjs/src/botInstance/sdk/chatGPT4V.d.ts +17 -0
  28. package/dist/cjs/src/botInstance/sdk/chatGPT4V.js +96 -0
  29. package/dist/cjs/src/botInstance/sdk/coze.d.ts +27 -0
  30. package/dist/cjs/src/botInstance/sdk/coze.js +206 -0
  31. package/dist/cjs/src/botInstance/sdk/difyClient.d.ts +103 -0
  32. package/dist/cjs/src/botInstance/sdk/difyClient.js +362 -0
  33. package/dist/cjs/src/botInstance/sdk/pTimeout.d.ts +13 -0
  34. package/dist/cjs/src/botInstance/sdk/pTimeout.js +103 -0
  35. package/dist/cjs/src/botInstance/sdk/qanything.d.ts +35 -0
  36. package/dist/cjs/src/botInstance/sdk/qanything.js +143 -0
  37. package/dist/cjs/src/botInstance/sdk/quick-lru.d.ts +33 -0
  38. package/dist/cjs/src/botInstance/sdk/quick-lru.js +240 -0
  39. package/dist/cjs/src/common/hook.d.ts +11 -0
  40. package/dist/cjs/src/common/hook.js +70 -0
  41. package/dist/cjs/src/common/index.d.ts +111 -0
  42. package/dist/cjs/src/common/index.js +518 -0
  43. package/dist/cjs/src/common/multiReply.d.ts +24 -0
  44. package/dist/cjs/src/common/multiReply.js +161 -0
  45. package/dist/cjs/src/common/reply.d.ts +28 -0
  46. package/dist/cjs/src/common/reply.js +32 -0
  47. package/dist/cjs/src/const/puppet-type.d.ts +30 -0
  48. package/dist/cjs/src/const/puppet-type.js +77 -0
  49. package/dist/cjs/src/db/aiDb.d.ts +8 -0
  50. package/dist/cjs/src/db/aiDb.js +33 -0
  51. package/dist/cjs/src/db/aichatDb.d.ts +27 -0
  52. package/dist/cjs/src/db/aichatDb.js +94 -0
  53. package/dist/cjs/src/db/chatHistory.d.ts +42 -0
  54. package/dist/cjs/src/db/chatHistory.js +150 -0
  55. package/dist/cjs/src/db/configDb.d.ts +36 -0
  56. package/dist/cjs/src/db/configDb.js +103 -0
  57. package/dist/cjs/src/db/global.d.ts +2 -0
  58. package/dist/cjs/src/db/global.js +64 -0
  59. package/dist/cjs/src/db/gptConfig.d.ts +18 -0
  60. package/dist/cjs/src/db/gptConfig.js +97 -0
  61. package/dist/cjs/src/db/nedb.d.ts +17 -0
  62. package/dist/cjs/src/db/nedb.js +93 -0
  63. package/dist/cjs/src/db/puppetDb.d.ts +19 -0
  64. package/dist/cjs/src/db/puppetDb.js +68 -0
  65. package/dist/cjs/src/db/roomDb.d.ts +27 -0
  66. package/dist/cjs/src/db/roomDb.js +93 -0
  67. package/dist/cjs/src/db/rssConfig.d.ts +18 -0
  68. package/dist/cjs/src/db/rssConfig.js +94 -0
  69. package/dist/cjs/src/db/rssHistory.d.ts +22 -0
  70. package/dist/cjs/src/db/rssHistory.js +99 -0
  71. package/dist/cjs/src/db/userDb.d.ts +8 -0
  72. package/dist/cjs/src/db/userDb.js +33 -0
  73. package/dist/cjs/src/handlers/on-callback-message.d.ts +3 -0
  74. package/dist/cjs/src/handlers/on-callback-message.js +179 -0
  75. package/dist/cjs/src/handlers/on-error.d.ts +3 -0
  76. package/dist/cjs/src/handlers/on-error.js +7 -0
  77. package/dist/cjs/src/handlers/on-friend.d.ts +6 -0
  78. package/dist/cjs/src/handlers/on-friend.js +64 -0
  79. package/dist/cjs/src/handlers/on-heartbeat.d.ts +3 -0
  80. package/dist/cjs/src/handlers/on-heartbeat.js +22 -0
  81. package/dist/cjs/src/handlers/on-login.d.ts +7 -0
  82. package/dist/cjs/src/handlers/on-login.js +59 -0
  83. package/dist/cjs/src/handlers/on-logout.d.ts +6 -0
  84. package/dist/cjs/src/handlers/on-logout.js +19 -0
  85. package/dist/cjs/src/handlers/on-message.d.ts +3 -0
  86. package/dist/cjs/src/handlers/on-message.js +581 -0
  87. package/dist/cjs/src/handlers/on-ready.d.ts +6 -0
  88. package/dist/cjs/src/handlers/on-ready.js +44 -0
  89. package/dist/cjs/src/handlers/on-record-message.d.ts +3 -0
  90. package/dist/cjs/src/handlers/on-record-message.js +54 -0
  91. package/dist/cjs/src/handlers/on-roomjoin.d.ts +6 -0
  92. package/dist/cjs/src/handlers/on-roomjoin.js +43 -0
  93. package/dist/cjs/src/handlers/on-roomleave.d.ts +3 -0
  94. package/dist/cjs/src/handlers/on-roomleave.js +13 -0
  95. package/dist/cjs/src/handlers/on-roomtopic.d.ts +3 -0
  96. package/dist/cjs/src/handlers/on-roomtopic.js +17 -0
  97. package/dist/cjs/src/handlers/on-scan.d.ts +7 -0
  98. package/dist/cjs/src/handlers/on-scan.js +71 -0
  99. package/dist/cjs/src/handlers/on-verifycode.d.ts +2 -0
  100. package/dist/cjs/src/handlers/on-verifycode.js +37 -0
  101. package/dist/cjs/src/index.d.ts +8 -0
  102. package/dist/cjs/src/index.js +95 -0
  103. package/dist/cjs/src/lib/contentCensor.d.ts +8 -0
  104. package/dist/cjs/src/lib/contentCensor.js +30 -0
  105. package/dist/cjs/src/lib/index.d.ts +158 -0
  106. package/dist/cjs/src/lib/index.js +588 -0
  107. package/dist/cjs/src/lib/oss.d.ts +3 -0
  108. package/dist/cjs/src/lib/oss.js +44 -0
  109. package/dist/cjs/src/package-json.d.ts +75 -0
  110. package/dist/cjs/src/package-json.js +81 -0
  111. package/dist/cjs/src/proxy/aibotk.d.ts +200 -0
  112. package/dist/cjs/src/proxy/aibotk.js +810 -0
  113. package/dist/cjs/src/proxy/api.d.ts +85 -0
  114. package/dist/cjs/src/proxy/api.js +455 -0
  115. package/dist/cjs/src/proxy/apib.d.ts +109 -0
  116. package/dist/cjs/src/proxy/apib.js +589 -0
  117. package/dist/cjs/src/proxy/bot/chatgpt.d.ts +18 -0
  118. package/dist/cjs/src/proxy/bot/chatgpt.js +47 -0
  119. package/dist/cjs/src/proxy/bot/coze.d.ts +14 -0
  120. package/dist/cjs/src/proxy/bot/coze.js +47 -0
  121. package/dist/cjs/src/proxy/bot/cozev3.d.ts +19 -0
  122. package/dist/cjs/src/proxy/bot/cozev3.js +47 -0
  123. package/dist/cjs/src/proxy/bot/dify.d.ts +19 -0
  124. package/dist/cjs/src/proxy/bot/dify.js +47 -0
  125. package/dist/cjs/src/proxy/bot/dispatch.d.ts +7 -0
  126. package/dist/cjs/src/proxy/bot/dispatch.js +84 -0
  127. package/dist/cjs/src/proxy/bot/fastgpt.d.ts +15 -0
  128. package/dist/cjs/src/proxy/bot/fastgpt.js +36 -0
  129. package/dist/cjs/src/proxy/bot/qany.d.ts +10 -0
  130. package/dist/cjs/src/proxy/bot/qany.js +36 -0
  131. package/dist/cjs/src/proxy/config.d.ts +14 -0
  132. package/dist/cjs/src/proxy/config.js +16 -0
  133. package/dist/cjs/src/proxy/cozeAi.d.ts +11 -0
  134. package/dist/cjs/src/proxy/cozeAi.js +67 -0
  135. package/dist/cjs/src/proxy/cozeV3Ai.d.ts +17 -0
  136. package/dist/cjs/src/proxy/cozeV3Ai.js +67 -0
  137. package/dist/cjs/src/proxy/difyAi.d.ts +17 -0
  138. package/dist/cjs/src/proxy/difyAi.js +65 -0
  139. package/dist/cjs/src/proxy/fastgpt.d.ts +15 -0
  140. package/dist/cjs/src/proxy/fastgpt.js +62 -0
  141. package/dist/cjs/src/proxy/mqtt.d.ts +7 -0
  142. package/dist/cjs/src/proxy/mqtt.js +305 -0
  143. package/dist/cjs/src/proxy/multimodal.d.ts +26 -0
  144. package/dist/cjs/src/proxy/multimodal.js +131 -0
  145. package/dist/cjs/src/proxy/openAi.d.ts +15 -0
  146. package/dist/cjs/src/proxy/openAi.js +70 -0
  147. package/dist/cjs/src/proxy/outapi.d.ts +7 -0
  148. package/dist/cjs/src/proxy/outapi.js +69 -0
  149. package/dist/cjs/src/proxy/qAnyAi.d.ts +11 -0
  150. package/dist/cjs/src/proxy/qAnyAi.js +64 -0
  151. package/dist/cjs/src/proxy/superagent.d.ts +14 -0
  152. package/dist/cjs/src/proxy/superagent.js +195 -0
  153. package/dist/cjs/src/proxy/tencent-open.d.ts +10 -0
  154. package/dist/cjs/src/proxy/tencent-open.js +261 -0
  155. package/dist/cjs/src/service/event-dispatch-service.d.ts +36 -0
  156. package/dist/cjs/src/service/event-dispatch-service.js +308 -0
  157. package/dist/cjs/src/service/gpt4vService.d.ts +13 -0
  158. package/dist/cjs/src/service/gpt4vService.js +52 -0
  159. package/dist/cjs/src/service/msg-filter-service.d.ts +44 -0
  160. package/dist/cjs/src/service/msg-filter-service.js +127 -0
  161. package/dist/cjs/src/service/msg-filters.d.ts +185 -0
  162. package/dist/cjs/src/service/msg-filters.js +651 -0
  163. package/dist/cjs/src/service/room-async-service.d.ts +9 -0
  164. package/dist/cjs/src/service/room-async-service.js +461 -0
  165. package/dist/cjs/src/task/index.d.ts +42 -0
  166. package/dist/cjs/src/task/index.js +540 -0
  167. package/dist/cjs/src/task/rss.d.ts +12 -0
  168. package/dist/cjs/src/task/rss.js +182 -0
  169. package/dist/esm/src/bot/chatgpt/index.d.ts +60 -0
  170. package/dist/esm/src/bot/chatgpt/index.js +235 -0
  171. package/dist/esm/src/bot/coze/sdk/index.d.ts +45 -0
  172. package/dist/esm/src/bot/coze/sdk/index.js +110 -0
  173. package/dist/esm/src/bot/dify/sdk/index.d.ts +167 -0
  174. package/dist/esm/src/bot/dify/sdk/index.js +461 -0
  175. package/dist/esm/src/bot/dify/sdk/office.d.ts +143 -0
  176. package/dist/esm/src/bot/dify/sdk/office.js +319 -0
  177. package/dist/esm/src/bot/fastgpt/index.d.ts +13 -0
  178. package/dist/esm/src/bot/fastgpt/index.js +89 -0
  179. package/dist/esm/src/bot/qanything/index.d.ts +35 -0
  180. package/dist/esm/src/bot/qanything/index.js +136 -0
  181. package/dist/esm/src/botInstance/coze.d.ts +60 -0
  182. package/dist/esm/src/botInstance/coze.js +159 -0
  183. package/dist/esm/src/botInstance/cozev3.d.ts +51 -0
  184. package/dist/esm/src/botInstance/cozev3.js +149 -0
  185. package/dist/esm/src/botInstance/dify.d.ts +42 -0
  186. package/dist/esm/src/botInstance/dify.js +148 -0
  187. package/dist/esm/src/botInstance/fastgpt.d.ts +38 -0
  188. package/dist/esm/src/botInstance/fastgpt.js +123 -0
  189. package/dist/esm/src/botInstance/gpt4v.d.ts +9 -0
  190. package/dist/esm/src/botInstance/gpt4v.js +95 -0
  191. package/dist/esm/src/botInstance/officialOpenAi.d.ts +52 -0
  192. package/dist/esm/src/botInstance/officialOpenAi.js +183 -0
  193. package/dist/esm/src/botInstance/qany.d.ts +38 -0
  194. package/dist/esm/src/botInstance/qany.js +136 -0
  195. package/dist/esm/src/botInstance/sdk/chatGPT4V.d.ts +17 -0
  196. package/dist/esm/src/botInstance/sdk/chatGPT4V.js +89 -0
  197. package/dist/esm/src/botInstance/sdk/coze.d.ts +27 -0
  198. package/dist/esm/src/botInstance/sdk/coze.js +200 -0
  199. package/dist/esm/src/botInstance/sdk/difyClient.d.ts +103 -0
  200. package/dist/esm/src/botInstance/sdk/difyClient.js +353 -0
  201. package/dist/esm/src/botInstance/sdk/pTimeout.d.ts +13 -0
  202. package/dist/esm/src/botInstance/sdk/pTimeout.js +97 -0
  203. package/dist/esm/src/botInstance/sdk/qanything.d.ts +35 -0
  204. package/dist/esm/src/botInstance/sdk/qanything.js +137 -0
  205. package/dist/esm/src/botInstance/sdk/quick-lru.d.ts +33 -0
  206. package/dist/esm/src/botInstance/sdk/quick-lru.js +237 -0
  207. package/dist/esm/src/common/hook.d.ts +11 -0
  208. package/dist/esm/src/common/hook.js +66 -0
  209. package/dist/esm/src/common/index.d.ts +111 -0
  210. package/dist/esm/src/common/index.js +511 -0
  211. package/dist/esm/src/common/multiReply.d.ts +24 -0
  212. package/dist/esm/src/common/multiReply.js +158 -0
  213. package/dist/esm/src/common/reply.d.ts +28 -0
  214. package/dist/esm/src/common/reply.js +23 -0
  215. package/dist/esm/src/const/puppet-type.d.ts +30 -0
  216. package/dist/esm/src/const/puppet-type.js +71 -0
  217. package/dist/esm/src/db/aiDb.d.ts +8 -0
  218. package/dist/esm/src/db/aiDb.js +27 -0
  219. package/dist/esm/src/db/aichatDb.d.ts +27 -0
  220. package/dist/esm/src/db/aichatDb.js +84 -0
  221. package/dist/esm/src/db/chatHistory.d.ts +42 -0
  222. package/dist/esm/src/db/chatHistory.js +137 -0
  223. package/dist/esm/src/db/configDb.d.ts +36 -0
  224. package/dist/esm/src/db/configDb.js +97 -0
  225. package/dist/esm/src/db/global.d.ts +2 -0
  226. package/dist/esm/src/db/global.js +62 -0
  227. package/dist/esm/src/db/gptConfig.d.ts +18 -0
  228. package/dist/esm/src/db/gptConfig.js +85 -0
  229. package/dist/esm/src/db/nedb.d.ts +17 -0
  230. package/dist/esm/src/db/nedb.js +88 -0
  231. package/dist/esm/src/db/puppetDb.d.ts +19 -0
  232. package/dist/esm/src/db/puppetDb.js +58 -0
  233. package/dist/esm/src/db/roomDb.d.ts +27 -0
  234. package/dist/esm/src/db/roomDb.js +83 -0
  235. package/dist/esm/src/db/rssConfig.d.ts +18 -0
  236. package/dist/esm/src/db/rssConfig.js +82 -0
  237. package/dist/esm/src/db/rssHistory.d.ts +22 -0
  238. package/dist/esm/src/db/rssHistory.js +88 -0
  239. package/dist/esm/src/db/userDb.d.ts +8 -0
  240. package/dist/esm/src/db/userDb.js +27 -0
  241. package/dist/esm/src/handlers/on-callback-message.d.ts +3 -0
  242. package/dist/esm/src/handlers/on-callback-message.js +174 -0
  243. package/dist/esm/src/handlers/on-error.d.ts +3 -0
  244. package/dist/esm/src/handlers/on-error.js +5 -0
  245. package/dist/esm/src/handlers/on-friend.d.ts +6 -0
  246. package/dist/esm/src/handlers/on-friend.js +62 -0
  247. package/dist/esm/src/handlers/on-heartbeat.d.ts +3 -0
  248. package/dist/esm/src/handlers/on-heartbeat.js +20 -0
  249. package/dist/esm/src/handlers/on-login.d.ts +7 -0
  250. package/dist/esm/src/handlers/on-login.js +57 -0
  251. package/dist/esm/src/handlers/on-logout.d.ts +6 -0
  252. package/dist/esm/src/handlers/on-logout.js +17 -0
  253. package/dist/esm/src/handlers/on-message.d.ts +3 -0
  254. package/dist/esm/src/handlers/on-message.js +576 -0
  255. package/dist/esm/src/handlers/on-ready.d.ts +6 -0
  256. package/dist/esm/src/handlers/on-ready.js +39 -0
  257. package/dist/esm/src/handlers/on-record-message.d.ts +3 -0
  258. package/dist/esm/src/handlers/on-record-message.js +49 -0
  259. package/dist/esm/src/handlers/on-roomjoin.d.ts +6 -0
  260. package/dist/esm/src/handlers/on-roomjoin.js +41 -0
  261. package/dist/esm/src/handlers/on-roomleave.d.ts +3 -0
  262. package/dist/esm/src/handlers/on-roomleave.js +11 -0
  263. package/dist/esm/src/handlers/on-roomtopic.d.ts +3 -0
  264. package/dist/esm/src/handlers/on-roomtopic.js +15 -0
  265. package/dist/esm/src/handlers/on-scan.d.ts +7 -0
  266. package/dist/esm/src/handlers/on-scan.js +64 -0
  267. package/dist/esm/src/handlers/on-verifycode.d.ts +2 -0
  268. package/dist/esm/src/handlers/on-verifycode.js +31 -0
  269. package/dist/esm/src/index.d.ts +8 -0
  270. package/dist/esm/src/index.js +87 -0
  271. package/dist/esm/src/lib/contentCensor.d.ts +8 -0
  272. package/dist/esm/src/lib/contentCensor.js +23 -0
  273. package/dist/esm/src/lib/index.d.ts +158 -0
  274. package/dist/esm/src/lib/index.js +556 -0
  275. package/dist/esm/src/lib/oss.d.ts +3 -0
  276. package/dist/esm/src/lib/oss.js +36 -0
  277. package/dist/esm/src/package-json.d.ts +75 -0
  278. package/dist/esm/src/package-json.js +78 -0
  279. package/dist/esm/src/proxy/aibotk.d.ts +200 -0
  280. package/dist/esm/src/proxy/aibotk.js +795 -0
  281. package/dist/esm/src/proxy/api.d.ts +85 -0
  282. package/dist/esm/src/proxy/api.js +431 -0
  283. package/dist/esm/src/proxy/apib.d.ts +109 -0
  284. package/dist/esm/src/proxy/apib.js +587 -0
  285. package/dist/esm/src/proxy/bot/chatgpt.d.ts +18 -0
  286. package/dist/esm/src/proxy/bot/chatgpt.js +38 -0
  287. package/dist/esm/src/proxy/bot/coze.d.ts +14 -0
  288. package/dist/esm/src/proxy/bot/coze.js +38 -0
  289. package/dist/esm/src/proxy/bot/cozev3.d.ts +19 -0
  290. package/dist/esm/src/proxy/bot/cozev3.js +38 -0
  291. package/dist/esm/src/proxy/bot/dify.d.ts +19 -0
  292. package/dist/esm/src/proxy/bot/dify.js +38 -0
  293. package/dist/esm/src/proxy/bot/dispatch.d.ts +7 -0
  294. package/dist/esm/src/proxy/bot/dispatch.js +77 -0
  295. package/dist/esm/src/proxy/bot/fastgpt.d.ts +15 -0
  296. package/dist/esm/src/proxy/bot/fastgpt.js +27 -0
  297. package/dist/esm/src/proxy/bot/qany.d.ts +10 -0
  298. package/dist/esm/src/proxy/bot/qany.js +27 -0
  299. package/dist/esm/src/proxy/config.d.ts +14 -0
  300. package/dist/esm/src/proxy/config.js +13 -0
  301. package/dist/esm/src/proxy/cozeAi.d.ts +11 -0
  302. package/dist/esm/src/proxy/cozeAi.js +58 -0
  303. package/dist/esm/src/proxy/cozeV3Ai.d.ts +17 -0
  304. package/dist/esm/src/proxy/cozeV3Ai.js +58 -0
  305. package/dist/esm/src/proxy/difyAi.d.ts +17 -0
  306. package/dist/esm/src/proxy/difyAi.js +56 -0
  307. package/dist/esm/src/proxy/fastgpt.d.ts +15 -0
  308. package/dist/esm/src/proxy/fastgpt.js +53 -0
  309. package/dist/esm/src/proxy/mqtt.d.ts +7 -0
  310. package/dist/esm/src/proxy/mqtt.js +275 -0
  311. package/dist/esm/src/proxy/multimodal.d.ts +26 -0
  312. package/dist/esm/src/proxy/multimodal.js +122 -0
  313. package/dist/esm/src/proxy/openAi.d.ts +15 -0
  314. package/dist/esm/src/proxy/openAi.js +61 -0
  315. package/dist/esm/src/proxy/outapi.d.ts +7 -0
  316. package/dist/esm/src/proxy/outapi.js +62 -0
  317. package/dist/esm/src/proxy/qAnyAi.d.ts +11 -0
  318. package/dist/esm/src/proxy/qAnyAi.js +55 -0
  319. package/dist/esm/src/proxy/superagent.d.ts +14 -0
  320. package/dist/esm/src/proxy/superagent.js +189 -0
  321. package/dist/esm/src/proxy/tencent-open.d.ts +10 -0
  322. package/dist/esm/src/proxy/tencent-open.js +255 -0
  323. package/dist/esm/src/service/event-dispatch-service.d.ts +36 -0
  324. package/dist/esm/src/service/event-dispatch-service.js +305 -0
  325. package/dist/esm/src/service/gpt4vService.d.ts +13 -0
  326. package/dist/esm/src/service/gpt4vService.js +45 -0
  327. package/dist/esm/src/service/msg-filter-service.d.ts +44 -0
  328. package/dist/esm/src/service/msg-filter-service.js +121 -0
  329. package/dist/esm/src/service/msg-filters.d.ts +185 -0
  330. package/dist/esm/src/service/msg-filters.js +643 -0
  331. package/dist/esm/src/service/room-async-service.d.ts +9 -0
  332. package/dist/esm/src/service/room-async-service.js +455 -0
  333. package/dist/esm/src/task/index.d.ts +42 -0
  334. package/dist/esm/src/task/index.js +534 -0
  335. package/dist/esm/src/task/rss.d.ts +12 -0
  336. package/dist/esm/src/task/rss.js +174 -0
  337. package/package.json +1 -1
  338. package/src/bot/chatgpt/index.js +268 -0
  339. package/src/bot/coze/sdk/index.js +118 -0
  340. package/src/bot/dify/sdk/index.js +543 -0
  341. package/src/bot/dify/sdk/office.js +464 -0
  342. package/src/bot/fastgpt/index.js +92 -0
  343. package/src/bot/qanything/index.js +144 -0
  344. package/src/botInstance/coze.js +174 -0
  345. package/src/botInstance/cozev3.js +156 -0
  346. package/src/botInstance/dify.js +156 -0
  347. package/src/botInstance/fastgpt.js +132 -0
  348. package/src/botInstance/gpt4v.js +94 -0
  349. package/src/botInstance/officialOpenAi.js +194 -0
  350. package/src/botInstance/qany.js +146 -0
  351. package/src/botInstance/sdk/chatGPT4V.js +99 -0
  352. package/src/botInstance/sdk/coze.js +244 -0
  353. package/src/botInstance/sdk/difyClient.js +374 -0
  354. package/src/botInstance/sdk/pTimeout.js +114 -0
  355. package/src/botInstance/sdk/qanything.js +148 -0
  356. package/src/botInstance/sdk/quick-lru.js +281 -0
  357. package/src/common/hook.js +60 -0
  358. package/src/common/index.js +495 -0
  359. package/src/common/multiReply.js +164 -0
  360. package/src/common/reply.js +23 -0
  361. package/src/const/puppet-type.js +76 -0
  362. package/src/db/aiDb.js +24 -0
  363. package/src/db/aichatDb.js +94 -0
  364. package/src/db/chatHistory.js +150 -0
  365. package/src/db/configDb.js +90 -0
  366. package/src/db/global.js +64 -0
  367. package/src/db/gptConfig.js +102 -0
  368. package/src/db/nedb.js +87 -0
  369. package/src/db/puppetDb.js +55 -0
  370. package/src/db/roomDb.js +92 -0
  371. package/src/db/rssConfig.js +100 -0
  372. package/src/db/rssHistory.js +98 -0
  373. package/src/db/userDb.js +24 -0
  374. package/src/handlers/on-callback-message.js +173 -0
  375. package/src/handlers/on-error.js +4 -0
  376. package/src/handlers/on-friend.js +57 -0
  377. package/src/handlers/on-heartbeat.js +18 -0
  378. package/src/handlers/on-login.js +55 -0
  379. package/src/handlers/on-logout.js +16 -0
  380. package/src/handlers/on-message.js +578 -0
  381. package/src/handlers/on-ready.js +37 -0
  382. package/src/handlers/on-record-message.js +48 -0
  383. package/src/handlers/on-roomjoin.js +37 -0
  384. package/src/handlers/on-roomleave.js +9 -0
  385. package/src/handlers/on-roomtopic.js +13 -0
  386. package/src/handlers/on-scan.js +62 -0
  387. package/src/handlers/on-verifycode.js +28 -0
  388. package/src/index.js +85 -0
  389. package/src/lib/contentCensor.js +25 -0
  390. package/src/lib/index.js +557 -0
  391. package/src/lib/oss.js +37 -0
  392. package/src/package-json.js +77 -0
  393. package/src/proxy/aibotk.js +777 -0
  394. package/src/proxy/api.js +431 -0
  395. package/src/proxy/apib.js +547 -0
  396. package/src/proxy/bot/chatgpt.js +40 -0
  397. package/src/proxy/bot/coze.js +40 -0
  398. package/src/proxy/bot/cozev3.js +40 -0
  399. package/src/proxy/bot/dify.js +40 -0
  400. package/src/proxy/bot/dispatch.js +75 -0
  401. package/src/proxy/bot/fastgpt.js +30 -0
  402. package/src/proxy/bot/qany.js +30 -0
  403. package/src/proxy/config.js +13 -0
  404. package/src/proxy/cozeAi.js +62 -0
  405. package/src/proxy/cozeV3Ai.js +62 -0
  406. package/src/proxy/difyAi.js +60 -0
  407. package/src/proxy/fastgpt.js +58 -0
  408. package/src/proxy/mqtt.js +258 -0
  409. package/src/proxy/multimodal.js +120 -0
  410. package/src/proxy/openAi.js +64 -0
  411. package/src/proxy/outapi.js +63 -0
  412. package/src/proxy/qAnyAi.js +59 -0
  413. package/src/proxy/superagent.js +179 -0
  414. package/src/proxy/tencent-open.js +257 -0
  415. package/src/service/event-dispatch-service.js +299 -0
  416. package/src/service/gpt4vService.js +45 -0
  417. package/src/service/msg-filter-service.js +119 -0
  418. package/src/service/msg-filters.js +632 -0
  419. package/src/service/room-async-service.js +428 -0
  420. package/src/task/index.js +514 -0
  421. package/src/task/rss.js +178 -0
@@ -0,0 +1,60 @@
1
+ export class ChatGPTAPI {
2
+ constructor({ apiKey, apiBaseUrl, completionParams, debug, systemMessage, maxModelTokens, maxResponseTokens, memoryConfig, streaming, redis }: {
3
+ apiKey: any;
4
+ apiBaseUrl?: string | undefined;
5
+ completionParams?: {} | undefined;
6
+ debug?: boolean | undefined;
7
+ systemMessage?: string | undefined;
8
+ maxModelTokens?: number | undefined;
9
+ maxResponseTokens?: number | undefined;
10
+ memoryConfig?: {
11
+ type: string;
12
+ redisConfig: null;
13
+ expireTime: null;
14
+ } | undefined;
15
+ streaming?: boolean | undefined;
16
+ redis: any;
17
+ });
18
+ apiKey: any;
19
+ apiBaseUrl: string;
20
+ completionParams: {};
21
+ debug: boolean;
22
+ systemMessage: string;
23
+ maxModelTokens: number;
24
+ maxResponseTokens: number;
25
+ memoryConfig: {
26
+ type: string;
27
+ redisConfig: null;
28
+ expireTime: null;
29
+ };
30
+ conversations: Map<any, any>;
31
+ streaming: boolean;
32
+ redisClient: any;
33
+ /**
34
+ * Create a new conversation chain or retrieve an existing one
35
+ * @param {string} chatId - Unique identifier for the conversation
36
+ * @param {string} systemMessage - Optional system message to override the default
37
+ * @param {boolean} streaming - Whether to enable streaming for this conversation
38
+ * @returns {Object} - Conversation object with chain and metadata
39
+ */
40
+ getOrCreateConversation(chatId: string, { systemMessage, streaming, timeoutMs }: string): Object;
41
+ /**
42
+ * Send a message to the model and get a response
43
+ * @param {string} message - The message to send
44
+ * @param {Object} options - Additional options
45
+ * @returns {Promise<Object>} - The response
46
+ */
47
+ sendMessage({ message, file }: string, options?: Object): Promise<Object>;
48
+ /**
49
+ * Clear a specific conversation or all conversations
50
+ * @param {string} chatId - Optional chat ID to clear a specific conversation
51
+ */
52
+ clearConversations(chatId?: string): Promise<void>;
53
+ /**
54
+ * Set expiration time for a conversation
55
+ * @param {string} chatId - The chat ID
56
+ * @param {number} seconds - Time in seconds until expiration
57
+ */
58
+ setExpiration(chatId: string, seconds: number): Promise<void>;
59
+ }
60
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,239 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChatGPTAPI = void 0;
4
+ const openai_1 = require("@langchain/openai");
5
+ const chains_1 = require("langchain/chains");
6
+ const memory_1 = require("langchain/memory");
7
+ const prompts_1 = require("@langchain/core/prompts");
8
+ const output_parsers_1 = require("@langchain/core/output_parsers");
9
+ const redis_1 = require("@langchain/redis");
10
+ const openai_2 = require("@langchain/openai");
11
+ const uuid_1 = require("uuid");
12
+ class ChatGPTAPI {
13
+ constructor({ apiKey, apiBaseUrl = "https://api.openai.com/v1", completionParams = {}, debug = false, systemMessage = "", maxModelTokens = 4096, maxResponseTokens = 1024, memoryConfig = {
14
+ type: "memory",
15
+ redisConfig: null,
16
+ expireTime: null, // Time in seconds, null means no expiration
17
+ }, streaming = true, // Enable streaming mode by default
18
+ redis }) {
19
+ this.apiKey = apiKey;
20
+ this.apiBaseUrl = apiBaseUrl;
21
+ this.completionParams = completionParams;
22
+ this.debug = debug;
23
+ this.systemMessage = systemMessage;
24
+ this.maxModelTokens = maxModelTokens;
25
+ this.maxResponseTokens = maxResponseTokens;
26
+ this.memoryConfig = memoryConfig;
27
+ this.conversations = new Map();
28
+ this.streaming = streaming;
29
+ // Initialize Redis if needed
30
+ if (memoryConfig.type === "redis" && memoryConfig.redisConfig) {
31
+ this.redisClient = redis;
32
+ }
33
+ }
34
+ /**
35
+ * Create a new conversation chain or retrieve an existing one
36
+ * @param {string} chatId - Unique identifier for the conversation
37
+ * @param {string} systemMessage - Optional system message to override the default
38
+ * @param {boolean} streaming - Whether to enable streaming for this conversation
39
+ * @returns {Object} - Conversation object with chain and metadata
40
+ */
41
+ async getOrCreateConversation(chatId, { systemMessage = null, streaming = null, timeoutMs = 60000 }) {
42
+ // If conversation exists and no specific system message is requested, return it
43
+ if (this.conversations.has(chatId) && !systemMessage) {
44
+ return this.conversations.get(chatId);
45
+ }
46
+ // Calculate context window size
47
+ const contextWindowSize = this.maxModelTokens - this.maxResponseTokens - 500; // Buffer for metadata
48
+ // Create the appropriate memory system
49
+ let memory;
50
+ if (this.memoryConfig.type === "redis") {
51
+ // Setup Redis vector store for memory
52
+ const vectorStore = new redis_1.RedisVectorStore(new openai_2.OpenAIEmbeddings({
53
+ openAIApiKey: this.apiKey,
54
+ configuration: {
55
+ baseURL: this.apiBaseUrl
56
+ }
57
+ }), {
58
+ redisClient: this.redisClient,
59
+ indexName: `chat:${chatId}`,
60
+ });
61
+ memory = new memory_1.BufferMemory({
62
+ memoryKey: "chat_history",
63
+ chatHistory: vectorStore,
64
+ returnMessages: true,
65
+ outputKey: "output",
66
+ inputKey: "input",
67
+ });
68
+ // Set expiration if configured
69
+ if (this.memoryConfig.expireTime) {
70
+ const expireTimeSeconds = this.memoryConfig.expireTime;
71
+ this.redisClient.expire(`chat:${chatId}`, expireTimeSeconds);
72
+ }
73
+ }
74
+ else {
75
+ // Use in-memory storage
76
+ memory = new memory_1.BufferWindowMemory({
77
+ memoryKey: "chat_history",
78
+ // k: 10, // Keep last 10 interactions by default, adjust based on token size
79
+ returnMessages: true,
80
+ outputKey: "output",
81
+ inputKey: "input",
82
+ });
83
+ }
84
+ // Determine if streaming should be enabled
85
+ const useStreaming = streaming !== null ? streaming : this.streaming;
86
+ // Create chat model
87
+ const chatModel = new openai_1.ChatOpenAI({
88
+ openAIApiKey: this.apiKey,
89
+ modelName: this.completionParams.model,
90
+ temperature: this.completionParams.temperature || 0.7,
91
+ topP: this.completionParams.top_p || 1,
92
+ presencePenalty: this.completionParams.presence_penalty || 0,
93
+ frequencyPenalty: this.completionParams.frequency_penalty || 0,
94
+ maxTokens: this.maxResponseTokens,
95
+ timeout: timeoutMs || 60000,
96
+ streaming: useStreaming,
97
+ verbose: this.debug,
98
+ configuration: {
99
+ baseURL: this.apiBaseUrl
100
+ }
101
+ });
102
+ // Create prompt template with system message
103
+ const finalSystemMessage = systemMessage || this.systemMessage || "You are a helpful assistant.";
104
+ const prompt = prompts_1.ChatPromptTemplate.fromMessages([
105
+ prompts_1.SystemMessagePromptTemplate.fromTemplate(finalSystemMessage),
106
+ new prompts_1.MessagesPlaceholder("chat_history"),
107
+ prompts_1.HumanMessagePromptTemplate.fromTemplate("{input}"),
108
+ ]);
109
+ // Create conversation chain using the new Runnable API in v0.3
110
+ const chain = new chains_1.ConversationChain({
111
+ memory,
112
+ llm: chatModel,
113
+ prompt,
114
+ verbose: this.debug,
115
+ outputParser: new output_parsers_1.StringOutputParser(),
116
+ inputKey: "input",
117
+ outputKey: "output"
118
+ });
119
+ // Store the conversation
120
+ this.conversations.set(chatId, {
121
+ chain,
122
+ createdAt: Date.now(),
123
+ model: this.completionParams.model,
124
+ contextWindowSize,
125
+ streaming: useStreaming
126
+ });
127
+ return this.conversations.get(chatId);
128
+ }
129
+ /**
130
+ * Send a message to the model and get a response
131
+ * @param {string} message - The message to send
132
+ * @param {Object} options - Additional options
133
+ * @returns {Promise<Object>} - The response
134
+ */
135
+ async sendMessage({ message, file }, options = {}) {
136
+ const chatId = options.chatId || (0, uuid_1.v4)();
137
+ const systemMsg = options.systemMessage || this.systemMessage;
138
+ const timeoutMs = options.timeoutMs || 60000;
139
+ const streaming = options.streaming !== undefined ? options.streaming : this.streaming;
140
+ try {
141
+ if (this.debug) {
142
+ console.log(`Sending message to ${this.completionParams.model} with chatId: ${chatId}`);
143
+ console.log(`Message: ${message}`);
144
+ console.log(`Streaming: ${streaming}`);
145
+ }
146
+ // Get or create conversation
147
+ const conversation = await this.getOrCreateConversation(chatId, { systemMessage: systemMsg, streaming, timeoutMs: timeoutMs });
148
+ let responseText = "";
149
+ const inputMessage = file && file.fileUrl ? {
150
+ input: {
151
+ text: message,
152
+ image_url: file.fileUrl
153
+ }
154
+ } : {
155
+ input: message
156
+ };
157
+ // Handle streaming or non-streaming response using v0.3 API
158
+ if (streaming) {
159
+ const responsePromise = new Promise(async (resolve, reject) => {
160
+ try {
161
+ responseText = "";
162
+ // Using v0.3 streaming API
163
+ const stream = await conversation.chain.stream(inputMessage);
164
+ for await (const chunk of stream) {
165
+ if (chunk.output) {
166
+ responseText += chunk.output;
167
+ }
168
+ }
169
+ resolve(responseText);
170
+ }
171
+ catch (error) {
172
+ reject(error);
173
+ }
174
+ });
175
+ // Race between response and timeout
176
+ await Promise.race([responsePromise]);
177
+ }
178
+ else {
179
+ // Non-streaming request using v0.3 API
180
+ const responsePromise = conversation.chain.invoke(inputMessage);
181
+ // Race between response and timeout
182
+ const response = await Promise.race([responsePromise]);
183
+ responseText = response.output;
184
+ }
185
+ // Return formatted response (same format for both streaming and non-streaming)
186
+ return {
187
+ chatId: chatId,
188
+ text: responseText,
189
+ id: (0, uuid_1.v4)()
190
+ };
191
+ }
192
+ catch (error) {
193
+ if (this.debug) {
194
+ console.error("Error in sendMessage:", error);
195
+ }
196
+ throw error;
197
+ }
198
+ }
199
+ /**
200
+ * Clear a specific conversation or all conversations
201
+ * @param {string} chatId - Optional chat ID to clear a specific conversation
202
+ */
203
+ async clearConversations(chatId = null) {
204
+ if (chatId) {
205
+ // Clear a specific conversation
206
+ this.conversations.delete(chatId);
207
+ // Clear from Redis if using Redis
208
+ if (this.memoryConfig.type === "redis" && this.redisClient) {
209
+ await this.redisClient.del(`chat:${chatId}`);
210
+ }
211
+ }
212
+ else {
213
+ // Clear all conversations
214
+ this.conversations.clear();
215
+ // Would need to implement a more complex Redis cleanup if needed
216
+ }
217
+ }
218
+ /**
219
+ * Set expiration time for a conversation
220
+ * @param {string} chatId - The chat ID
221
+ * @param {number} seconds - Time in seconds until expiration
222
+ */
223
+ async setExpiration(chatId, seconds) {
224
+ if (!this.conversations.has(chatId)) {
225
+ throw new Error(`Conversation with ID ${chatId} not found`);
226
+ }
227
+ if (this.memoryConfig.type === "redis" && this.redisClient) {
228
+ await this.redisClient.expire(`chat:${chatId}`, seconds);
229
+ }
230
+ else {
231
+ // For in-memory, we can set a timer to delete the conversation
232
+ setTimeout(() => {
233
+ this.conversations.delete(chatId);
234
+ }, seconds * 1000);
235
+ }
236
+ }
237
+ }
238
+ exports.ChatGPTAPI = ChatGPTAPI;
239
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,45 @@
1
+ export class CozeV3Api extends CozeClient {
2
+ sendMessage({ query, file }: {
3
+ query: any;
4
+ file: any;
5
+ }, { systemMessage, user, needConversation, conversationId, timeoutMs, files, variables }: {
6
+ systemMessage: any;
7
+ user: any;
8
+ needConversation?: boolean | undefined;
9
+ conversationId?: null | undefined;
10
+ timeoutMs?: number | undefined;
11
+ files?: null | undefined;
12
+ variables: any;
13
+ }): Promise<{
14
+ text: any;
15
+ conversationId: null;
16
+ id: string;
17
+ files: never[];
18
+ messages?: undefined;
19
+ } | {
20
+ text: string | undefined;
21
+ conversationId: null;
22
+ id: string;
23
+ files: never[];
24
+ messages: string[];
25
+ }>;
26
+ }
27
+ declare class CozeClient {
28
+ constructor({ apiKey, baseUrl, debug, systemMessage, stream, botId }: {
29
+ apiKey: any;
30
+ baseUrl?: string | undefined;
31
+ debug?: boolean | undefined;
32
+ systemMessage?: null | undefined;
33
+ stream?: boolean | undefined;
34
+ botId: any;
35
+ });
36
+ apiKey: any;
37
+ baseUrl: string;
38
+ debug: boolean;
39
+ stream: boolean;
40
+ botId: any;
41
+ systemMessage: any;
42
+ updateApiKey(apiKey: any): void;
43
+ }
44
+ export {};
45
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CozeV3Api = void 0;
4
+ const api_1 = require("@coze/api");
5
+ // import { FileBox } from 'file-box';
6
+ // import fs from 'fs';
7
+ class CozeClient {
8
+ constructor({ apiKey, baseUrl = api_1.COZE_CN_BASE_URL, debug = false, systemMessage = null, stream = false, botId }) {
9
+ this.apiKey = apiKey;
10
+ this.baseUrl = baseUrl;
11
+ this.debug = debug;
12
+ this.stream = stream;
13
+ this.botId = botId;
14
+ this.systemMessage = systemMessage;
15
+ }
16
+ updateApiKey(apiKey) {
17
+ this.apiKey = apiKey;
18
+ }
19
+ }
20
+ class CozeV3Api extends CozeClient {
21
+ async sendMessage({ query, file }, { systemMessage, user, needConversation = true, conversationId = null, timeoutMs = 100 * 1000, files = null, variables }) {
22
+ try {
23
+ const client = new api_1.CozeAPI({ baseURL: this.baseUrl, token: this.apiKey });
24
+ let messages = [
25
+ {
26
+ role: 'user',
27
+ content: query,
28
+ content_type: 'text',
29
+ },
30
+ ];
31
+ if (file && file.fileUrl) {
32
+ const mediaMessage = [
33
+ {
34
+ type: 'text',
35
+ text: query,
36
+ },
37
+ {
38
+ type: file.fileType === '图片' ? 'image' : 'file',
39
+ file_url: fileUrl,
40
+ },
41
+ ];
42
+ messages = [
43
+ {
44
+ role: 'user',
45
+ content: JSON.stringify(mediaMessage),
46
+ content_type: 'object_string',
47
+ },
48
+ ];
49
+ }
50
+ // else if(file) {
51
+ // const fileBuffer = await file.toStream()
52
+ // const fileRes = await client.files.upload({file: fileBuffer})
53
+ // const mediaMessage = [{
54
+ // type: 'text',
55
+ // text: query,
56
+ // }, {
57
+ // type: fileType,
58
+ // file_id: fileRes.id
59
+ // }]
60
+ // messages = [{
61
+ // role: 'user',
62
+ // content: JSON.stringify(mediaMessage),
63
+ // content_type: 'object_string',
64
+ // }]
65
+ // }
66
+ if (!conversationId && needConversation) {
67
+ const res = await client.conversations.create({
68
+ messages,
69
+ timeoutMs,
70
+ });
71
+ console.log('conversation', res);
72
+ conversationId = res?.id;
73
+ messages = [];
74
+ }
75
+ const data = {
76
+ bot_id: this.botId,
77
+ custom_variables: {
78
+ ...variables,
79
+ },
80
+ additional_messages: messages,
81
+ user_id: user,
82
+ auto_save_history: true,
83
+ };
84
+ if (systemMessage || this.systemMessage) {
85
+ data.custom_variables.systemMessage = systemMessage || this.systemMessage;
86
+ }
87
+ if (conversationId && needConversation) {
88
+ data.conversation_id = conversationId;
89
+ }
90
+ const stream = await client.chat.stream(data);
91
+ let answers = [];
92
+ let lastMessageId = '';
93
+ for await (const part of stream) {
94
+ if (part.event === api_1.ChatEventType.CONVERSATION_CHAT_FAILED || part.event === api_1.ChatEventType.ERROR) {
95
+ console.log('Coze 请求失败,请根据失败原因进行排查问题', JSON.stringify(part.data));
96
+ return { text: answer, conversationId, id: lastMessageId, files: [] };
97
+ }
98
+ if (part.event === api_1.ChatEventType.CONVERSATION_MESSAGE_COMPLETED && part.data.type === 'answer' && part.data.content_type === 'text') {
99
+ answers.push(part.data.content);
100
+ lastMessageId = part.data.id;
101
+ }
102
+ }
103
+ console.log('messages', answers);
104
+ return { text: answers[0], conversationId, id: lastMessageId, files: [], messages: answers };
105
+ }
106
+ catch (error) {
107
+ console.log('Coze 请求失败,请根据失败原因进行排查问题', JSON.stringify(error));
108
+ return { text: '', conversationId: conversationId, id: '', files: [], messages: [] };
109
+ }
110
+ }
111
+ }
112
+ exports.CozeV3Api = CozeV3Api;
113
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,167 @@
1
+ export const BASE_URL: "https://api.dify.ai/v1";
2
+ export namespace routes {
3
+ namespace feedback {
4
+ const method: string;
5
+ function url(messageId: any): string;
6
+ }
7
+ namespace application {
8
+ const method_1: string;
9
+ export { method_1 as method };
10
+ export function url_1(): string;
11
+ export { url_1 as url };
12
+ }
13
+ namespace fileUpload {
14
+ const method_2: string;
15
+ export { method_2 as method };
16
+ export function url_2(): string;
17
+ export { url_2 as url };
18
+ }
19
+ namespace textToAudio {
20
+ const method_3: string;
21
+ export { method_3 as method };
22
+ export function url_3(): string;
23
+ export { url_3 as url };
24
+ }
25
+ namespace getMeta {
26
+ const method_4: string;
27
+ export { method_4 as method };
28
+ export function url_4(): string;
29
+ export { url_4 as url };
30
+ }
31
+ namespace createCompletionMessage {
32
+ const method_5: string;
33
+ export { method_5 as method };
34
+ export function url_5(): string;
35
+ export { url_5 as url };
36
+ }
37
+ namespace createChatMessage {
38
+ const method_6: string;
39
+ export { method_6 as method };
40
+ export function url_6(): string;
41
+ export { url_6 as url };
42
+ }
43
+ namespace getSuggested {
44
+ const method_7: string;
45
+ export { method_7 as method };
46
+ export function url_7(message_id: any): string;
47
+ export { url_7 as url };
48
+ }
49
+ namespace stopChatMessage {
50
+ const method_8: string;
51
+ export { method_8 as method };
52
+ export function url_8(task_id: any): string;
53
+ export { url_8 as url };
54
+ }
55
+ namespace getConversations {
56
+ const method_9: string;
57
+ export { method_9 as method };
58
+ export function url_9(): string;
59
+ export { url_9 as url };
60
+ }
61
+ namespace getConversationMessages {
62
+ const method_10: string;
63
+ export { method_10 as method };
64
+ export function url_10(): string;
65
+ export { url_10 as url };
66
+ }
67
+ namespace renameConversation {
68
+ const method_11: string;
69
+ export { method_11 as method };
70
+ export function url_11(conversation_id: any): string;
71
+ export { url_11 as url };
72
+ }
73
+ namespace deleteConversation {
74
+ const method_12: string;
75
+ export { method_12 as method };
76
+ export function url_12(conversation_id: any): string;
77
+ export { url_12 as url };
78
+ }
79
+ namespace audioToText {
80
+ const method_13: string;
81
+ export { method_13 as method };
82
+ export function url_13(): string;
83
+ export { url_13 as url };
84
+ }
85
+ namespace getWorkflowInfo {
86
+ const method_14: string;
87
+ export { method_14 as method };
88
+ export function url_14(): string;
89
+ export { url_14 as url };
90
+ }
91
+ namespace runWorkflow {
92
+ const method_15: string;
93
+ export { method_15 as method };
94
+ export function url_15(): string;
95
+ export { url_15 as url };
96
+ }
97
+ namespace stopWorkflow {
98
+ const method_16: string;
99
+ export { method_16 as method };
100
+ export function url_16(task_id: any): string;
101
+ export { url_16 as url };
102
+ }
103
+ namespace getWorkflowResult {
104
+ const method_17: string;
105
+ export { method_17 as method };
106
+ export function url_17(task_id: any): string;
107
+ export { url_17 as url };
108
+ }
109
+ }
110
+ export class DifyClient {
111
+ constructor({ apiKey, baseUrl, debug, systemMessage, stream }: {
112
+ apiKey: any;
113
+ baseUrl?: string | undefined;
114
+ debug?: boolean | undefined;
115
+ systemMessage?: null | undefined;
116
+ stream?: boolean | undefined;
117
+ });
118
+ apiKey: any;
119
+ baseUrl: string;
120
+ debug: boolean;
121
+ stream: boolean;
122
+ systemMessage: any;
123
+ updateApiKey(apiKey: any): void;
124
+ sendUploadRequest(method: any, endpoint: any, data?: null, params?: null, stream?: boolean, headerParams?: {}): Promise<import("axios").AxiosResponse<any, any>>;
125
+ sendRequest({ method, endpoint, data, params, stream, headerParams, timeoutMs }: {
126
+ method: any;
127
+ endpoint: any;
128
+ data: any;
129
+ params: any;
130
+ stream?: boolean | undefined;
131
+ headerParams?: {} | undefined;
132
+ timeoutMs?: number | undefined;
133
+ }): Promise<import("axios").AxiosResponse<any, any>>;
134
+ messageFeedback(messageId: any, rating: any, user: any): Promise<import("axios").AxiosResponse<any, any>>;
135
+ getApplicationParameters(user: any): Promise<import("axios").AxiosResponse<any, any>>;
136
+ fileUpload(data: any): Promise<import("axios").AxiosResponse<any, any>>;
137
+ textToAudio(text: any, user: any, streaming?: boolean): Promise<import("axios").AxiosResponse<any, any>>;
138
+ getMeta(user: any): Promise<import("axios").AxiosResponse<any, any>>;
139
+ }
140
+ export class CompletionClient extends DifyClient {
141
+ createCompletionMessage(inputs: any, user: any, stream?: boolean, files?: null): Promise<import("axios").AxiosResponse<any, any>>;
142
+ runWorkflow(inputs: any, user: any, stream?: boolean, files?: null): Promise<import("axios").AxiosResponse<any, any>>;
143
+ }
144
+ export class ChatClient extends DifyClient {
145
+ sendMessage(query: any, { systemMessage, user, conversationId, timeoutMs, files, inputs }: {
146
+ systemMessage: any;
147
+ user: any;
148
+ conversationId?: null | undefined;
149
+ timeoutMs?: number | undefined;
150
+ files?: null | undefined;
151
+ inputs: any;
152
+ }): Promise<any>;
153
+ getConversationMessages(user: any, conversationId?: string, firstId?: null, limit?: null): Promise<import("axios").AxiosResponse<any, any>>;
154
+ getConversations(user: any, firstId?: null, limit?: null, pinned?: null): Promise<import("axios").AxiosResponse<any, any>>;
155
+ renameConversation(conversationId: any, name: any, user: any): Promise<import("axios").AxiosResponse<any, any>>;
156
+ getSuggested(message_id: any, user: any): Promise<import("axios").AxiosResponse<any, any>>;
157
+ stopMessage(task_id: any, user: any): Promise<import("axios").AxiosResponse<any, any>>;
158
+ audioToText(data: any): Promise<import("axios").AxiosResponse<any, any>>;
159
+ }
160
+ export class WorkflowClient extends DifyClient {
161
+ run(inputs: any, user: any, stream: any): Promise<import("axios").AxiosResponse<any, any>>;
162
+ stop(task_id: any, user: any): Promise<import("axios").AxiosResponse<any, any>>;
163
+ info(user: any): Promise<import("axios").AxiosResponse<any, any>>;
164
+ result(task_id: any): Promise<import("axios").AxiosResponse<any, any>>;
165
+ getWorkflowResult(input: any, user: any, isStream: any): Promise<any>;
166
+ }
167
+ //# sourceMappingURL=index.d.ts.map