@lobehub/chat 1.44.2 → 1.45.0

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 (324) hide show
  1. package/.remarkrc.mdx.js +6 -0
  2. package/CHANGELOG.md +50 -0
  3. package/changelog/v1.json +18 -0
  4. package/docs/changelog/2023-09-09-plugin-system.mdx +5 -0
  5. package/docs/changelog/2023-09-09-plugin-system.zh-CN.mdx +5 -0
  6. package/docs/changelog/2023-11-14-gpt4-vision.mdx +6 -0
  7. package/docs/changelog/2023-11-14-gpt4-vision.zh-CN.mdx +6 -0
  8. package/docs/changelog/2023-11-19-tts-stt.mdx +6 -0
  9. package/docs/changelog/2023-11-19-tts-stt.zh-CN.mdx +7 -0
  10. package/docs/changelog/2023-12-22-dalle-3.mdx +6 -0
  11. package/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx +4 -0
  12. package/docs/changelog/2024-02-08-sso-oauth.mdx +6 -0
  13. package/docs/changelog/2024-02-08-sso-oauth.zh-CN.mdx +6 -0
  14. package/docs/changelog/2024-02-14-ollama.mdx +6 -0
  15. package/docs/changelog/2024-02-14-ollama.zh-CN.mdx +5 -0
  16. package/docs/changelog/2024-06-19-lobe-chat-v1.mdx +6 -0
  17. package/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx +5 -0
  18. package/docs/changelog/2024-07-19-gpt-4o-mini.mdx +5 -0
  19. package/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx +4 -0
  20. package/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx +6 -0
  21. package/docs/changelog/2024-08-02-lobe-chat-database-docker.zh-CN.mdx +5 -0
  22. package/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx +6 -0
  23. package/docs/changelog/2024-08-21-file-upload-and-knowledge-base.zh-CN.mdx +5 -0
  24. package/docs/changelog/2024-09-13-openai-o1-models.mdx +6 -0
  25. package/docs/changelog/2024-09-13-openai-o1-models.zh-CN.mdx +6 -0
  26. package/docs/changelog/2024-09-20-artifacts.mdx +6 -0
  27. package/docs/changelog/2024-09-20-artifacts.zh-CN.mdx +6 -0
  28. package/docs/changelog/2024-10-27-pin-assistant.mdx +5 -0
  29. package/docs/changelog/2024-10-27-pin-assistant.zh-CN.mdx +4 -0
  30. package/docs/changelog/2024-11-06-share-text-json.mdx +4 -0
  31. package/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx +4 -0
  32. package/docs/changelog/2024-11-25-november-providers.mdx +7 -0
  33. package/docs/changelog/2024-11-25-november-providers.zh-CN.mdx +7 -0
  34. package/docs/changelog/2024-11-27-forkable-chat.mdx +4 -0
  35. package/docs/changelog/2024-11-27-forkable-chat.zh-CN.mdx +5 -0
  36. package/docs/changelog/2025-01-03-user-profile.mdx +5 -0
  37. package/docs/changelog/2025-01-03-user-profile.zh-CN.mdx +4 -1
  38. package/docs/self-hosting/advanced/auth/clerk.mdx +25 -41
  39. package/docs/self-hosting/advanced/auth/clerk.zh-CN.mdx +23 -37
  40. package/docs/self-hosting/advanced/auth/next-auth/auth0.mdx +31 -58
  41. package/docs/self-hosting/advanced/auth/next-auth/auth0.zh-CN.mdx +30 -57
  42. package/docs/self-hosting/advanced/auth/next-auth/authelia.mdx +38 -38
  43. package/docs/self-hosting/advanced/auth/next-auth/authelia.zh-CN.mdx +37 -38
  44. package/docs/self-hosting/advanced/auth/next-auth/authentik.mdx +26 -31
  45. package/docs/self-hosting/advanced/auth/next-auth/authentik.zh-CN.mdx +25 -30
  46. package/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx +74 -75
  47. package/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx +72 -73
  48. package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx +24 -25
  49. package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx +23 -24
  50. package/docs/self-hosting/advanced/auth/next-auth/github.mdx +46 -73
  51. package/docs/self-hosting/advanced/auth/next-auth/github.zh-CN.mdx +43 -70
  52. package/docs/self-hosting/advanced/auth/next-auth/logto.mdx +28 -37
  53. package/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx +28 -37
  54. package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx +36 -49
  55. package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx +30 -43
  56. package/docs/self-hosting/advanced/auth/next-auth/wechat.mdx +13 -14
  57. package/docs/self-hosting/advanced/auth/next-auth/wechat.zh-CN.mdx +14 -15
  58. package/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx +35 -69
  59. package/docs/self-hosting/advanced/auth/next-auth/zitadel.zh-CN.mdx +34 -68
  60. package/docs/self-hosting/advanced/auth.mdx +14 -13
  61. package/docs/self-hosting/advanced/auth.zh-CN.mdx +15 -14
  62. package/docs/self-hosting/advanced/feature-flags.zh-CN.mdx +15 -15
  63. package/docs/self-hosting/advanced/knowledge-base.mdx +14 -3
  64. package/docs/self-hosting/advanced/knowledge-base.zh-CN.mdx +12 -3
  65. package/docs/self-hosting/advanced/model-list.zh-CN.mdx +5 -5
  66. package/docs/self-hosting/advanced/s3/cloudflare-r2.mdx +52 -81
  67. package/docs/self-hosting/advanced/s3/cloudflare-r2.zh-CN.mdx +51 -80
  68. package/docs/self-hosting/advanced/s3/tencent-cloud.mdx +20 -34
  69. package/docs/self-hosting/advanced/s3/tencent-cloud.zh-CN.mdx +28 -43
  70. package/docs/self-hosting/advanced/s3.mdx +30 -34
  71. package/docs/self-hosting/advanced/s3.zh-CN.mdx +28 -33
  72. package/docs/self-hosting/advanced/settings-url-share.mdx +6 -6
  73. package/docs/self-hosting/advanced/settings-url-share.zh-CN.mdx +19 -19
  74. package/docs/self-hosting/advanced/upstream-sync.mdx +73 -89
  75. package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +71 -87
  76. package/docs/self-hosting/advanced/webrtc.mdx +14 -21
  77. package/docs/self-hosting/advanced/webrtc.zh-CN.mdx +19 -26
  78. package/docs/self-hosting/environment-variables/analytics.zh-CN.mdx +0 -3
  79. package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +1 -1
  80. package/docs/self-hosting/environment-variables/basic.mdx +13 -13
  81. package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +15 -15
  82. package/docs/self-hosting/environment-variables/model-provider.mdx +1 -1
  83. package/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +1 -1
  84. package/docs/self-hosting/environment-variables/s3.mdx +3 -4
  85. package/docs/self-hosting/environment-variables/s3.zh-CN.mdx +5 -7
  86. package/docs/self-hosting/environment-variables.mdx +8 -4
  87. package/docs/self-hosting/environment-variables.zh-CN.mdx +4 -0
  88. package/docs/self-hosting/examples/azure-openai.mdx +9 -12
  89. package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +8 -11
  90. package/docs/self-hosting/examples/ollama.mdx +8 -7
  91. package/docs/self-hosting/examples/ollama.zh-CN.mdx +8 -7
  92. package/docs/self-hosting/platform/alibaba-cloud.mdx +5 -7
  93. package/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx +5 -7
  94. package/docs/self-hosting/platform/btpanel.mdx +3 -2
  95. package/docs/self-hosting/platform/btpanel.zh-CN.mdx +3 -3
  96. package/docs/self-hosting/platform/docker-compose.mdx +75 -85
  97. package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +75 -85
  98. package/docs/self-hosting/platform/docker.mdx +87 -92
  99. package/docs/self-hosting/platform/docker.zh-CN.mdx +96 -115
  100. package/docs/self-hosting/platform/netlify.mdx +44 -94
  101. package/docs/self-hosting/platform/netlify.zh-CN.mdx +40 -90
  102. package/docs/self-hosting/platform/railway.mdx +6 -7
  103. package/docs/self-hosting/platform/railway.zh-CN.mdx +6 -7
  104. package/docs/self-hosting/platform/repocloud.mdx +6 -7
  105. package/docs/self-hosting/platform/repocloud.zh-CN.mdx +6 -7
  106. package/docs/self-hosting/platform/sealos.mdx +6 -7
  107. package/docs/self-hosting/platform/sealos.zh-CN.mdx +6 -7
  108. package/docs/self-hosting/platform/vercel.mdx +7 -8
  109. package/docs/self-hosting/platform/vercel.zh-CN.mdx +7 -8
  110. package/docs/self-hosting/platform/zeabur.mdx +29 -32
  111. package/docs/self-hosting/platform/zeabur.zh-CN.mdx +29 -32
  112. package/docs/self-hosting/server-database/docker-compose.mdx +44 -71
  113. package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +44 -71
  114. package/docs/self-hosting/server-database/docker.mdx +84 -88
  115. package/docs/self-hosting/server-database/docker.zh-CN.mdx +87 -91
  116. package/docs/self-hosting/server-database/dokploy.mdx +18 -1
  117. package/docs/self-hosting/server-database/dokploy.zh-CN.mdx +84 -68
  118. package/docs/self-hosting/server-database/repocloud.mdx +7 -9
  119. package/docs/self-hosting/server-database/repocloud.zh-CN.mdx +9 -11
  120. package/docs/self-hosting/server-database/vercel.mdx +158 -243
  121. package/docs/self-hosting/server-database/vercel.zh-CN.mdx +137 -205
  122. package/docs/self-hosting/server-database/zeabur.mdx +21 -23
  123. package/docs/self-hosting/server-database/zeabur.zh-CN.mdx +20 -22
  124. package/docs/self-hosting/server-database.mdx +34 -36
  125. package/docs/self-hosting/server-database.zh-CN.mdx +34 -37
  126. package/docs/self-hosting/start.mdx +1 -4
  127. package/docs/self-hosting/start.zh-CN.mdx +1 -1
  128. package/docs/usage/agents/agent-organization.mdx +5 -21
  129. package/docs/usage/agents/agent-organization.zh-CN.mdx +5 -21
  130. package/docs/usage/agents/concepts.mdx +4 -4
  131. package/docs/usage/agents/concepts.zh-CN.mdx +4 -4
  132. package/docs/usage/agents/custom-agent.mdx +2 -2
  133. package/docs/usage/agents/custom-agent.zh-CN.mdx +2 -2
  134. package/docs/usage/agents/model.mdx +4 -4
  135. package/docs/usage/agents/model.zh-CN.mdx +6 -6
  136. package/docs/usage/agents/prompt.mdx +5 -6
  137. package/docs/usage/agents/prompt.zh-CN.mdx +5 -6
  138. package/docs/usage/agents/topics.mdx +2 -2
  139. package/docs/usage/agents/topics.zh-CN.mdx +2 -2
  140. package/docs/usage/features/agent-market.mdx +2 -2
  141. package/docs/usage/features/agent-market.zh-CN.mdx +2 -2
  142. package/docs/usage/features/auth.mdx +1 -5
  143. package/docs/usage/features/auth.zh-CN.mdx +1 -5
  144. package/docs/usage/features/database.mdx +1 -5
  145. package/docs/usage/features/database.zh-CN.mdx +1 -5
  146. package/docs/usage/features/local-llm.mdx +2 -6
  147. package/docs/usage/features/local-llm.zh-CN.mdx +2 -6
  148. package/docs/usage/features/mobile.mdx +1 -5
  149. package/docs/usage/features/mobile.zh-CN.mdx +1 -5
  150. package/docs/usage/features/multi-ai-providers.mdx +3 -11
  151. package/docs/usage/features/multi-ai-providers.zh-CN.mdx +3 -11
  152. package/docs/usage/features/plugin-system.mdx +9 -10
  153. package/docs/usage/features/plugin-system.zh-CN.mdx +9 -10
  154. package/docs/usage/features/pwa.mdx +11 -25
  155. package/docs/usage/features/pwa.zh-CN.mdx +11 -25
  156. package/docs/usage/features/text-to-image.mdx +2 -2
  157. package/docs/usage/features/text-to-image.zh-CN.mdx +2 -2
  158. package/docs/usage/features/theme.mdx +1 -6
  159. package/docs/usage/features/theme.zh-CN.mdx +1 -6
  160. package/docs/usage/features/tts.mdx +3 -7
  161. package/docs/usage/features/tts.zh-CN.mdx +3 -7
  162. package/docs/usage/features/vision.mdx +2 -2
  163. package/docs/usage/features/vision.zh-CN.mdx +2 -2
  164. package/docs/usage/foundation/basic.mdx +7 -18
  165. package/docs/usage/foundation/basic.zh-CN.mdx +6 -16
  166. package/docs/usage/foundation/share.mdx +3 -13
  167. package/docs/usage/foundation/share.zh-CN.mdx +3 -13
  168. package/docs/usage/foundation/text2image.mdx +3 -12
  169. package/docs/usage/foundation/text2image.zh-CN.mdx +3 -12
  170. package/docs/usage/foundation/translate.mdx +3 -13
  171. package/docs/usage/foundation/translate.zh-CN.mdx +3 -13
  172. package/docs/usage/foundation/tts-stt.mdx +3 -12
  173. package/docs/usage/foundation/tts-stt.zh-CN.mdx +3 -12
  174. package/docs/usage/foundation/vision.mdx +4 -16
  175. package/docs/usage/foundation/vision.zh-CN.mdx +4 -16
  176. package/docs/usage/plugins/basic-usage.mdx +7 -30
  177. package/docs/usage/plugins/basic-usage.zh-CN.mdx +7 -30
  178. package/docs/usage/plugins/development.mdx +30 -78
  179. package/docs/usage/plugins/development.zh-CN.mdx +31 -79
  180. package/docs/usage/plugins/store.mdx +2 -10
  181. package/docs/usage/plugins/store.zh-CN.mdx +2 -10
  182. package/docs/usage/providers/ai21.mdx +17 -33
  183. package/docs/usage/providers/ai21.zh-CN.mdx +17 -33
  184. package/docs/usage/providers/ai360.mdx +17 -33
  185. package/docs/usage/providers/ai360.zh-CN.mdx +20 -36
  186. package/docs/usage/providers/anthropic.mdx +23 -45
  187. package/docs/usage/providers/anthropic.zh-CN.mdx +22 -44
  188. package/docs/usage/providers/azure.mdx +21 -51
  189. package/docs/usage/providers/azure.zh-CN.mdx +19 -48
  190. package/docs/usage/providers/baichuan.mdx +16 -34
  191. package/docs/usage/providers/baichuan.zh-CN.mdx +15 -33
  192. package/docs/usage/providers/bedrock.mdx +38 -87
  193. package/docs/usage/providers/bedrock.zh-CN.mdx +37 -86
  194. package/docs/usage/providers/cloudflare.mdx +25 -48
  195. package/docs/usage/providers/cloudflare.zh-CN.mdx +24 -45
  196. package/docs/usage/providers/deepseek.mdx +25 -51
  197. package/docs/usage/providers/deepseek.zh-CN.mdx +24 -50
  198. package/docs/usage/providers/fireworksai.mdx +23 -43
  199. package/docs/usage/providers/fireworksai.zh-CN.mdx +21 -41
  200. package/docs/usage/providers/gemini.mdx +20 -46
  201. package/docs/usage/providers/gemini.zh-CN.mdx +20 -46
  202. package/docs/usage/providers/giteeai.mdx +24 -45
  203. package/docs/usage/providers/giteeai.zh-CN.mdx +22 -43
  204. package/docs/usage/providers/github.mdx +19 -45
  205. package/docs/usage/providers/github.zh-CN.mdx +19 -44
  206. package/docs/usage/providers/groq.mdx +12 -29
  207. package/docs/usage/providers/groq.zh-CN.mdx +11 -28
  208. package/docs/usage/providers/hunyuan.mdx +19 -39
  209. package/docs/usage/providers/hunyuan.zh-CN.mdx +18 -38
  210. package/docs/usage/providers/internlm.mdx +21 -38
  211. package/docs/usage/providers/internlm.zh-CN.mdx +19 -36
  212. package/docs/usage/providers/minimax.mdx +24 -50
  213. package/docs/usage/providers/minimax.zh-CN.mdx +22 -48
  214. package/docs/usage/providers/mistral.mdx +21 -39
  215. package/docs/usage/providers/mistral.zh-CN.mdx +20 -38
  216. package/docs/usage/providers/moonshot.mdx +20 -38
  217. package/docs/usage/providers/moonshot.zh-CN.mdx +19 -37
  218. package/docs/usage/providers/novita.mdx +20 -43
  219. package/docs/usage/providers/novita.zh-CN.mdx +19 -42
  220. package/docs/usage/providers/ollama/gemma.mdx +12 -29
  221. package/docs/usage/providers/ollama/gemma.zh-CN.mdx +12 -30
  222. package/docs/usage/providers/ollama/qwen.mdx +17 -32
  223. package/docs/usage/providers/ollama/qwen.zh-CN.mdx +12 -27
  224. package/docs/usage/providers/ollama.mdx +67 -99
  225. package/docs/usage/providers/ollama.zh-CN.mdx +67 -99
  226. package/docs/usage/providers/openai.mdx +42 -56
  227. package/docs/usage/providers/openai.zh-CN.mdx +39 -52
  228. package/docs/usage/providers/openrouter.mdx +48 -84
  229. package/docs/usage/providers/openrouter.zh-CN.mdx +31 -67
  230. package/docs/usage/providers/perplexity.mdx +16 -34
  231. package/docs/usage/providers/perplexity.zh-CN.mdx +16 -34
  232. package/docs/usage/providers/qwen.mdx +26 -52
  233. package/docs/usage/providers/qwen.zh-CN.mdx +25 -51
  234. package/docs/usage/providers/sensenova.mdx +24 -45
  235. package/docs/usage/providers/sensenova.zh-CN.mdx +22 -43
  236. package/docs/usage/providers/siliconcloud.mdx +17 -33
  237. package/docs/usage/providers/siliconcloud.zh-CN.mdx +17 -33
  238. package/docs/usage/providers/spark.mdx +20 -40
  239. package/docs/usage/providers/spark.zh-CN.mdx +19 -39
  240. package/docs/usage/providers/stepfun.mdx +17 -35
  241. package/docs/usage/providers/stepfun.zh-CN.mdx +17 -35
  242. package/docs/usage/providers/taichu.mdx +16 -34
  243. package/docs/usage/providers/taichu.zh-CN.mdx +15 -33
  244. package/docs/usage/providers/togetherai.mdx +18 -40
  245. package/docs/usage/providers/togetherai.zh-CN.mdx +18 -40
  246. package/docs/usage/providers/upstage.mdx +18 -34
  247. package/docs/usage/providers/upstage.zh-CN.mdx +17 -33
  248. package/docs/usage/providers/wenxin.mdx +22 -42
  249. package/docs/usage/providers/wenxin.zh-CN.mdx +20 -40
  250. package/docs/usage/providers/xai.mdx +21 -38
  251. package/docs/usage/providers/xai.zh-CN.mdx +20 -37
  252. package/docs/usage/providers/zeroone.mdx +22 -48
  253. package/docs/usage/providers/zeroone.zh-CN.mdx +22 -48
  254. package/docs/usage/providers/zhipu.mdx +17 -35
  255. package/docs/usage/providers/zhipu.zh-CN.mdx +18 -34
  256. package/docs/usage/providers.mdx +1 -6
  257. package/docs/usage/providers.zh-CN.mdx +1 -6
  258. package/docs/usage/start.mdx +4 -18
  259. package/docs/usage/start.zh-CN.mdx +2 -19
  260. package/docs/usage/tools-calling/anthropic.mdx +18 -51
  261. package/docs/usage/tools-calling/anthropic.zh-CN.mdx +22 -55
  262. package/docs/usage/tools-calling/google.mdx +16 -23
  263. package/docs/usage/tools-calling/google.zh-CN.mdx +17 -24
  264. package/docs/usage/tools-calling/groq.mdx +9 -0
  265. package/docs/usage/tools-calling/groq.zh-CN.mdx +44 -70
  266. package/docs/usage/tools-calling/moonshot.mdx +9 -0
  267. package/docs/usage/tools-calling/openai.mdx +19 -44
  268. package/docs/usage/tools-calling/openai.zh-CN.mdx +20 -45
  269. package/docs/usage/tools-calling.mdx +9 -0
  270. package/docs/usage/tools-calling.zh-CN.mdx +60 -68
  271. package/package.json +42 -41
  272. package/scripts/mdxWorkflow/index.ts +7 -0
  273. package/src/app/(main)/(mobile)/me/(home)/features/Header.tsx +2 -1
  274. package/src/app/(main)/(mobile)/me/data/features/Header.tsx +1 -1
  275. package/src/app/(main)/(mobile)/me/profile/features/Header.tsx +1 -1
  276. package/src/app/(main)/(mobile)/me/settings/features/Header.tsx +1 -1
  277. package/src/app/(main)/@nav/_layout/Mobile.tsx +2 -1
  278. package/src/app/(main)/chat/(workspace)/@topic/features/SystemRole/SystemRoleContent.tsx +2 -1
  279. package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/ByTimeMode/GroupItem.tsx +2 -2
  280. package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx +2 -1
  281. package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/index.tsx +1 -1
  282. package/src/app/(main)/chat/(workspace)/_layout/Mobile/ChatHeader/ChatHeaderTitle.tsx +2 -1
  283. package/src/app/(main)/chat/(workspace)/_layout/Mobile/ChatHeader/index.tsx +1 -1
  284. package/src/app/(main)/chat/@session/_layout/Mobile/SessionHeader.tsx +2 -1
  285. package/src/app/(main)/chat/settings/_layout/Desktop/Header.tsx +1 -1
  286. package/src/app/(main)/chat/settings/_layout/Mobile/Header.tsx +1 -1
  287. package/src/app/(main)/discover/(detail)/provider/[slug]/features/InfoSidebar/SuggestionItem.tsx +8 -6
  288. package/src/app/(main)/discover/(list)/_layout/Desktop/Nav.tsx +1 -1
  289. package/src/app/(main)/discover/(list)/_layout/Mobile/Header.tsx +2 -1
  290. package/src/app/(main)/discover/_layout/Desktop/Header.tsx +1 -1
  291. package/src/app/(main)/discover/components/VirtuosoGridList/index.tsx +9 -5
  292. package/src/app/(main)/discover/search/_layout/Mobile/Header.tsx +1 -1
  293. package/src/app/(main)/files/(content)/@menu/features/KnowledgeBase/EmptyStatus.tsx +21 -13
  294. package/src/app/(main)/repos/[id]/evals/evaluation/EvaluationList/index.tsx +1 -1
  295. package/src/app/(main)/settings/sync/features/DeviceInfo/SystemIcon.tsx +2 -0
  296. package/src/components/Branding/ProductLogo/Custom.tsx +19 -20
  297. package/src/components/BrowserIcon/index.tsx +19 -30
  298. package/src/components/BubblesLoading/index.tsx +31 -23
  299. package/src/components/FunctionModal/createModalHooks.ts +6 -3
  300. package/src/components/StopLoading.tsx +10 -7
  301. package/src/database/repositories/aiInfra/index.ts +19 -7
  302. package/src/database/server/models/__tests__/aiModel.test.ts +4 -6
  303. package/src/database/server/models/aiModel.ts +6 -3
  304. package/src/features/ChatInput/Desktop/InputArea/index.tsx +2 -2
  305. package/src/features/InitClientDB/EnableModal.tsx +2 -2
  306. package/src/features/InitClientDB/{PGliteSVG.tsx → PGliteIcon.tsx} +17 -11
  307. package/src/features/ShareModal/ShareImage/index.tsx +32 -22
  308. package/src/features/ShareModal/ShareJSON/Preview.tsx +2 -2
  309. package/src/features/ShareModal/ShareJSON/index.tsx +49 -37
  310. package/src/features/ShareModal/ShareText/Preview.tsx +4 -1
  311. package/src/features/ShareModal/ShareText/index.tsx +49 -38
  312. package/src/features/ShareModal/index.tsx +1 -1
  313. package/src/features/ShareModal/style.ts +30 -0
  314. package/src/store/aiInfra/slices/aiProvider/action.ts +1 -1
  315. package/src/types/aiProvider.ts +1 -0
  316. package/src/utils/colorUtils.ts +1 -1
  317. package/src/components/BrowserIcon/components/Brave.tsx +0 -56
  318. package/src/components/BrowserIcon/components/Chrome.tsx +0 -14
  319. package/src/components/BrowserIcon/components/Chromium.tsx +0 -14
  320. package/src/components/BrowserIcon/components/Edge.tsx +0 -36
  321. package/src/components/BrowserIcon/components/Firefox.tsx +0 -38
  322. package/src/components/BrowserIcon/components/Opera.tsx +0 -19
  323. package/src/components/BrowserIcon/components/Safari.tsx +0 -23
  324. package/src/components/BrowserIcon/components/Samsung.tsx +0 -21
