@lobehub/chat 0.146.2 → 0.147.1

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 (360) hide show
  1. package/.env.example +3 -5
  2. package/.github/workflows/issue-close-require.yml +1 -1
  3. package/.github/workflows/release.yml +1 -1
  4. package/.github/workflows/test.yml +3 -1
  5. package/.i18nrc.js +13 -8
  6. package/.seorc.cjs +9 -0
  7. package/CHANGELOG.md +98 -0
  8. package/README.md +25 -25
  9. package/README.zh-CN.md +25 -25
  10. package/contributing/Home.md +1 -1
  11. package/docs/self-hosting/advanced/analytics.mdx +13 -0
  12. package/docs/self-hosting/advanced/analytics.zh-CN.mdx +11 -0
  13. package/docs/self-hosting/advanced/authentication.mdx +26 -6
  14. package/docs/self-hosting/advanced/authentication.zh-CN.mdx +22 -6
  15. package/docs/self-hosting/advanced/sso-providers/auth0.mdx +76 -33
  16. package/docs/self-hosting/advanced/sso-providers/auth0.zh-CN.mdx +74 -33
  17. package/docs/self-hosting/advanced/sso-providers/authentik.mdx +49 -30
  18. package/docs/self-hosting/advanced/sso-providers/authentik.zh-CN.mdx +43 -28
  19. package/docs/self-hosting/advanced/sso-providers/github.mdx +62 -20
  20. package/docs/self-hosting/advanced/sso-providers/github.zh-CN.mdx +70 -34
  21. package/docs/self-hosting/advanced/sso-providers/microsoft-entra-id.mdx +69 -35
  22. package/docs/self-hosting/advanced/sso-providers/microsoft-entra-id.zh-CN.mdx +57 -32
  23. package/docs/self-hosting/advanced/sso-providers/zitadel.mdx +80 -35
  24. package/docs/self-hosting/advanced/sso-providers/zitadel.zh-CN.mdx +75 -37
  25. package/docs/self-hosting/advanced/upstream-sync.mdx +45 -23
  26. package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +42 -23
  27. package/docs/self-hosting/environment-variables/analytics.mdx +16 -0
  28. package/docs/self-hosting/environment-variables/analytics.zh-CN.mdx +14 -0
  29. package/docs/self-hosting/environment-variables/auth.mdx +15 -0
  30. package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +16 -1
  31. package/docs/self-hosting/environment-variables/basic.mdx +16 -0
  32. package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +12 -0
  33. package/docs/self-hosting/environment-variables/model-provider.mdx +27 -0
  34. package/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +11 -0
  35. package/docs/self-hosting/environment-variables.mdx +14 -2
  36. package/docs/self-hosting/environment-variables.zh-CN.mdx +10 -0
  37. package/docs/self-hosting/examples/azure-openai.mdx +24 -8
  38. package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +24 -8
  39. package/docs/self-hosting/examples/ollama.mdx +14 -0
  40. package/docs/self-hosting/examples/ollama.zh-CN.mdx +12 -0
  41. package/docs/self-hosting/faq/no-v1-suffix.mdx +13 -0
  42. package/docs/self-hosting/faq/no-v1-suffix.zh-CN.mdx +10 -0
  43. package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.mdx +15 -0
  44. package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.zh-CN.mdx +12 -0
  45. package/docs/self-hosting/platform/docker-compose.mdx +103 -80
  46. package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +92 -73
  47. package/docs/self-hosting/platform/docker.mdx +107 -89
  48. package/docs/self-hosting/platform/docker.zh-CN.mdx +106 -89
  49. package/docs/self-hosting/platform/netlify.mdx +109 -44
  50. package/docs/self-hosting/platform/netlify.zh-CN.mdx +102 -39
  51. package/docs/self-hosting/platform/railway.mdx +20 -6
  52. package/docs/self-hosting/platform/railway.zh-CN.mdx +19 -6
  53. package/docs/self-hosting/platform/repocloud.mdx +20 -6
  54. package/docs/self-hosting/platform/repocloud.zh-CN.mdx +18 -6
  55. package/docs/self-hosting/platform/sealos.mdx +19 -6
  56. package/docs/self-hosting/platform/sealos.zh-CN.mdx +18 -6
  57. package/docs/self-hosting/platform/vercel.mdx +21 -7
  58. package/docs/self-hosting/platform/vercel.zh-CN.mdx +20 -7
  59. package/docs/self-hosting/platform/zeabur.mdx +19 -6
  60. package/docs/self-hosting/platform/zeabur.zh-CN.mdx +18 -6
  61. package/docs/self-hosting/start.mdx +23 -1
  62. package/docs/self-hosting/start.zh-CN.mdx +15 -1
  63. package/docs/usage/agents/concepts.mdx +26 -2
  64. package/docs/usage/agents/concepts.zh-CN.mdx +23 -2
  65. package/docs/usage/agents/custom-agent.mdx +25 -4
  66. package/docs/usage/agents/custom-agent.zh-CN.mdx +22 -6
  67. package/docs/usage/agents/model.mdx +14 -5
  68. package/docs/usage/agents/model.zh-CN.mdx +18 -5
  69. package/docs/usage/agents/prompt.mdx +22 -5
  70. package/docs/usage/agents/prompt.zh-CN.mdx +17 -5
  71. package/docs/usage/agents/topics.mdx +22 -1
  72. package/docs/usage/agents/topics.zh-CN.mdx +20 -1
  73. package/docs/usage/features/agent-market.mdx +16 -6
  74. package/docs/usage/features/agent-market.zh-CN.mdx +14 -0
  75. package/docs/usage/features/local-llm.mdx +18 -3
  76. package/docs/usage/features/local-llm.zh-CN.mdx +9 -4
  77. package/docs/usage/features/mobile.mdx +15 -2
  78. package/docs/usage/features/mobile.zh-CN.mdx +17 -1
  79. package/docs/usage/features/more.mdx +14 -0
  80. package/docs/usage/features/more.zh-CN.mdx +11 -0
  81. package/docs/usage/features/multi-ai-providers.mdx +25 -3
  82. package/docs/usage/features/multi-ai-providers.zh-CN.mdx +28 -2
  83. package/docs/usage/features/plugin-system.mdx +20 -8
  84. package/docs/usage/features/plugin-system.zh-CN.mdx +18 -7
  85. package/docs/usage/features/pwa.mdx +21 -5
  86. package/docs/usage/features/pwa.zh-CN.mdx +24 -4
  87. package/docs/usage/features/text-to-image.mdx +11 -1
  88. package/docs/usage/features/text-to-image.zh-CN.mdx +14 -0
  89. package/docs/usage/features/theme.mdx +18 -2
  90. package/docs/usage/features/theme.zh-CN.mdx +18 -1
  91. package/docs/usage/features/tts.mdx +14 -1
  92. package/docs/usage/features/tts.zh-CN.mdx +13 -0
  93. package/docs/usage/features/vision.mdx +11 -1
  94. package/docs/usage/features/vision.zh-CN.mdx +11 -0
  95. package/docs/usage/plugins/basic-usage.mdx +43 -7
  96. package/docs/usage/plugins/basic-usage.zh-CN.mdx +41 -7
  97. package/docs/usage/plugins/custom-plugin.mdx +13 -0
  98. package/docs/usage/plugins/custom-plugin.zh-CN.mdx +11 -0
  99. package/docs/usage/plugins/development.mdx +97 -30
  100. package/docs/usage/plugins/development.zh-CN.mdx +92 -31
  101. package/docs/usage/plugins/store.mdx +23 -2
  102. package/docs/usage/plugins/store.zh-CN.mdx +20 -2
  103. package/docs/usage/providers/groq.mdx +45 -13
  104. package/docs/usage/providers/groq.zh-CN.mdx +41 -13
  105. package/docs/usage/providers/ollama/gemma.mdx +40 -14
  106. package/docs/usage/providers/ollama/gemma.zh-CN.mdx +40 -14
  107. package/docs/usage/providers/ollama/qwen.mdx +41 -19
  108. package/docs/usage/providers/ollama/qwen.zh-CN.mdx +35 -14
  109. package/docs/usage/providers/ollama.mdx +44 -21
  110. package/docs/usage/providers/ollama.zh-CN.mdx +45 -21
  111. package/docs/usage/start.mdx +13 -2
  112. package/docs/usage/start.zh-CN.mdx +11 -2
  113. package/locales/ar/common.json +0 -26
  114. package/locales/ar/components.json +15 -0
  115. package/locales/ar/error.json +1 -52
  116. package/locales/ar/modelProvider.json +226 -0
  117. package/locales/ar/setting.json +48 -199
  118. package/locales/bg-BG/common.json +0 -26
  119. package/locales/bg-BG/components.json +15 -0
  120. package/locales/bg-BG/error.json +1 -52
  121. package/locales/bg-BG/modelProvider.json +226 -0
  122. package/locales/bg-BG/setting.json +48 -199
  123. package/locales/de-DE/common.json +0 -26
  124. package/locales/de-DE/components.json +15 -0
  125. package/locales/de-DE/error.json +1 -52
  126. package/locales/de-DE/modelProvider.json +226 -0
  127. package/locales/de-DE/setting.json +48 -199
  128. package/locales/en-US/common.json +0 -26
  129. package/locales/en-US/components.json +15 -0
  130. package/locales/en-US/error.json +1 -52
  131. package/locales/en-US/modelProvider.json +226 -0
  132. package/locales/en-US/setting.json +48 -199
  133. package/locales/es-ES/common.json +0 -26
  134. package/locales/es-ES/components.json +15 -0
  135. package/locales/es-ES/error.json +1 -52
  136. package/locales/es-ES/modelProvider.json +226 -0
  137. package/locales/es-ES/setting.json +48 -199
  138. package/locales/fr-FR/common.json +0 -26
  139. package/locales/fr-FR/components.json +15 -0
  140. package/locales/fr-FR/error.json +1 -52
  141. package/locales/fr-FR/modelProvider.json +226 -0
  142. package/locales/fr-FR/setting.json +48 -199
  143. package/locales/it-IT/common.json +0 -26
  144. package/locales/it-IT/components.json +15 -0
  145. package/locales/it-IT/error.json +1 -52
  146. package/locales/it-IT/modelProvider.json +226 -0
  147. package/locales/it-IT/setting.json +59 -210
  148. package/locales/ja-JP/common.json +0 -26
  149. package/locales/ja-JP/components.json +15 -0
  150. package/locales/ja-JP/error.json +1 -52
  151. package/locales/ja-JP/modelProvider.json +226 -0
  152. package/locales/ja-JP/setting.json +59 -210
  153. package/locales/ko-KR/common.json +0 -26
  154. package/locales/ko-KR/components.json +15 -0
  155. package/locales/ko-KR/error.json +1 -52
  156. package/locales/ko-KR/modelProvider.json +226 -0
  157. package/locales/ko-KR/setting.json +48 -199
  158. package/locales/nl-NL/common.json +0 -26
  159. package/locales/nl-NL/components.json +15 -0
  160. package/locales/nl-NL/error.json +4 -55
  161. package/locales/nl-NL/modelProvider.json +226 -0
  162. package/locales/nl-NL/setting.json +49 -200
  163. package/locales/pl-PL/common.json +0 -26
  164. package/locales/pl-PL/components.json +15 -0
  165. package/locales/pl-PL/error.json +1 -52
  166. package/locales/pl-PL/modelProvider.json +226 -0
  167. package/locales/pl-PL/setting.json +48 -199
  168. package/locales/pt-BR/common.json +0 -26
  169. package/locales/pt-BR/components.json +15 -0
  170. package/locales/pt-BR/error.json +1 -52
  171. package/locales/pt-BR/modelProvider.json +226 -0
  172. package/locales/pt-BR/setting.json +48 -199
  173. package/locales/ru-RU/common.json +0 -26
  174. package/locales/ru-RU/components.json +15 -0
  175. package/locales/ru-RU/error.json +1 -52
  176. package/locales/ru-RU/modelProvider.json +226 -0
  177. package/locales/ru-RU/setting.json +48 -199
  178. package/locales/tr-TR/common.json +0 -26
  179. package/locales/tr-TR/components.json +15 -0
  180. package/locales/tr-TR/error.json +1 -52
  181. package/locales/tr-TR/modelProvider.json +226 -0
  182. package/locales/tr-TR/setting.json +48 -199
  183. package/locales/vi-VN/common.json +0 -26
  184. package/locales/vi-VN/components.json +15 -0
  185. package/locales/vi-VN/error.json +1 -52
  186. package/locales/vi-VN/modelProvider.json +226 -0
  187. package/locales/vi-VN/setting.json +48 -199
  188. package/locales/zh-CN/common.json +0 -26
  189. package/locales/zh-CN/components.json +15 -0
  190. package/locales/zh-CN/error.json +2 -53
  191. package/locales/zh-CN/modelProvider.json +226 -0
  192. package/locales/zh-CN/setting.json +48 -199
  193. package/locales/zh-TW/common.json +0 -26
  194. package/locales/zh-TW/components.json +15 -0
  195. package/locales/zh-TW/error.json +1 -52
  196. package/locales/zh-TW/modelProvider.json +226 -0
  197. package/locales/zh-TW/setting.json +48 -199
  198. package/package.json +120 -116
  199. package/scripts/mdxWorkflow/index.ts +48 -0
  200. package/src/app/api/chat/[provider]/route.test.ts +4 -9
  201. package/src/app/api/chat/[provider]/route.ts +6 -23
  202. package/src/app/api/chat/{[provider]/agentRuntime.test.ts → agentRuntime.test.ts} +12 -12
  203. package/src/app/api/chat/{[provider]/agentRuntime.ts → agentRuntime.ts} +11 -30
  204. package/src/app/api/chat/auth/index.ts +42 -0
  205. package/src/app/api/chat/models/[provider]/route.ts +45 -0
  206. package/src/app/api/config/__snapshots__/route.test.ts.snap +127 -0
  207. package/src/app/api/config/route.test.ts +170 -0
  208. package/src/app/api/config/route.ts +46 -11
  209. package/src/app/api/plugin/gateway/route.ts +1 -1
  210. package/src/app/settings/llm/Azure/index.tsx +36 -43
  211. package/src/app/settings/llm/Bedrock/index.tsx +12 -20
  212. package/src/app/settings/llm/Ollama/index.tsx +2 -2
  213. package/src/app/settings/llm/OpenAI/index.tsx +9 -121
  214. package/src/app/settings/llm/OpenRouter/index.tsx +1 -1
  215. package/src/app/settings/llm/TogetherAI/index.tsx +0 -1
  216. package/src/app/settings/llm/components/ProviderConfig/index.tsx +48 -32
  217. package/src/app/settings/llm/components/ProviderModelList/CustomModelOption.tsx +94 -0
  218. package/src/app/settings/llm/components/ProviderModelList/MaxTokenSlider.tsx +88 -0
  219. package/src/app/settings/llm/components/ProviderModelList/ModelConfigModal.tsx +128 -0
  220. package/src/app/settings/llm/components/ProviderModelList/ModelFetcher.tsx +81 -0
  221. package/src/app/settings/llm/components/ProviderModelList/Option.tsx +38 -0
  222. package/src/app/settings/llm/components/ProviderModelList/index.tsx +142 -0
  223. package/src/app/settings/llm/const.ts +1 -1
  224. package/src/app/settings/llm/index.tsx +7 -6
  225. package/src/app/settings/tts/TTS/index.tsx +1 -1
  226. package/src/components/AntdStaticMethods/index.test.tsx +43 -0
  227. package/src/components/ModelIcon/index.tsx +25 -7
  228. package/src/components/ModelSelect/index.tsx +67 -56
  229. package/src/config/modelProviders/anthropic.ts +6 -1
  230. package/src/config/modelProviders/azure.ts +42 -0
  231. package/src/config/modelProviders/bedrock.ts +4 -1
  232. package/src/config/modelProviders/google.ts +2 -14
  233. package/src/config/modelProviders/groq.ts +3 -0
  234. package/src/config/modelProviders/index.ts +19 -14
  235. package/src/config/modelProviders/mistral.ts +5 -0
  236. package/src/config/modelProviders/moonshot.ts +3 -1
  237. package/src/config/modelProviders/ollama.ts +6 -17
  238. package/src/config/modelProviders/openai.ts +9 -13
  239. package/src/config/modelProviders/openrouter.ts +6 -1
  240. package/src/config/modelProviders/perplexity.ts +2 -0
  241. package/src/config/modelProviders/togetherai.ts +11 -0
  242. package/src/config/modelProviders/zeroone.ts +3 -0
  243. package/src/config/modelProviders/zhipu.ts +3 -0
  244. package/src/config/server/provider.ts +52 -7
  245. package/src/const/auth.ts +0 -1
  246. package/src/const/{settings.ts → settings/index.ts} +31 -4
  247. package/src/const/url.ts +1 -1
  248. package/src/database/core/db.ts +14 -0
  249. package/src/database/schemas/user.ts +1 -25
  250. package/src/features/AgentSetting/AgentConfig/ModelSelect.tsx +7 -11
  251. package/src/features/ChatInput/STT/common.tsx +80 -78
  252. package/src/features/ChatInput/STT/index.tsx +8 -6
  253. package/src/features/Conversation/Error/APIKeyForm/Bedrock.tsx +8 -8
  254. package/src/features/Conversation/Error/APIKeyForm/ProviderApiKeyForm.tsx +73 -0
  255. package/src/features/Conversation/Error/APIKeyForm/ProviderAvatar.tsx +74 -0
  256. package/src/features/Conversation/Error/APIKeyForm/index.tsx +25 -49
  257. package/src/features/ModelSwitchPanel/index.tsx +40 -13
  258. package/src/hooks/_header.ts +5 -20
  259. package/src/libs/agent-runtime/BaseAI.ts +17 -1
  260. package/src/libs/agent-runtime/anthropic/index.ts +3 -7
  261. package/src/libs/agent-runtime/azureOpenai/index.test.ts +166 -0
  262. package/src/libs/agent-runtime/azureOpenai/index.ts +16 -8
  263. package/src/libs/agent-runtime/bedrock/index.test.ts +199 -22
  264. package/src/libs/agent-runtime/bedrock/index.ts +11 -18
  265. package/src/libs/agent-runtime/groq/index.test.ts +350 -0
  266. package/src/libs/agent-runtime/groq/index.ts +14 -77
  267. package/src/libs/agent-runtime/mistral/index.test.ts +25 -19
  268. package/src/libs/agent-runtime/mistral/index.ts +24 -86
  269. package/src/libs/agent-runtime/moonshot/index.test.ts +2 -2
  270. package/src/libs/agent-runtime/moonshot/index.ts +14 -77
  271. package/src/libs/agent-runtime/openai/__snapshots__/index.test.ts.snap +99 -0
  272. package/src/libs/agent-runtime/openai/fixtures/openai-models.json +170 -0
  273. package/src/libs/agent-runtime/openai/index.test.ts +15 -50
  274. package/src/libs/agent-runtime/openai/index.ts +15 -107
  275. package/src/libs/agent-runtime/openrouter/__snapshots__/index.test.ts.snap +82 -0
  276. package/src/libs/agent-runtime/openrouter/fixtures/models.json +62 -0
  277. package/src/libs/agent-runtime/openrouter/index.test.ts +25 -9
  278. package/src/libs/agent-runtime/openrouter/index.ts +42 -84
  279. package/src/libs/agent-runtime/openrouter/type.ts +28 -0
  280. package/src/libs/agent-runtime/togetherai/index.test.ts +12 -9
  281. package/src/libs/agent-runtime/togetherai/index.ts +20 -85
  282. package/src/libs/agent-runtime/utils/anthropicHelpers.test.ts +14 -22
  283. package/src/libs/agent-runtime/utils/anthropicHelpers.ts +4 -10
  284. package/src/libs/agent-runtime/utils/openaiCompatibleFactory/index.ts +147 -0
  285. package/src/libs/agent-runtime/zeroone/index.test.ts +350 -0
  286. package/src/libs/agent-runtime/zeroone/index.ts +14 -77
  287. package/src/locales/default/common.ts +0 -28
  288. package/src/locales/default/components.ts +15 -0
  289. package/src/locales/default/error.ts +2 -54
  290. package/src/locales/default/index.ts +4 -0
  291. package/src/locales/default/modelProvider.ts +229 -0
  292. package/src/locales/default/setting.ts +51 -202
  293. package/src/locales/resources.test.ts +49 -0
  294. package/src/locales/resources.ts +7 -20
  295. package/src/migrations/FromV3ToV4/fixtures/azure-input-v3.json +79 -0
  296. package/src/migrations/FromV3ToV4/fixtures/azure-output-v4.json +75 -0
  297. package/src/migrations/FromV3ToV4/fixtures/ollama-input-v3.json +85 -0
  298. package/src/migrations/FromV3ToV4/fixtures/ollama-output-v4.json +86 -0
  299. package/src/migrations/FromV3ToV4/fixtures/openai-input-v3.json +77 -0
  300. package/src/migrations/FromV3ToV4/fixtures/openai-output-v4.json +79 -0
  301. package/src/migrations/FromV3ToV4/fixtures/openrouter-input-v3.json +82 -0
  302. package/src/migrations/FromV3ToV4/fixtures/openrouter-output-v4.json +89 -0
  303. package/src/migrations/FromV3ToV4/fixtures/output-v4-from-v1.json +203 -0
  304. package/src/migrations/FromV3ToV4/index.ts +96 -0
  305. package/src/migrations/FromV3ToV4/migrations.test.ts +195 -0
  306. package/src/migrations/FromV3ToV4/types/v3.ts +59 -0
  307. package/src/migrations/FromV3ToV4/types/v4.ts +37 -0
  308. package/src/migrations/index.ts +11 -3
  309. package/src/services/_auth.test.ts +4 -6
  310. package/src/services/_auth.ts +8 -60
  311. package/src/services/_header.ts +5 -22
  312. package/src/services/_url.ts +1 -0
  313. package/src/services/chat.ts +16 -6
  314. package/src/services/global.ts +1 -1
  315. package/src/services/models.ts +23 -0
  316. package/src/services/ollama.ts +2 -2
  317. package/src/store/chat/slices/share/action.test.ts +113 -0
  318. package/src/store/chat/slices/share/action.ts +1 -1
  319. package/src/store/global/slices/common/action.test.ts +166 -1
  320. package/src/store/global/slices/common/action.ts +2 -1
  321. package/src/store/global/slices/settings/{action.test.ts → actions/general.test.ts} +1 -19
  322. package/src/store/global/slices/settings/{action.ts → actions/general.ts} +4 -19
  323. package/src/store/global/slices/settings/actions/index.ts +18 -0
  324. package/src/store/global/slices/settings/actions/llm.test.ts +60 -0
  325. package/src/store/global/slices/settings/actions/llm.ts +88 -0
  326. package/src/store/global/slices/settings/initialState.ts +3 -1
  327. package/src/store/global/slices/settings/reducers/customModelCard.test.ts +204 -0
  328. package/src/store/global/slices/settings/reducers/customModelCard.ts +64 -0
  329. package/src/store/global/slices/settings/selectors/index.ts +1 -0
  330. package/src/store/global/slices/settings/selectors/modelConfig.test.ts +189 -0
  331. package/src/store/global/slices/settings/selectors/modelConfig.ts +179 -0
  332. package/src/store/global/slices/settings/selectors/modelProvider.test.ts +47 -138
  333. package/src/store/global/slices/settings/selectors/modelProvider.ts +102 -243
  334. package/src/store/global/store.ts +1 -1
  335. package/src/types/llm.ts +12 -1
  336. package/src/types/serverConfig.ts +22 -0
  337. package/src/types/settings/index.ts +0 -12
  338. package/src/types/settings/modelProvider.ts +34 -90
  339. package/src/utils/client/switchLang.test.ts +34 -0
  340. package/src/utils/difference.test.ts +46 -0
  341. package/src/utils/difference.ts +15 -2
  342. package/src/utils/fetch.ts +1 -3
  343. package/src/utils/parseModels.ts +62 -0
  344. package/vercel.json +1 -1
  345. package/docs/package.json +0 -5
  346. package/src/features/Conversation/Error/APIKeyForm/Anthropic.tsx +0 -40
  347. package/src/features/Conversation/Error/APIKeyForm/Google.tsx +0 -61
  348. package/src/features/Conversation/Error/APIKeyForm/Groq.tsx +0 -60
  349. package/src/features/Conversation/Error/APIKeyForm/Mistral.tsx +0 -60
  350. package/src/features/Conversation/Error/APIKeyForm/Moonshot.tsx +0 -60
  351. package/src/features/Conversation/Error/APIKeyForm/OpenAI.tsx +0 -63
  352. package/src/features/Conversation/Error/APIKeyForm/OpenRouter.tsx +0 -40
  353. package/src/features/Conversation/Error/APIKeyForm/Perplexity.tsx +0 -60
  354. package/src/features/Conversation/Error/APIKeyForm/TogetherAI.tsx +0 -40
  355. package/src/features/Conversation/Error/APIKeyForm/ZeroOne.tsx +0 -60
  356. package/src/features/Conversation/Error/APIKeyForm/Zhipu.tsx +0 -62
  357. package/src/libs/agent-runtime/utils/env.ts +0 -1
  358. package/src/store/global/slices/settings/selectors/__snapshots__/modelProvider.test.ts.snap +0 -230
  359. /package/src/app/api/chat/{auth.ts → auth/utils.ts} +0 -0
  360. /package/src/components/{AntdStaticMethods.tsx → AntdStaticMethods/index.tsx} +0 -0