@@ -11,151 +11,130 @@ tags:
11
11
 
12
12
  # 在 LobeChat 中使用 Ollama
13
13
 
14
- <Image
15
- alt={'在 LobeChat 中使用 Ollama'}
16
- borderless
17
- cover
18
- src={'https://github.com/lobehub/lobe-chat/assets/17870709/f579b39b-e771-402c-a1d1-620e57a10c75'}
19
- />
14
+ <Image alt={'在 LobeChat 中使用 Ollama'} borderless cover src={'https://github.com/lobehub/lobe-chat/assets/17870709/f579b39b-e771-402c-a1d1-620e57a10c75'} />
20
15
 
21
16
  Ollama 是一款强大的本地运行大型语言模型(LLM)的框架,支持多种语言模型,包括 Llama 2, Mistral 等。现在,LobeChat 已经支持与 Ollama 的集成,这意味着你可以在 LobeChat 中轻松使用 Ollama 提供的语言模型来增强你的应用。
22
17
 
23
18
  本文档将指导你如何在 LobeChat 中使用 Ollama:
24
19
 
25
- <Video
26
- alt={'在 LobeChat 中使用 Ollama的完整演示'}
27
- height={580}
28
- src="https://github.com/lobehub/lobe-chat/assets/28616219/c32b56db-c6a1-4876-9bc3-acbd37ec0c0c"
29
- />
20
+ <Video alt={'在 LobeChat 中使用 Ollama的完整演示'} height={580} src="https://github.com/lobehub/lobe-chat/assets/28616219/c32b56db-c6a1-4876-9bc3-acbd37ec0c0c" />
30
21
 