@@ -1,60 +0,0 @@
1
- import { ZeroOne } from '@lobehub/icons';
2
- import { Input } from 'antd';
3
- import { memo } from 'react';
4
- import { useTranslation } from 'react-i18next';
5
-
6
- import { ModelProvider } from '@/libs/agent-runtime';
7
- import { useGlobalStore } from '@/store/global';
8
- import { modelProviderSelectors } from '@/store/global/selectors';
9
-
10
- import { FormAction } from '../style';
11
-
12
- const ZeroOneForm = memo(() => {
13
- const { t } = useTranslation('error');
14
- // const [showProxy, setShow] = useState(false);
15
-
16
- const [apiKey, setConfig] = useGlobalStore((s) => [
17
- modelProviderSelectors.zerooneAPIKey(s),
18
- s.setModelProviderConfig,
19
- ]);
20
-
21
- return (
22
- <FormAction
23
- avatar={<ZeroOne size={56} />}
24
- description={t('unlock.apikey.ZeroOne.description')}
25
- title={t('unlock.apikey.ZeroOne.title')}
26
- >
27
- <Input.Password
28
- autoComplete={'new-password'}
29
- onChange={(e) => {
30
- setConfig(ModelProvider.ZeroOne, { apiKey: e.target.value });
31
- }}
32
- placeholder={'*********************************'}
33
- type={'block'}
34
- value={apiKey}
35
- />
36
- {/*{showProxy ? (*/}
37
- {/* <Input*/}
38
- {/* onChange={(e) => {*/}
39
- {/* setConfig({ endpoint: e.target.value });*/}
40
- {/* }}*/}
41
- {/* placeholder={'https://api.openai.com/v1'}*/}
42
- {/* type={'block'}*/}
43
- {/* value={proxyUrl}*/}
44
- {/* />*/}
45
- {/*) : (*/}
46
- {/* <Button*/}
47
- {/* icon={<Icon icon={Network} />}*/}
48
- {/* onClick={() => {*/}
49
- {/* setShow(true);*/}
50
- {/* }}*/}
51
- {/* type={'text'}*/}
52
- {/* >*/}
53
- {/* {t('unlock.apikey.addProxyUrl')}*/}
54
- {/* </Button>*/}
55
- {/*)}*/}
56
- </FormAction>
57
- );
58
- });
59
-
60
- export default ZeroOneForm;
@@ -1,62 +0,0 @@
1
- import { Zhipu } from '@lobehub/icons';
2
- import { Input } from 'antd';
3
- import { rgba } from 'polished';
4
- import { memo } from 'react';
5
- import { useTranslation } from 'react-i18next';
6
-
7
- import { ModelProvider } from '@/libs/agent-runtime';
8
- import { useGlobalStore } from '@/store/global';
9
- import { modelProviderSelectors } from '@/store/global/selectors';
10
-
11
- import { FormAction } from '../style';
12
-
13
- const ZhipuForm = memo(() => {
14
- const { t } = useTranslation('error');
15
-
16
- const [apiKey, setConfig] = useGlobalStore((s) => [
17
- modelProviderSelectors.zhipuAPIKey(s),
18
- s.setModelProviderConfig,
19
- // modelProviderSelectors.zhipuAPIKey(s),
20
- ]);
21
-
22
- return (
23
- <FormAction
24
- avatar={<Zhipu.Color size={64} />}
25
- background={rgba(Zhipu.colorPrimary, 0.1)}
26
- description={t('unlock.apikey.Zhipu.description')}
27
- title={t('unlock.apikey.Zhipu.title')}
28
- >
29
- <Input.Password
30
- autoComplete={'new-password'}
31
- onChange={(e) => {
32
- setConfig(ModelProvider.ZhiPu, { apiKey: e.target.value });
33
- }}
34
- placeholder={'*************************.****************'}
35
- type={'block'}
36
- value={apiKey}
37
- />
38
- {/*{showProxy ? (*/}
39
- {/* <Input*/}
40
- {/* onChange={(e) => {*/}
41
- {/* setConfig({ endpoint: e.target.value });*/}
42
- {/* }}*/}
43
- {/* placeholder={'https://api.openai.com/v1'}*/}
44
- {/* type={'block'}*/}
45
- {/* value={proxyUrl}*/}
46
- {/* />*/}
47
- {/*) : (*/}
48
- {/* <Button*/}
49
- {/* icon={<Icon icon={Network} />}*/}
50
- {/* onClick={() => {*/}
51
- {/* setShow(true);*/}
52
- {/* }}*/}
53
- {/* type={'text'}*/}
54
- {/* >*/}
55
- {/* {t('unlock.apikey.addProxyUrl')}*/}
56
- {/* </Button>*/}
57
- {/*)}*/}
58
- </FormAction>
59
- );
60
- });
61
-
62
- export default ZhipuForm;
@@ -1 +0,0 @@
1
- export const DEBUG_CHAT_COMPLETION = process.env.DEBUG_CHAT_COMPLETION === '1';
@@ -1,230 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`modelProviderSelectors > CUSTOM_MODELS > custom deletion, addition, and renaming of models 1`] = `
4
- [
5
- {
6
- "chatModels": [
7
- {
8
- "displayName": "llama",
9
- "functionCall": true,
10
- "id": "llama",
11
- "isCustom": true,
12
- "vision": true,
13
- },
14
- {
15
- "displayName": "claude-2",
16
- "functionCall": true,
17
- "id": "claude-2",
18
- "isCustom": true,
19
- "vision": true,
20
- },
21
- {
22
- "displayName": "gpt-4-32k",
23
- "functionCall": true,
24
- "hidden": undefined,
25
- "id": "gpt-4-0125-preview",
26
- "tokens": 128000,
27
- },
28
- ],
29
- "enabled": true,
30
- "id": "openai",
31
- },
32
- ]
33
- `;
34
-
35
- exports[`modelProviderSelectors > CUSTOM_MODELS > should work correct with gpt-4 1`] = `
36
- [
37
- {
38
- "displayName": "GPT-3.5 Turbo (1106)",
39
- "functionCall": true,
40
- "hidden": undefined,
41
- "id": "gpt-3.5-turbo-1106",
42
- "tokens": 16385,
43
- },
44
- {
45
- "description": "GPT 3.5 Turbo,适用于各种文本生成和理解任务",
46
- "displayName": "GPT-3.5 Turbo",
47
- "functionCall": true,
48
- "hidden": undefined,
49
- "id": "gpt-3.5-turbo",
50
- "tokens": 16385,
51
- },
52
- {
53
- "displayName": "GPT-3.5 Turbo 16K",
54
- "hidden": undefined,
55
- "id": "gpt-3.5-turbo-16k",
56
- "tokens": 16385,
57
- },
58
- {
59
- "displayName": "GPT-4",
60
- "functionCall": true,
61
- "hidden": undefined,
62
- "id": "gpt-4",
63
- "tokens": 8192,
64
- },
65
- {
66
- "displayName": "GPT-4 32K",
67
- "functionCall": true,
68
- "hidden": undefined,
69
- "id": "gpt-4-32k",
70
- "tokens": 32768,
71
- },
72
- {
73
- "displayName": "GPT-4 Turbo Preview (1106)",
74
- "functionCall": true,
75
- "hidden": undefined,
76
- "id": "gpt-4-1106-preview",
77
- "tokens": 128000,
78
- },
79
- {
80
- "description": "GPT-4 视觉预览版,支持视觉任务",
81
- "displayName": "GPT-4 Turbo Vision Preview",
82
- "hidden": undefined,
83
- "id": "gpt-4-vision-preview",
84
- "tokens": 128000,
85
- "vision": true,
86
- },
87
- ]
88
- `;
89
-
90
- exports[`modelProviderSelectors > OPENROUTER_CUSTOM_MODELS > custom deletion, addition, and renaming of models 1`] = `
91
- [
92
- {
93
- "chatModels": [
94
- {
95
- "description": "GPT 3.5 Turbo,适用于各种文本生成和理解任务",
96
- "displayName": "GPT-3.5 Turbo",
97
- "functionCall": true,
98
- "id": "gpt-3.5-turbo",
99
- "tokens": 16385,
100
- },
101
- {
102
- "displayName": "GPT-3.5 Turbo (0125)",
103
- "functionCall": true,
104
- "hidden": true,
105
- "id": "gpt-3.5-turbo-0125",
106
- "tokens": 16385,
107
- },
108
- {
109
- "displayName": "GPT-3.5 Turbo (1106)",
110
- "functionCall": true,
111
- "hidden": true,
112
- "id": "gpt-3.5-turbo-1106",
113
- "tokens": 16385,
114
- },
115
- {
116
- "displayName": "GPT-3.5 Turbo Instruct",
117
- "hidden": true,
118
- "id": "gpt-3.5-turbo-instruct",
119
- "tokens": 4096,
120
- },
121
- {
122
- "displayName": "GPT-3.5 Turbo 16K",
123
- "hidden": true,
124
- "id": "gpt-3.5-turbo-16k",
125
- "tokens": 16385,
126
- },
127
- {
128
- "displayName": "GPT-3.5 Turbo (0613)",
129
- "hidden": true,
130
- "id": "gpt-3.5-turbo-0613",
131
- "legacy": true,
132
- "tokens": 4096,
133
- },
134
- {
135
- "displayName": "GPT-3.5 Turbo 16K (0613)",
136
- "hidden": true,
137
- "id": "gpt-3.5-turbo-16k-0613",
138
- "legacy": true,
139
- "tokens": 4096,
140
- },
141
- {
142
- "displayName": "GPT-4 Turbo Preview",
143
- "functionCall": true,
144
- "id": "gpt-4-turbo-preview",
145
- "tokens": 128000,
146
- },
147
- {
148
- "displayName": "GPT-4 Turbo Preview (0125)",
149
- "functionCall": true,
150
- "hidden": true,
151
- "id": "gpt-4-0125-preview",
152
- "tokens": 128000,
153
- },
154
- {
155
- "description": "GPT-4 视觉预览版,支持视觉任务",
156
- "displayName": "GPT-4 Turbo Vision Preview",
157
- "id": "gpt-4-vision-preview",
158
- "tokens": 128000,
159
- "vision": true,
160
- },
161
- {
162
- "displayName": "GPT-4 Turbo Preview (1106)",
163
- "functionCall": true,
164
- "hidden": true,
165
- "id": "gpt-4-1106-preview",
166
- "tokens": 128000,
167
- },
168
- {
169
- "displayName": "GPT-4",
170
- "functionCall": true,
171
- "hidden": true,
172
- "id": "gpt-4",
173
- "tokens": 8192,
174
- },
175
- {
176
- "displayName": "GPT-4 (0613)",
177
- "functionCall": true,
178
- "hidden": true,
179
- "id": "gpt-4-0613",
180
- "tokens": 8192,
181
- },
182
- {
183
- "displayName": "GPT-4 32K",
184
- "functionCall": true,
185
- "hidden": true,
186
- "id": "gpt-4-32k",
187
- "tokens": 32768,
188
- },
189
- {
190
- "displayName": "GPT-4 32K (0613)",
191
- "functionCall": true,
192
- "hidden": true,
193
- "id": "gpt-4-32k-0613",
194
- "tokens": 32768,
195
- },
196
- {
197
- "displayName": "GPT-4 ALL",
198
- "files": true,
199
- "functionCall": true,
200
- "hidden": true,
201
- "id": "gpt-4-all",
202
- "tokens": 32768,
203
- "vision": true,
204
- },
205
- ],
206
- "enabled": true,
207
- "id": "openai",
208
- },
209
- {
210
- "chatModels": [
211
- {
212
- "displayName": "google/gemma-7b-it",
213
- "functionCall": true,
214
- "id": "google/gemma-7b-it",
215
- "isCustom": true,
216
- "vision": true,
217
- },
218
- {
219
- "displayName": "Mistral-7B-Instruct",
220
- "functionCall": true,
221
- "id": "mistralai/mistral-7b-instruct",
222
- "isCustom": true,
223
- "vision": true,
224
- },
225
- ],
226
- "enabled": true,
227
- "id": "openrouter",
228
- },
229
- ]
230
- `;
File without changes