31
22
  ## 在 macOS 下使用 Ollama
32
23
 
33
24
  <Steps>
25
+ ### 本地安装 Ollama
34
26
 
35
- ### 本地安装 Ollama
27
+ [下载 Ollama for macOS](https://ollama.com/download?utm_source=lobehub\&utm_medium=docs\&utm_campaign=download-macos) 并解压、安装。
36
28
 
37
- [下载 Ollama for macOS](https://ollama.com/download?utm_source=lobehub&utm_medium=docs&utm_campaign=download-macos) 并解压、安装。
29
+ ### 配置 Ollama 允许跨域访问
38
30
 
39
- ### 配置 Ollama 允许跨域访问
31
+ 由于 Ollama 的默认参数配置,启动时设置了仅本地访问,所以跨域访问以及端口监听需要进行额外的环境变量设置 `OLLAMA_ORIGINS`。使用 `launchctl` 设置环境变量:
40
32
 
41
- 由于 Ollama 的默认参数配置,启动时设置了仅本地访问,所以跨域访问以及端口监听需要进行额外的环境变量设置 `OLLAMA_ORIGINS`。使用 `launchctl` 设置环境变量:
33
+ ```bash
34
+ launchctl setenv OLLAMA_ORIGINS "*"
35
+ ```
42
36
 
43
- ```bash
44
- launchctl setenv OLLAMA_ORIGINS "*"
45
- ```
46
-
47
- 完成设置后,需要重启 Ollama 应用程序。
37
+ 完成设置后,需要重启 Ollama 应用程序。
48
38
 
49
- ### 在 LobeChat 中与本地大模型对话
39
+ ### 在 LobeChat 中与本地大模型对话
50
40
 
51
- 接下来,你就可以使用 LobeChat 与本地 LLM 对话了。
52
-
53
- <Image
54
- alt="在 LobeChat 中与 llama3 对话"
55
- height="573"
56
- src="https://github.com/lobehub/lobe-chat/assets/28616219/7f9a9a9f-fd91-4f59-aac9-3f26c6d49a1e"
57
- />
41
+ 接下来,你就可以使用 LobeChat 与本地 LLM 对话了。
58
42
 
43
+ <Image alt="在 LobeChat 中与 llama3 对话" height="573" src="https://github.com/lobehub/lobe-chat/assets/28616219/7f9a9a9f-fd91-4f59-aac9-3f26c6d49a1e" />
59
44
  </Steps>
60
45
 
61
46
  ## 在 windows 下使用 Ollama
62
47
 
63
48
  <Steps>
49
+ ### 本地安装 Ollama
64
50
 
65
- ### 本地安装 Ollama
66
-
67
- [下载 Ollama for Windows](https://ollama.com/download?utm_source=lobehub&utm_medium=docs&utm_campaign=download-windows) 并安装。
68
-
69
- ### 配置 Ollama 允许跨域访问
51
+ [下载 Ollama for Windows](https://ollama.com/download?utm_source=lobehub\&utm_medium=docs\&utm_campaign=download-windows) 并安装。
70
52
 
71
- 由于 Ollama 的默认参数配置,启动时设置了仅本地访问,所以跨域访问以及端口监听需要进行额外的环境变量设置 `OLLAMA_ORIGINS`。
53
+ ### 配置 Ollama 允许跨域访问
72
54
 
73
- Windows 上,Ollama 继承了您的用户和系统环境变量。
55
+ 由于 Ollama 的默认参数配置,启动时设置了仅本地访问,所以跨域访问以及端口监听需要进行额外的环境变量设置 `OLLAMA_ORIGINS`。
74
56
 
75
- 1. 首先通过 Windows 任务栏点击 Ollama 退出程序。
76
- 2. 从控制面板编辑系统环境变量。
77
- 3. 为您的用户账户编辑或新建 Ollama 的环境变量 `OLLAMA_ORIGINS`,值设为 `*` 。
78
- 4. 点击`OK/应用`保存后重启系统。
79
- 5. 重新运行`Ollama`。
57
+ Windows 上,Ollama 继承了您的用户和系统环境变量。
80
58
 
81
- ### LobeChat 中与本地大模型对话
59
+ 1. 首先通过 Windows 任务栏点击 Ollama 退出程序。
60
+ 2. 从控制面板编辑系统环境变量。
61
+ 3. 为您的用户账户编辑或新建 Ollama 的环境变量 `OLLAMA_ORIGINS`,值设为 `*` 。
62
+ 4. 点击`OK/应用`保存后重启系统。
63
+ 5. 重新运行`Ollama`。
82
64
 
83
- 接下来,你就可以使用 LobeChat 与本地 LLM 对话了。
65
+ ### LobeChat 中与本地大模型对话
84
66
 
67
+ 接下来,你就可以使用 LobeChat 与本地 LLM 对话了。
85
68
  </Steps>
86
69
 
87
70
  ## 在 linux 下使用 Ollama
88
71
 
89
72
  <Steps>
73
+ ### 本地安装 Ollama
90
74
 
91
- ### 本地安装 Ollama
75
+ 通过以下命令安装:
92
76
 
93
- 通过以下命令安装:
77
+ ```bash
78
+ curl -fsSL https://ollama.com/install.sh | sh
79
+ ```
94
80
 
95
- ```bash
96
- curl -fsSL https://ollama.com/install.sh | sh
97
- ```
98
-
99
- 或者,你也可以参考 [Linux 手动安装指南](https://github.com/ollama/ollama/blob/main/docs/linux.md)。
81
+ 或者,你也可以参考 [Linux 手动安装指南](https://github.com/ollama/ollama/blob/main/docs/linux.md)。
100
82
 
101
- ### 配置 Ollama 允许跨域访问
83
+ ### 配置 Ollama 允许跨域访问
102
84
 
103
- 由于 Ollama 的默认参数配置,启动时设置了仅本地访问,所以跨域访问以及端口监听需要进行额外的环境变量设置 `OLLAMA_ORIGINS`。如果 Ollama 作为 systemd 服务运行,应该使用`systemctl`设置环境变量:
85
+ 由于 Ollama 的默认参数配置,启动时设置了仅本地访问,所以跨域访问以及端口监听需要进行额外的环境变量设置 `OLLAMA_ORIGINS`。如果 Ollama 作为 systemd 服务运行,应该使用`systemctl`设置环境变量:
104
86
 
105
- 1. 通过调用`sudo systemctl edit ollama.service`编辑 systemd 服务。
106
-
107
- ```bash
108
- sudo systemctl edit ollama.service
109
- ```
87
+ 1. 通过调用`sudo systemctl edit ollama.service`编辑 systemd 服务。
110
88
 
111
- 2. 对于每个环境变量,在`[Service]`部分下添加`Environment`:
89
+ ```bash
90
+ sudo systemctl edit ollama.service
91
+ ```
112
92
 
113
- ```bash
114
- [Service]
115
- Environment="OLLAMA_HOST=0.0.0.0"
116
- Environment="OLLAMA_ORIGINS=*"
117
- ```
93
+ 2. 对于每个环境变量,在`[Service]`部分下添加`Environment`:
118
94
 
119
- 3. 保存并退出。
120
- 4. 重载 `systemd` 并重启 Ollama:
95
+ ```bash
96
+ [Service]
97
+ Environment="OLLAMA_HOST=0.0.0.0"
98
+ Environment="OLLAMA_ORIGINS=*"
99
+ ```
121
100
 
122
- ```bash
123
- sudo systemctl daemon-reload
124
- sudo systemctl restart ollama
125
- ```
101
+ 3. 保存并退出。
102
+ 4. 重载 `systemd` 并重启 Ollama:
126
103
 
127
- ### 在 LobeChat 中与本地大模型对话
104
+ ```bash
105
+ sudo systemctl daemon-reload
106
+ sudo systemctl restart ollama
107
+ ```
128
108
 
129
- 接下来,你就可以使用 LobeChat 与本地 LLM 对话了。
109
+ ### LobeChat 中与本地大模型对话
130
110
 
111
+ 接下来,你就可以使用 LobeChat 与本地 LLM 对话了。
131
112
  </Steps>
132
113
 
133
114
  ## 使用 docker 部署使用 Ollama
134
115
 
135
116
  <Steps>
117
+ ### 拉取 Ollama 镜像
136
118
 
137
- ### 拉取 Ollama 镜像
119
+ 如果你更倾向于使用 Docker,Ollama 也提供了官方 Docker 镜像,你可以通过以下命令拉取:
138
120
 
139
- 如果你更倾向于使用 Docker,Ollama 也提供了官方 Docker 镜像,你可以通过以下命令拉取:
121
+ ```bash
122
+ docker pull ollama/ollama
123
+ ```
140
124
 
141
- ```bash
142
- docker pull ollama/ollama
143
- ```
144
-
145
- ### 配置 Ollama 允许跨域访问
146
-
147
- 由于 Ollama 的默认参数配置,启动时设置了仅本地访问,所以跨域访问以及端口监听需要进行额外的环境变量设置 `OLLAMA_ORIGINS`。
125
+ ### 配置 Ollama 允许跨域访问
148
126
 
149
- 如果 Ollama 作为 Docker 容器运行,你可以将环境变量添加到 `docker run` 命令中。
127
+ 由于 Ollama 的默认参数配置,启动时设置了仅本地访问,所以跨域访问以及端口监听需要进行额外的环境变量设置 `OLLAMA_ORIGINS`。
150
128
 
151
- ```bash
152
- docker run -d --gpus=all -v ollama:/root/.ollama -e OLLAMA_ORIGINS="*" -p 11434:11434 --name ollama ollama/ollama
153
- ```
129
+ 如果 Ollama 作为 Docker 容器运行,你可以将环境变量添加到 `docker run` 命令中。
154
130
 
155
- ### 在 LobeChat 中与本地大模型对话
131
+ ```bash
132
+ docker run -d --gpus=all -v ollama:/root/.ollama -e OLLAMA_ORIGINS="*" -p 11434:11434 --name ollama ollama/ollama
133
+ ```
156
134
 
157
- 接下来,你就可以使用 LobeChat 与本地 LLM 对话了。
135
+ ### LobeChat 中与本地大模型对话
158
136
 
137
+ 接下来,你就可以使用 LobeChat 与本地 LLM 对话了。
159
138
  </Steps>
160
139
 
161
140
  ## 安装 Ollama 模型
@@ -166,11 +145,7 @@ Ollama 支持多种模型,你可以在 [Ollama Library](https://ollama.com/lib
166
145
 
167
146
  在 LobeChat 中,我们默认开启了一些常用的大语言模型,例如 llama3、 Gemma 、 Mistral 等。当你选中模型进行对话时,我们会提示你需要下载该模型。
168
147
 
169
- <Image
170
- alt="LobeChat 提示安装 Ollama 模型"
171
- height="460"
172
- src="https://github.com/lobehub/lobe-chat/assets/28616219/4e81decc-776c-43b8-9a54-dfb43e9f601a"
173
- />
148
+ <Image alt="LobeChat 提示安装 Ollama 模型" height="460" src="https://github.com/lobehub/lobe-chat/assets/28616219/4e81decc-776c-43b8-9a54-dfb43e9f601a" />
174
149
 
175
150
  下载完成后即可开始对话。
176
151
 
@@ -182,20 +157,13 @@ Ollama 支持多种模型,你可以在 [Ollama Library](https://ollama.com/lib
182
157
  ollama pull llama3
183
158
  ```
184
159
 
185
- <Video
186
- height={524}
187
- src="https://github.com/lobehub/lobe-chat/assets/28616219/95828c11-0ae5-4dfa-84ed-854124e927a6"
188
- />
160
+ <Video height={524} src="https://github.com/lobehub/lobe-chat/assets/28616219/95828c11-0ae5-4dfa-84ed-854124e927a6" />
189
161
 
190
162
  ## 自定义配置
191
163
 
192
164
  你可以在 `设置` -> `语言模型` 中找到 Ollama 的配置选项,你可以在这里配置 Ollama 的代理、模型名称等。
193
165
 
194
- <Image
195
- alt={'Ollama 服务商设置'}
196
- height={274}
197
- src={'https://github.com/lobehub/lobe-chat/assets/28616219/54b3696b-5b13-4761-8c1b-1e664867b2dd'}
198
- />
166
+ <Image alt={'Ollama 服务商设置'} height={274} src={'https://github.com/lobehub/lobe-chat/assets/28616219/54b3696b-5b13-4761-8c1b-1e664867b2dd'} />
199
167
 
200
168
  <Callout type={'info'}>
201
169
  你可以前往 [与 Ollama 集成](/zh/docs/self-hosting/examples/ollama) 了解如何部署 LobeChat
@@ -14,81 +14,67 @@ tags:
14
14
 
15
15
  # Using OpenAI in LobeChat
16
16
 
17
- <Image
18
- alt={'Using OpenAI in LobeChat'}
19
- cover
20
- src={'https://github.com/lobehub/lobe-chat/assets/17870709/c9e5eafc-ca22-496b-a88d-cc0ae53bf720'}
21
- />
17
+ <Image alt={'Using OpenAI in LobeChat'} cover src={'https://github.com/lobehub/lobe-chat/assets/17870709/c9e5eafc-ca22-496b-a88d-cc0ae53bf720'} />
22
18
 
23
19
  This document will guide you on how to use [OpenAI](https://openai.com/) in LobeChat:
24
20
 
25
21
  <Steps>
22
+ ### Step 1: Obtain OpenAI API Key
26
23
 
27
- ### Step 1: Obtain OpenAI API Key
24
+ - Register for an [OpenAI account](https://platform.openai.com/signup). You will need to register using an international phone number and a non-mainland email address.
28
25
 
29
- - Register for an [OpenAI account](https://platform.openai.com/signup). You will need to register using an international phone number and a non-mainland email address.
26
+ - After registration, go to the [API Keys](https://platform.openai.com/api-keys) page and click on `Create new secret key` to generate a new API Key.
30
27
 
31
- - After registration, go to the [API Keys](https://platform.openai.com/api-keys) page and click on `Create new secret key` to generate a new API Key.
28
+ - Open the creation window
32
29
 
33
- - Open the creation window
30
+ <Image
31
+ alt={'Open the creation window'}
32
+ inStep
33
+ src={
34
+ 'https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296253192-ff2193dd-f125-4e58-82e8-91bc376c0d68.png'
35
+ }
36
+ />
34
37
 
35
- <Image
36
- alt={'Open the creation window'}
37
- inStep
38
- src={
39
- 'https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296253192-ff2193dd-f125-4e58-82e8-91bc376c0d68.png'
40
- }
41
- />
38
+ - Create API Key
42
39
 
43
- - Create API Key
40
+ <Image
41
+ alt={'Create API Key'}
42
+ inStep
43
+ src={
44
+ 'https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296254170-803bacf0-4471-4171-ae79-0eab08d621d1.png'
45
+ }
46
+ />
44
47
 
45
- <Image
46
- alt={'Create API Key'}
47
- inStep
48
- src={
49
- 'https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296254170-803bacf0-4471-4171-ae79-0eab08d621d1.png'
50
- }
51
- />
48
+ - Retrieve API Key
52
49
 
53
- - Retrieve API Key
50
+ <Image
51
+ alt={'Retrieve API Key'}
52
+ inStep
53
+ src={
54
+ 'https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296255167-f2745f2b-f083-4ba8-bc78-9b558e0002de.png'
55
+ }
56
+ />
54
57
 
55
- <Image
56
- alt={'Retrieve API Key'}
57
- inStep
58
- src={
59
- 'https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296255167-f2745f2b-f083-4ba8-bc78-9b558e0002de.png'
60
- }
61
- />
58
+ <Callout type={'warning'}>
59
+ After registering, you generally have a free credit of $5, but it is only valid for three months.
60
+ </Callout>
62
61
 
63
- <Callout type={'warning'}>
64
- After registering, you generally have a free credit of $5, but it is only valid for three months.
65
- </Callout>
62
+ ### Step 2: Configure OpenAI in LobeChat
66
63
 
67
- ### Step 2: Configure OpenAI in LobeChat
64
+ - Visit the `Settings` page in LobeChat
65
+ - Find the setting for `OpenAI` under `Language Model`
68
66
 
69
- - Visit the `Settings` page in LobeChat
70
- - Find the setting for `OpenAI` under `Language Model`
67
+ <Image alt={'Enter API Key'} inStep src={'https://github.com/lobehub/lobe-chat/assets/17870709/3f31bc33-509f-4ad2-ba81-280c2a6ec5fa'} />
71
68
 
72
- <Image
73
- alt={'Enter API Key'}
74
- inStep
75
- src={'https://github.com/lobehub/lobe-chat/assets/17870709/3f31bc33-509f-4ad2-ba81-280c2a6ec5fa'}
76
- />
69
+ - Enter the obtained API Key
70
+ - Choose an OpenAI model for your AI assistant to start the conversation
77
71
 
78
- - Enter the obtained API Key
79
- - Choose an OpenAI model for your AI assistant to start the conversation
80
-
81
- <Image
82
- alt={'Select OpenAI model and start conversation'}
83
- inStep
84
- src={'https://github.com/lobehub/lobe-chat/assets/17870709/ff7ebacf-27f0-42d7-810b-00314499a084'}
85
- />
86
-
87
- <Callout type={'warning'}>
88
- During usage, you may need to pay the API service provider. Please refer to OpenAI's relevant
89
- pricing policies.
90
- </Callout>
72
+ <Image alt={'Select OpenAI model and start conversation'} inStep src={'https://github.com/lobehub/lobe-chat/assets/17870709/ff7ebacf-27f0-42d7-810b-00314499a084'} />
91
73
 
74
+ <Callout type={'warning'}>
75
+ During usage, you may need to pay the API service provider. Please refer to OpenAI's relevant
76
+ pricing policies.
77
+ </Callout>
92
78
  </Steps>
93
79
 
94
80
  You can now engage in conversations using the models provided by OpenAI in LobeChat.
@@ -11,77 +11,64 @@ tags:
11
11
 
12
12
  # 在 LobeChat 中使用 OpenAI
13
13
 
14
- <Image
15
- alt={'在 LobeChat 中使用 OpenAI'}
16
- cover
17
- src={'https://github.com/lobehub/lobe-chat/assets/17870709/c9e5eafc-ca22-496b-a88d-cc0ae53bf720'}
18
- />
14
+ <Image alt={'在 LobeChat 中使用 OpenAI'} cover src={'https://github.com/lobehub/lobe-chat/assets/17870709/c9e5eafc-ca22-496b-a88d-cc0ae53bf720'} />
19
15
 
20
16
  本文档将指导你如何在 LobeChat 中使用 [OpenAI](https://openai.com/):
21
17
 
22
18
  <Steps>
19
+ ### 步骤一:获取 OpenAI API 密钥
23
20
 
24
- ### 步骤一:获取 OpenAI API 密钥
21
+ - 注册一个 [OpenAI 账户](https://platform.openai.com/signup),你需要使用国际手机号、非大陆邮箱进行注册;
25
22
 
26
- - 注册一个 [OpenAI 账户](https://platform.openai.com/signup),你需要使用国际手机号、非大陆邮箱进行注册;
27
- - 注册完毕后,前往 [API Keys](https://platform.openai.com/api-keys) 页面,点击 `Create new secret key` 创建新的 API Key:
23
+ - 注册完毕后,前往 [API Keys](https://platform.openai.com/api-keys) 页面,点击 `Create new secret key` 创建新的 API Key:
28
24
 
29
- - 打开创建窗口
25
+ - 打开创建窗口
30
26
 
31
- <Image
32
- alt={'打开创建窗口'}
33
- inStep
34
- src={
35
- 'https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296253192-ff2193dd-f125-4e58-82e8-91bc376c0d68.png'
36
- }
37
- />
27
+ <Image
28
+ alt={'打开创建窗口'}
29
+ inStep
30
+ src={
31
+ 'https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296253192-ff2193dd-f125-4e58-82e8-91bc376c0d68.png'
32
+ }
33
+ />
38
34
 
39
- - 创建 API Key
35
+ - 创建 API Key
40
36
 
41
- <Image
42
- alt={'创建 API Key'}
43
- inStep
44
- src={
45
- 'https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296254170-803bacf0-4471-4171-ae79-0eab08d621d1.png'
46
- }
47
- />
37
+ <Image
38
+ alt={'创建 API Key'}
39
+ inStep
40
+ src={
41
+ 'https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296254170-803bacf0-4471-4171-ae79-0eab08d621d1.png'
42
+ }
43
+ />
48
44
 
49
- - 获取 API Key
45
+ - 获取 API Key
50
46
 
51
- <Image
52
- alt={'获取 API Key'}
53
- inStep
54
- src={
55
- 'https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296255167-f2745f2b-f083-4ba8-bc78-9b558e0002de.png'
56
- }
57
- />
47
+ <Image
48
+ alt={'获取 API Key'}
49
+ inStep
50
+ src={
51
+ 'https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296255167-f2745f2b-f083-4ba8-bc78-9b558e0002de.png'
52
+ }
53
+ />
58
54
 
59
- <Callout type={'warning'}>账户注册后,一般有 5 美元的免费额度,但有效期只有三个月。</Callout>
55
+ <Callout type={'warning'}>账户注册后,一般有 5 美元的免费额度,但有效期只有三个月。</Callout>
60
56
 
61
- ### 步骤二:在 LobeChat 中配置 OpenAI
57
+ ### 步骤二:在 LobeChat 中配置 OpenAI
62
58
 
63
- - 访问 LobeChat 的`设置`界面
64
- - 在`语言模型`下找到`OpenAI`的设置项
59
+ - 访问 LobeChat 的`设置`界面
60
+ - 在`语言模型`下找到`OpenAI`的设置项
65
61
 
66
- <Image
67
- alt={'填入 API 密钥'}
68
- inStep
69
- src={'https://github.com/lobehub/lobe-chat/assets/17870709/3f31bc33-509f-4ad2-ba81-280c2a6ec5fa'}
70
- />
62
+ <Image alt={'填入 API 密钥'} inStep src={'https://github.com/lobehub/lobe-chat/assets/17870709/3f31bc33-509f-4ad2-ba81-280c2a6ec5fa'} />
71
63
 
72
- - 填入获得的 API 密钥
73
- - 为你的 AI 助手选择一个 OpenAI 的模型即可开始对话
64
+ - 填入获得的 API 密钥
65
+ - 为你的 AI 助手选择一个 OpenAI 的模型即可开始对话
74
66
 
75
- <Image
76
- alt={'选择 OpenAI 模型并开始对话'}
77
- inStep
78
- src={'https://github.com/lobehub/lobe-chat/assets/17870709/ff7ebacf-27f0-42d7-810b-00314499a084'}
79
- />
80
-
81
- <Callout type={'warning'}>
82
- 在使用过程中你可能需要向 API 服务提供商付费,请参考 OpenAI 的相关费用政策。
83
- </Callout>
67
+ <Image alt={'选择 OpenAI 模型并开始对话'} inStep src={'https://github.com/lobehub/lobe-chat/assets/17870709/ff7ebacf-27f0-42d7-810b-00314499a084'} />
84
68
 
69
+ <Callout type={'warning'}>
70
+ 在使用过程中你可能需要向 API 服务提供商付费,请参考 OpenAI 的相关费用政策。
71
+ </Callout>
85
72
  </Steps>
86
73
 
87
74
  至此你已经可以在 LobeChat 中使用 OpenAI 提供的模型进行对话了。
@@ -13,98 +13,62 @@ tags:
13
13
 
14
14
  # Using OpenRouter in LobeChat
15
15
 
16
- <Image
17
- alt={'Using OpenRouter in LobeChat'}
18
- cover
19
- src={'https://github.com/lobehub/lobe-chat/assets/34400653/40520a43-ac03-4954-8a4d-282fbb946066'}
20
- />
16
+ <Image alt={'Using OpenRouter in LobeChat'} cover src={'https://github.com/lobehub/lobe-chat/assets/34400653/40520a43-ac03-4954-8a4d-282fbb946066'} />
21
17
 
22
18
  [OpenRouter](https://openrouter.ai/) is a service that provides a variety of excellent large language model APIs, supporting models such as OpenAI (including GPT-3.5/4), Anthropic (Claude2, Instant), LLaMA 2, and PaLM Bison.
23
19
 
24
20
  This document will guide you on how to use OpenRouter in LobeChat:
25
21
 
26
22
  <Steps>
23
+ ### Step 1: Register and Log in to OpenRouter
27
24
 
28
- ### Step 1: Register and Log in to OpenRouter
29
-
30
- - Visit [OpenRouter.ai](https://openrouter.ai/) and create an account
31
- - You can log in using your Google account or MetaMask wallet
32
-
33
- <Image
34
- alt={'Register OpenRouter'}
35
- height={457}
36
- inStep
37
- src={'https://github.com/lobehub/lobe-chat/assets/34400653/a024af40-e1d9-4df0-b998-0e6e87cebe5b'}
38
- />
39
-
40
- ### Step 2: Create an API Key
41
-
42
- - Go to the `Keys` menu or visit [OpenRouter Keys](https://openrouter.ai/keys) directly
43
- - Click on `Create Key` to start the creation process
44
- - Name your API key in the pop-up dialog, for example, "LobeChat Key"
45
- - Leave the `Credit limit` blank to indicate no amount limit
46
-
47
- <Image
48
- alt={'Create OpenRouter Key'}
49
- height={460}
50
- inStep
51
- src={'https://github.com/lobehub/lobe-chat/assets/34400653/094d701f-ce80-464a-bbbc-0a5ecc8d08e3'}
52
- />
53
-
54
- - Copy the API key from the pop-up dialog and save it securely
55
-
56
- <Image
57
- alt={'Get OpenRouter Key'}
58
- height={519}
59
- inStep
60
- src={'https://github.com/lobehub/lobe-chat/assets/34400653/7a012a11-87bd-4366-a567-0ebf6d12ae10'}
61
- />
62
-
63
- <Callout type={'warning'}>
64
- Please store the key securely as it will only appear once. If you lose it accidentally, you will
65
- need to create a new key.
66
- </Callout>
67
-
68
- ### Step 3: Recharge Credit
69
-
70
- - Go to the `Credit` menu or visit [OpenRouter Credit](https://openrouter.ai/credits) directly
71
- - Click on `Manage Credits` to recharge your credit, you can check model prices at [https://openrouter.ai/models](https://openrouter.ai/models)
72
- - OpenRouter provides some free models that can be used without recharging
73
-
74
- <Image
75
- alt={'Recharge OpenRouter Credit'}
76
- height={385}
77
- inStep
78
- src={'https://github.com/lobehub/lobe-chat/assets/34400653/50b73232-01fc-4ef0-939a-3e06354d1b5a'}
79
- />
80
-
81
- ### Step 4: Configure OpenRouter in LobeChat
82
-
83
- - Visit the `Settings` interface in LobeChat
84
- - Find the setting for `OpenRouter` under `Language Models`
85
- - Enable OpenRouter and enter the API key you obtained
86
-
87
- <Image
88
- alt={'Configure OpenRouter in LobeChat'}
89
- height={518}
90
- inStep
91
- src={'https://github.com/lobehub/lobe-chat/assets/34400653/5c3898ab-23d7-44c2-bbd9-b255e25e400c'}
92
- />
93
-
94
- - Choose an OpenRouter model for your assistant to start the conversation
95
-
96
- <Image
97
- alt={'Use OpenRouter model'}
98
- height={518}
99
- inStep
100
- src={'https://github.com/lobehub/lobe-chat/assets/34400653/77b5feee-3f46-486d-9a36-31ff60efa5e9'}
101
- />
102
-
103
- <Callout type={'warning'}>
104
- You may need to pay the API service provider during usage, please refer to OpenRouter's relevant
105
- fee policies.
106
- </Callout>
25
+ - Visit [OpenRouter.ai](https://openrouter.ai/) and create an account
26
+ - You can log in using your Google account or MetaMask wallet
107
27
 
28
+ <Image alt={'Register OpenRouter'} height={457} inStep src={'https://github.com/lobehub/lobe-chat/assets/34400653/a024af40-e1d9-4df0-b998-0e6e87cebe5b'} />
29
+
30
+ ### Step 2: Create an API Key
31
+
32
+ - Go to the `Keys` menu or visit [OpenRouter Keys](https://openrouter.ai/keys) directly
33
+ - Click on `Create Key` to start the creation process
34
+ - Name your API key in the pop-up dialog, for example, "LobeChat Key"
35
+ - Leave the `Credit limit` blank to indicate no amount limit
36
+
37
+ <Image alt={'Create OpenRouter Key'} height={460} inStep src={'https://github.com/lobehub/lobe-chat/assets/34400653/094d701f-ce80-464a-bbbc-0a5ecc8d08e3'} />
38
+
39
+ - Copy the API key from the pop-up dialog and save it securely
40
+
41
+ <Image alt={'Get OpenRouter Key'} height={519} inStep src={'https://github.com/lobehub/lobe-chat/assets/34400653/7a012a11-87bd-4366-a567-0ebf6d12ae10'} />
42
+
43
+ <Callout type={'warning'}>
44
+ Please store the key securely as it will only appear once. If you lose it accidentally, you will
45
+ need to create a new key.
46
+ </Callout>
47
+
48
+ ### Step 3: Recharge Credit
49
+
50
+ - Go to the `Credit` menu or visit [OpenRouter Credit](https://openrouter.ai/credits) directly
51
+ - Click on `Manage Credits` to recharge your credit, you can check model prices at [https://openrouter.ai/models](https://openrouter.ai/models)
52
+ - OpenRouter provides some free models that can be used without recharging
53
+
54
+ <Image alt={'Recharge OpenRouter Credit'} height={385} inStep src={'https://github.com/lobehub/lobe-chat/assets/34400653/50b73232-01fc-4ef0-939a-3e06354d1b5a'} />
55
+
56
+ ### Step 4: Configure OpenRouter in LobeChat
57
+
58
+ - Visit the `Settings` interface in LobeChat
59
+ - Find the setting for `OpenRouter` under `Language Models`
60
+ - Enable OpenRouter and enter the API key you obtained
61
+
62
+ <Image alt={'Configure OpenRouter in LobeChat'} height={518} inStep src={'https://github.com/lobehub/lobe-chat/assets/34400653/5c3898ab-23d7-44c2-bbd9-b255e25e400c'} />
63
+
64
+ - Choose an OpenRouter model for your assistant to start the conversation
65
+
66
+ <Image alt={'Use OpenRouter model'} height={518} inStep src={'https://github.com/lobehub/lobe-chat/assets/34400653/77b5feee-3f46-486d-9a36-31ff60efa5e9'} />
67
+
68
+ <Callout type={'warning'}>
69
+ You may need to pay the API service provider during usage, please refer to OpenRouter's relevant
70
+ fee policies.
71
+ </Callout>
108
72
  </Steps>
109
73
 
110
74
  You can now engage in conversations using the models provided by OpenRouter in LobeChat.