@lobehub/chat 0.128.2 → 0.128.4

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 (146) hide show
  1. package/.github/workflows/issue-close-require.yml +3 -3
  2. package/.github/workflows/issues-translate.yml +3 -3
  3. package/.github/workflows/wiki-sync.yml +2 -2
  4. package/.husky/commit-msg +0 -3
  5. package/.husky/pre-commit +0 -3
  6. package/.i18nrc.js +2 -2
  7. package/CHANGELOG.md +50 -0
  8. package/README.md +3 -3
  9. package/README.zh-CN.md +3 -3
  10. package/contributing/Basic/Feature-Development.md +713 -0
  11. package/{docs/Development → contributing/Basic}/Feature-Development.zh-CN.md +2 -2
  12. package/{docs/Development → contributing/Basic}/Intro.zh-CN.md +5 -5
  13. package/{docs → contributing}/Home.md +21 -30
  14. package/{docs/Development → contributing/Internationalization}/Internationalization-Implementation.zh-CN.md +1 -1
  15. package/{docs → contributing}/_Sidebar.md +19 -30
  16. package/docs/agents/concepts.mdx +18 -0
  17. package/docs/agents/concepts.zh-CN.mdx +17 -0
  18. package/docs/agents/custom-agent.mdx +34 -0
  19. package/docs/agents/custom-agent.zh-CN.mdx +31 -0
  20. package/docs/agents/model.mdx +68 -0
  21. package/docs/agents/model.zh-CN.mdx +64 -0
  22. package/docs/agents/prompt.mdx +96 -0
  23. package/docs/agents/prompt.zh-CN.mdx +97 -0
  24. package/docs/agents/topics.mdx +7 -0
  25. package/docs/agents/topics.zh-CN.mdx +6 -0
  26. package/docs/common-errors/no-v1-suffix.mdx +18 -0
  27. package/docs/common-errors/no-v1-suffix.zh-CN.mdx +17 -0
  28. package/docs/common-errors/proxy-with-unable-to-verify-leaf-signature.mdx +70 -0
  29. package/docs/{Deployment/Common-Error.zh-CN.md → common-errors/proxy-with-unable-to-verify-leaf-signature.zh-CN.mdx} +8 -26
  30. package/docs/environment-variables/common.mdx +215 -0
  31. package/docs/environment-variables/common.zh-CN.mdx +214 -0
  32. package/docs/environment-variables/model-provider.mdx +135 -0
  33. package/docs/environment-variables/model-provider.zh-CN.mdx +133 -0
  34. package/docs/package.json +5 -0
  35. package/docs/plugins/basic-usage.mdx +40 -0
  36. package/docs/{Usage/Plugins.zh-CN.md → plugins/basic-usage.zh-CN.mdx} +7 -21
  37. package/docs/plugins/custom-plugin.mdx +27 -0
  38. package/docs/plugins/custom-plugin.zh-CN.mdx +26 -0
  39. package/docs/plugins/plugin-development.mdx +262 -0
  40. package/docs/{Plugins/Plugin-Development.zh-CN.md → plugins/plugin-development.zh-CN.mdx} +9 -33
  41. package/docs/plugins/plugin-store.mdx +10 -0
  42. package/docs/plugins/plugin-store.zh-CN.mdx +9 -0
  43. package/docs/self-hosting/analytics.mdx +20 -0
  44. package/docs/{Deployment/Analytics.zh-CN.md → self-hosting/analytics.zh-CN.mdx} +5 -8
  45. package/docs/self-hosting/authentication.mdx +94 -0
  46. package/docs/self-hosting/authentication.zh-CN.mdx +90 -0
  47. package/docs/self-hosting/deploy-with-azure-openai.mdx +48 -0
  48. package/docs/{Deployment/Deploy-with-Azure-OpenAI.zh-CN.md → self-hosting/deploy-with-azure-openai.zh-CN.mdx} +16 -21
  49. package/docs/self-hosting/docker-compose.mdx +121 -0
  50. package/docs/self-hosting/docker-compose.zh-CN.mdx +121 -0
  51. package/docs/self-hosting/docker.mdx +152 -0
  52. package/docs/self-hosting/docker.zh-CN.mdx +149 -0
  53. package/docs/self-hosting/environment-variable.mdx +340 -0
  54. package/docs/{Deployment/Environment-Variable.zh-CN.md → self-hosting/environment-variable.zh-CN.mdx} +43 -57
  55. package/docs/self-hosting/upstream-sync.mdx +66 -0
  56. package/docs/{Deployment/Upstream-Sync.zh-CN.md → self-hosting/upstream-sync.zh-CN.mdx} +23 -21
  57. package/docs/self-hosting/vercel.mdx +39 -0
  58. package/docs/self-hosting/vercel.zh-CN.mdx +39 -0
  59. package/docs/usage/agent-market.mdx +35 -0
  60. package/docs/usage/agent-market.zh-CN.mdx +32 -0
  61. package/docs/usage/mobile.mdx +8 -0
  62. package/docs/usage/mobile.zh-CN.mdx +7 -0
  63. package/docs/usage/more.mdx +21 -0
  64. package/docs/usage/more.zh-CN.mdx +19 -0
  65. package/docs/usage/plugin-system.mdx +84 -0
  66. package/docs/usage/plugin-system.zh-CN.mdx +77 -0
  67. package/docs/usage/pwa.mdx +21 -0
  68. package/docs/usage/pwa.zh-CN.mdx +21 -0
  69. package/docs/usage/text-to-image.mdx +5 -0
  70. package/docs/usage/text-to-image.zh-CN.mdx +6 -0
  71. package/docs/usage/theme.mdx +17 -0
  72. package/docs/usage/theme.zh-CN.mdx +15 -0
  73. package/docs/usage/tts.mdx +26 -0
  74. package/docs/usage/tts.zh-CN.mdx +24 -0
  75. package/docs/usage/vision.mdx +8 -0
  76. package/docs/usage/vision.zh-CN.mdx +7 -0
  77. package/locales/ar/common.json +1 -0
  78. package/locales/de-DE/common.json +1 -0
  79. package/locales/en-US/common.json +1 -0
  80. package/locales/es-ES/common.json +1 -0
  81. package/locales/fr-FR/common.json +1 -0
  82. package/locales/it-IT/common.json +1 -0
  83. package/locales/ja-JP/common.json +1 -0
  84. package/locales/ko-KR/common.json +1 -0
  85. package/locales/nl-NL/common.json +1 -0
  86. package/locales/pl-PL/common.json +1 -0
  87. package/locales/pt-BR/common.json +1 -0
  88. package/locales/ru-RU/common.json +1 -0
  89. package/locales/tr-TR/common.json +1 -0
  90. package/locales/vi-VN/common.json +1 -0
  91. package/locales/zh-CN/common.json +1 -0
  92. package/locales/zh-TW/common.json +1 -0
  93. package/next.config.mjs +5 -0
  94. package/package.json +6 -5
  95. package/scripts/docsWorkflow/const.ts +1 -1
  96. package/scripts/docsWorkflow/toc.ts +6 -6
  97. package/src/app/welcome/(desktop)/features/Footer.tsx +5 -3
  98. package/src/config/client.ts +6 -0
  99. package/src/const/url.ts +10 -1
  100. package/src/features/PluginStore/OnlineList.tsx +2 -16
  101. package/src/features/SideBar/BottomActions.tsx +11 -10
  102. package/src/locales/default/common.ts +1 -0
  103. package/docs/Deployment/Analytics.md +0 -20
  104. package/docs/Deployment/Authentication.md +0 -80
  105. package/docs/Deployment/Authentication.zh-CN.md +0 -80
  106. package/docs/Deployment/Common-Error.md +0 -87
  107. package/docs/Deployment/Deploy-with-Azure-OpenAI.md +0 -54
  108. package/docs/Deployment/Docker-Deployment.md +0 -219
  109. package/docs/Deployment/Docker-Deployment.zh-CN.md +0 -217
  110. package/docs/Deployment/Environment-Variable.md +0 -362
  111. package/docs/Deployment/Upstream-Sync.md +0 -62
  112. package/docs/Plugins/Plugin-Development.md +0 -287
  113. package/docs/Usage/Plugins.md +0 -53
  114. package/docs/Usage/Usage-Agents.md +0 -201
  115. package/docs/Usage/Usage-Agents.zh-CN.md +0 -202
  116. package/docs/Usage/Usage-Topics.md +0 -31
  117. package/docs/Usage/Usage-Topics.zh-CN.md +0 -31
  118. /package/{docs/Development → contributing/Basic}/Add-New-Authentication-Providers.md +0 -0
  119. /package/{docs/Development → contributing/Basic}/Add-New-Authentication-Providers.zh-CN.md +0 -0
  120. /package/{docs/Development → contributing/Basic}/Architecture.md +0 -0
  121. /package/{docs/Development → contributing/Basic}/Architecture.zh-CN.md +0 -0
  122. /package/{docs/Development → contributing/Basic}/Chat-API.md +0 -0
  123. /package/{docs/Development → contributing/Basic}/Chat-API.zh-CN.md +0 -0
  124. /package/{docs/Development → contributing/Basic}/Contributing-Guidelines.md +0 -0
  125. /package/{docs/Development → contributing/Basic}/Contributing-Guidelines.zh-CN.md +0 -0
  126. /package/{docs/Development → contributing/Basic}/Feature-Development-Frontend.md +0 -0
  127. /package/{docs/Development → contributing/Basic}/Feature-Development-Frontend.zh-CN.md +0 -0
  128. /package/{docs/Development → contributing/Basic}/Folder-Structure.md +0 -0
  129. /package/{docs/Development → contributing/Basic}/Folder-Structure.zh-CN.md +0 -0
  130. /package/{docs/Development → contributing/Basic}/Intro.md +0 -0
  131. /package/{docs/Development → contributing/Basic}/Resources.md +0 -0
  132. /package/{docs/Development → contributing/Basic}/Resources.zh-CN.md +0 -0
  133. /package/{docs/Development → contributing/Basic}/Setup-Development.md +0 -0
  134. /package/{docs/Development → contributing/Basic}/Setup-Development.zh-CN.md +0 -0
  135. /package/{docs/Development → contributing/Basic}/Test.md +0 -0
  136. /package/{docs/Development → contributing/Basic}/Test.zh-CN.md +0 -0
  137. /package/{docs/Development → contributing/Internationalization}/Add-New-Locale.md +0 -0
  138. /package/{docs/Development → contributing/Internationalization}/Add-New-Locale.zh-CN.md +0 -0
  139. /package/{docs/Development → contributing/Internationalization}/Internationalization-Implementation.md +0 -0
  140. /package/{docs → contributing}/Others/Lighthouse.md +0 -0
  141. /package/{docs → contributing}/Others/Lighthouse.zh-CN.md +0 -0
  142. /package/{docs/Development → contributing/State-Management}/State-Management-Intro.md +0 -0
  143. /package/{docs/Development → contributing/State-Management}/State-Management-Intro.zh-CN.md +0 -0
  144. /package/{docs/Development → contributing/State-Management}/State-Management-Selectors.md +0 -0
  145. /package/{docs/Development → contributing/State-Management}/State-Management-Selectors.zh-CN.md +0 -0
  146. /package/{docs → contributing}/_Footer.md +0 -0
@@ -178,7 +178,7 @@ class SessionService {
178
178
 
179
179
  ## 三、Store Action 部分
180
180
 
181
- 在 LobeChat 应用中,Store 是用于管理应用前端状态的模块。其中的 Action 是触发状态更新的函数,通常会调用服务层的方法来执行实际的数据处理操作,然后更新 Store 中的状态。我们采用了 `zustand` 作为 Store 模块的底层依赖,对于状态管理的详细实践介绍,可以查阅 [📘 状态管理最佳实践](./State-Management-Intro.zh-CN)
181
+ 在 LobeChat 应用中,Store 是用于管理应用前端状态的模块。其中的 Action 是触发状态更新的函数,通常会调用服务层的方法来执行实际的数据处理操作,然后更新 Store 中的状态。我们采用了 `zustand` 作为 Store 模块的底层依赖,对于状态管理的详细实践介绍,可以查阅 [📘 状态管理最佳实践](../State-Management/State-Management-Intro.zh-CN.md)
182
182
 
183
183
  ### sessionGroup CRUD
184
184
 
@@ -349,7 +349,7 @@ const customSessionGroups = (s: SessionStore): CustomSessionGroup[] => s.customS
349
349
 
350
350
  > !\[Important]
351
351
  >
352
- > 如果你对 Selectors 的概念和功能不太了解,可以查阅 [📘 数据存储取数模块](./State-Management-Selectors.zh-CN) 部分了解相关内容。
352
+ > 如果你对 Selectors 的概念和功能不太了解,可以查阅 [📘 数据存储取数模块](../State-Management/State-Management-Selectors.zh-CN.md) 部分了解相关内容。
353
353
 
354
354
  ## 四、UI 部分
355
355
 
@@ -44,7 +44,7 @@ src
44
44
  └── utils # 通用的工具函数
45
45
  ```
46
46
 
47
- 有关目录架构的详细介绍,详见: [文件夹目录架构](Folder-Structure.zh-CN)
47
+ 有关目录架构的详细介绍,详见: [文件夹目录架构](Folder-Structure.zh-CN.md)
48
48
 
49
49
  ## 本地开发环境设置
50
50
 
@@ -76,7 +76,7 @@ bun run dev
76
76
  # 访问 http://localhost:3010 查看应用
77
77
  ```
78
78
 
79
- 现在,你应该可以在浏览器中看到 LobeChat 的欢迎页面。详细的环境配置指南,请参考 [开发环境设置指南](Setup-Development.zh-CN)。
79
+ 现在,你应该可以在浏览器中看到 LobeChat 的欢迎页面。详细的环境配置指南,请参考 [开发环境设置指南](Setup-Development.zh-CN.md)。
80
80
 
81
81
  ## 代码风格与贡献指南
82
82
 
@@ -87,7 +87,7 @@ bun run dev
87
87
 
88
88
  所有的贡献都将经过代码审查。维护者可能会提出修改建议或要求。请积极响应审查意见,并及时做出调整,我们期待你的参与和贡献。
89
89
 
90
- 详细的代码风格和贡献指南,请参考 [代码风格与贡献指南](Contributing-Guidelines.zh-CN)。
90
+ 详细的代码风格和贡献指南,请参考 [代码风格与贡献指南](Contributing-Guidelines.zh-CN.md)。
91
91
 
92
92
  ## 国际化实现指南
93
93
 
@@ -95,9 +95,9 @@ LobeChat 采用 `i18next` 和 `lobe-i18n` 实现多语言支持,确保用户
95
95
 
96
96
  国际化文件位于 `src/locales`,包含默认语言(中文)。 我们会通过 `lobe-i18n` 自动生成其他的语言 JSON 文件。
97
97
 
98
- 如果要添加新语种,需遵循特定步骤,详见 [新语种添加指南](Add-New-Locale.zh-CN)。 我们鼓励你参与我们的国际化努力,共同为全球用户提供更好的服务。
98
+ 如果要添加新语种,需遵循特定步骤,详见 [新语种添加指南](../Internationalization/Add-New-Locale.zh-CN.md)。 我们鼓励你参与我们的国际化努力,共同为全球用户提供更好的服务。
99
99
 
100
- 详细的国际化实现指南指南,请参考 [国际化实现指南](Internationalization-Implementation.zh-CN)。
100
+ 详细的国际化实现指南指南,请参考 [国际化实现指南](../Internationalization/Internationalization-Implementation.zh-CN.md)。
101
101
 
102
102
  ## 附录:资源与参考
103
103
 
@@ -4,9 +4,11 @@
4
4
  <img height="120" src="https://gw.alipayobjects.com/zos/kitchen/qJ3l3EPsdW/split.svg">
5
5
  <img height="120" src="https://registry.npmmirror.com/@lobehub/assets-emoji/1.3.0/files/assets/robot.webp">
6
6
 
7
- <h1>Lobe Chat Wiki</h1>
7
+ <h1>Lobe Chat Contributing Wiki</h1>
8
8
 
9
- LobeChat is a open-source, extensible ([Function Calling][fc-url]), high-performance chatbot framework. <br/> It supports one-click free deployment of your private ChatGPT/LLM web application.
9
+ LobeChat is an open-source, extensible ([Function Calling][fc-url]), high-performance chatbot framework. <br/> It supports one-click free deployment of your private ChatGPT/LLM web application.
10
+
11
+ [Usage Documents](https://chat-docs.lobehub.com/en) | [使用指南](https://chat-docs.lobehub.com/zh)
10
12
 
11
13
  </div>
12
14
 
@@ -14,43 +16,33 @@ LobeChat is a open-source, extensible ([Function Calling][fc-url]), high-perform
14
16
 
15
17
  <!-- DOCS LIST -->
16
18
 
17
- ### 🤯 Usage
19
+ ### 🤯 Basic
18
20
 
19
- - [Custom Agents Guide](https://github.com/lobehub/lobe-chat/wiki/Usage-Agents) | [自定义助手指南](https://github.com/lobehub/lobe-chat/wiki/Usage-Agents.zh-CN)
20
- - [Plugin Usage](https://github.com/lobehub/lobe-chat/wiki/Plugins) | [插件使用](https://github.com/lobehub/lobe-chat/wiki/Plugins.zh-CN)
21
- - [Topic Guide](https://github.com/lobehub/lobe-chat/wiki/Usage-Topics) | [话题指南](https://github.com/lobehub/lobe-chat/wiki/Usage-Topics.zh-CN)
21
+ - [Architecture Design](https://github.com/lobehub/lobe-chat/wiki/Architecture) | [架构设计](https://github.com/lobehub/lobe-chat/wiki/Architecture.zh-CN)
22
+ - [Code Style and Contribution Guidelines](https://github.com/lobehub/lobe-chat/wiki/Contributing-Guidelines) | [代码风格与贡献指南](https://github.com/lobehub/lobe-chat/wiki/Contributing-Guidelines.zh-CN)
23
+ - [Complete Guide to LobeChat Feature Development](https://github.com/lobehub/lobe-chat/wiki/Feature-Development) | [LobeChat 功能开发完全指南](https://github.com/lobehub/lobe-chat/wiki/Feature-Development.zh-CN)
24
+ - [Conversation API Implementation Logic](https://github.com/lobehub/lobe-chat/wiki/Chat-API) | [会话 API 实现逻辑](https://github.com/lobehub/lobe-chat/wiki/Chat-API.zh-CN)
25
+ - [Directory Structure](https://github.com/lobehub/lobe-chat/wiki/Folder-Structure) | [目录架构](https://github.com/lobehub/lobe-chat/wiki/Folder-Structure.zh-CN)
26
+ - [Environment Setup Guide](https://github.com/lobehub/lobe-chat/wiki/Setup-Development) | [环境设置指南](https://github.com/lobehub/lobe-chat/wiki/Setup-Development.zh-CN)
27
+ - [How to Develop a New Feature](https://github.com/lobehub/lobe-chat/wiki/Feature-Development-Frontend) | [如何开发一个新功能:前端实现](https://github.com/lobehub/lobe-chat/wiki/Feature-Development-Frontend.zh-CN)
28
+ - [New Authentication Provider Guide](https://github.com/lobehub/lobe-chat/wiki/Add-New-Authentication-Providers) | [新身份验证方式开发指南](https://github.com/lobehub/lobe-chat/wiki/Add-New-Authentication-Providers.zh-CN)
29
+ - [Resources and References](https://github.com/lobehub/lobe-chat/wiki/Resources) | [资源与参考](https://github.com/lobehub/lobe-chat/wiki/Resources.zh-CN)
30
+ - [Technical Development Getting Started Guide](https://github.com/lobehub/lobe-chat/wiki/Intro) | [技术开发上手指南](https://github.com/lobehub/lobe-chat/wiki/Intro.zh-CN)
31
+ - [Testing Guide](https://github.com/lobehub/lobe-chat/wiki/Test) | [测试指南](https://github.com/lobehub/lobe-chat/wiki/Test.zh-CN)
22
32
 
23
33
  <br/>
24
34
 
25
- ### 🛳 Self-Hosting
35
+ ### 🌎 Internationalization
26
36
 
27
- - [Docker Deployment Guide](https://github.com/lobehub/lobe-chat/wiki/Docker-Deployment) | [Docker 部署指引](https://github.com/lobehub/lobe-chat/wiki/Docker-Deployment.zh-CN)
28
- - [Deploying with Azure OpenAI](https://github.com/lobehub/lobe-chat/wiki/Deploy-with-Azure-OpenAI) | [使用 Azure OpenAI 部署](https://github.com/lobehub/lobe-chat/wiki/Deploy-with-Azure-OpenAI.zh-CN)
29
- - [Environment Variables](https://github.com/lobehub/lobe-chat/wiki/Environment-Variable) | [环境变量](https://github.com/lobehub/lobe-chat/wiki/Environment-Variable.zh-CN)
30
- - [Authentication Service](https://github.com/lobehub/lobe-chat/wiki/Authentication) | [身份验证服务](https://github.com/lobehub/lobe-chat/wiki/Authentication.zh-CN)
31
- - [Upstream Sync](https://github.com/lobehub/lobe-chat/wiki/Upstream-Sync) | [自部署保持更新](https://github.com/lobehub/lobe-chat/wiki/Upstream-Sync.zh-CN)
32
- - [Frequently Asked Questions](https://github.com/lobehub/lobe-chat/wiki/Common-Error) | [常见问题](https://github.com/lobehub/lobe-chat/wiki/Common-Error.zh-CN)
33
- - [Data Statistics](https://github.com/lobehub/lobe-chat/wiki/Analytics) | [数据统计](https://github.com/lobehub/lobe-chat/wiki/Analytics.zh-CN)
37
+ - [Internationalization Implementation Guide](https://github.com/lobehub/lobe-chat/wiki/Internationalization-Implementation) | [国际化实现指南](https://github.com/lobehub/lobe-chat/wiki/Internationalization-Implementation.zh-CN)
38
+ - [New Locale Guide](https://github.com/lobehub/lobe-chat/wiki/Add-New-Locale) | [新语种添加指南](https://github.com/lobehub/lobe-chat/wiki/Add-New-Locale.zh-CN)
34
39
 
35
40
  <br/>
36
41
 
37
- ### ⌨️ Development
42
+ ### ⌨️ State Management
38
43
 
39
- - [Technical Development Getting Started Guide](https://github.com/lobehub/lobe-chat/wiki/index) | [技术开发上手指南](https://github.com/lobehub/lobe-chat/wiki/index.zh-CN)
40
- - [Code Style and Contribution Guidelines](https://github.com/lobehub/lobe-chat/wiki/Contributing-Guidelines) | [代码风格与贡献指南](https://github.com/lobehub/lobe-chat/wiki/Contributing-Guidelines.zh-CN)
41
- - [Environment Setup Guide](https://github.com/lobehub/lobe-chat/wiki/Setup-Development) | [环境设置指南](https://github.com/lobehub/lobe-chat/wiki/Setup-Development.zh-CN)
42
- - [Architecture Design](https://github.com/lobehub/lobe-chat/wiki/Architecture) | [架构设计](https://github.com/lobehub/lobe-chat/wiki/Architecture.zh-CN)
43
- - [Directory Structure](https://github.com/lobehub/lobe-chat/wiki/Folder-Structure) | [目录架构](https://github.com/lobehub/lobe-chat/wiki/Folder-Structure.zh-CN)
44
44
  - [Best Practices for State Management](https://github.com/lobehub/lobe-chat/wiki/State-Management-Intro) | [状态管理最佳实践](https://github.com/lobehub/lobe-chat/wiki/State-Management-Intro.zh-CN)
45
- - [Data Store Selector](https://github.com/lobehub/lobe-chat/wiki/State-Management-Selectors) | [数据存储取数模块](https://github.com/lobehub/lobe-chat/wiki/State-Management-Selectors.zh-CN)
46
- - [Conversation API Implementation Logic](https://github.com/lobehub/lobe-chat/wiki/Chat-API) | [会话 API 实现逻辑](https://github.com/lobehub/lobe-chat/wiki/Chat-API.zh-CN)
47
- - [How to Develop a New Feature](https://github.com/lobehub/lobe-chat/wiki/Feature-Development) | [如何开发一个新功能](https://github.com/lobehub/lobe-chat/wiki/Feature-Development.zh-CN)
48
- - [Frontend](https://github.com/lobehub/lobe-chat/wiki/Feature-Development-Frontend) | [前端实现](https://github.com/lobehub/lobe-chat/wiki/Feature-Development-Frontend.zh-CN)
49
- - [Internationalization Implementation Guide](https://github.com/lobehub/lobe-chat/wiki/Internationalization-Implementation) | [国际化实现指南](https://github.com/lobehub/lobe-chat/wiki/Internationalization-Implementation.zh-CN)
50
- - [New Locale Guide](https://github.com/lobehub/lobe-chat/wiki/Add-New-Locale) | [新语种添加指南](https://github.com/lobehub/lobe-chat/wiki/Add-New-Locale.zh-CN)
51
- - [New Authentication Provider Guide](https://github.com/lobehub/lobe-chat/wiki/Add-New-Authentication-Providers) | [新身份验证方式开发指南](https://github.com/lobehub/lobe-chat/wiki/Add-New-Authentication-Providers.zh-CN)
52
- - [Testing Guide](https://github.com/lobehub/lobe-chat/wiki/Test) | [测试指南](https://github.com/lobehub/lobe-chat/wiki/Test.zh-CN)
53
- - [Resources and References](https://github.com/lobehub/lobe-chat/wiki/Resources) | [资源与参考](https://github.com/lobehub/lobe-chat/wiki/Resources.zh-CN)
45
+ - [Data Store Selector](https://github.com/lobehub/lobe-chat/wiki/State-Management-Selectors) | [数据存储取数模块](https://github.com/lobehub/lobe-chat/wiki/State-Management-Selectors.zh-CN)
54
46
 
55
47
  <br/>
56
48
 
@@ -62,7 +54,6 @@ LobeChat is a open-source, extensible ([Function Calling][fc-url]), high-perform
62
54
 
63
55
  ### 🧩 Plugins
64
56
 
65
- - [Plugin Development Guide](https://github.com/lobehub/lobe-chat/wiki/Plugin-Development) | [插件开发指南](https://github.com/lobehub/lobe-chat/wiki/Plugin-Development.zh-CN)
66
57
  - [Plugin Index and Submit](https://github.com/lobehub/lobe-chat-plugins) | [插件索引与提交](https://github.com/lobehub/lobe-chat-plugins/blob/main/README.zh-CN.md)
67
58
  - [Plugin SDK Docs](https://chat-plugin-sdk.lobehub.com) | [插件 SDK 文档](https://chat-plugin-sdk.lobehub.com)
68
59
 
@@ -115,7 +115,7 @@ const createI18nInstance = (lang) => {
115
115
  - [🌐 feat(locale): Add fr-FR (#637) #645](https://github.com/lobehub/lobe-chat/pull/645)
116
116
  - [🌐 Add russian localy #137](https://github.com/lobehub/lobe-chat/pull/137)
117
117
 
118
- 要添加新的语种支持, 详细步骤请参考:[新语种添加指南](Add-New-Locale.zh-CN)。
118
+ 要添加新的语种支持, 详细步骤请参考:[新语种添加指南](Add-New-Locale.zh-CN.md)。
119
119
 
120
120
  ## 资源和进一步阅读
121
121
 
@@ -1,44 +1,34 @@
1
- ## Lobe Chat Wiki
1
+ ## Lobe Chat Contributing Wiki
2
2
 
3
3
  #### 🏠 Home
4
4
 
5
- - [TOC](Home) | [目录](Home)
5
+ - [TOC](Home.md) | [目录](Home.md)
6
6
 
7
7
  <!-- DOCS LIST -->
8
8
 
9
- #### 🤯 Usage
9
+ #### 🤯 Basic
10
10
 
11
- - [Custom Agents Guide](https://github.com/lobehub/lobe-chat/wiki/Usage-Agents) | [自定义助手指南](https://github.com/lobehub/lobe-chat/wiki/Usage-Agents.zh-CN)
12
- - [Plugin Usage](https://github.com/lobehub/lobe-chat/wiki/Plugins) | [插件使用](https://github.com/lobehub/lobe-chat/wiki/Plugins.zh-CN)
13
- - [Topic Guide](https://github.com/lobehub/lobe-chat/wiki/Usage-Topics) | [话题指南](https://github.com/lobehub/lobe-chat/wiki/Usage-Topics.zh-CN)
11
+ - [Architecture Design](https://github.com/lobehub/lobe-chat/wiki/Architecture) | [架构设计](https://github.com/lobehub/lobe-chat/wiki/Architecture.zh-CN)
12
+ - [Code Style and Contribution Guidelines](https://github.com/lobehub/lobe-chat/wiki/Contributing-Guidelines) | [代码风格与贡献指南](https://github.com/lobehub/lobe-chat/wiki/Contributing-Guidelines.zh-CN)
13
+ - [Complete Guide to LobeChat Feature Development](https://github.com/lobehub/lobe-chat/wiki/Feature-Development) | [LobeChat 功能开发完全指南](https://github.com/lobehub/lobe-chat/wiki/Feature-Development.zh-CN)
14
+ - [Conversation API Implementation Logic](https://github.com/lobehub/lobe-chat/wiki/Chat-API) | [会话 API 实现逻辑](https://github.com/lobehub/lobe-chat/wiki/Chat-API.zh-CN)
15
+ - [Directory Structure](https://github.com/lobehub/lobe-chat/wiki/Folder-Structure) | [目录架构](https://github.com/lobehub/lobe-chat/wiki/Folder-Structure.zh-CN)
16
+ - [Environment Setup Guide](https://github.com/lobehub/lobe-chat/wiki/Setup-Development) | [环境设置指南](https://github.com/lobehub/lobe-chat/wiki/Setup-Development.zh-CN)
17
+ - [How to Develop a New Feature](https://github.com/lobehub/lobe-chat/wiki/Feature-Development-Frontend) | [如何开发一个新功能:前端实现](https://github.com/lobehub/lobe-chat/wiki/Feature-Development-Frontend.zh-CN)
18
+ - [New Authentication Provider Guide](https://github.com/lobehub/lobe-chat/wiki/Add-New-Authentication-Providers) | [新身份验证方式开发指南](https://github.com/lobehub/lobe-chat/wiki/Add-New-Authentication-Providers.zh-CN)
19
+ - [Resources and References](https://github.com/lobehub/lobe-chat/wiki/Resources) | [资源与参考](https://github.com/lobehub/lobe-chat/wiki/Resources.zh-CN)
20
+ - [Technical Development Getting Started Guide](https://github.com/lobehub/lobe-chat/wiki/Intro) | [技术开发上手指南](https://github.com/lobehub/lobe-chat/wiki/Intro.zh-CN)
21
+ - [Testing Guide](https://github.com/lobehub/lobe-chat/wiki/Test) | [测试指南](https://github.com/lobehub/lobe-chat/wiki/Test.zh-CN)
14
22
 
15
- #### 🛳 Self-Hosting
23
+ #### 🌎 Internationalization
16
24
 
17
- - [Docker Deployment Guide](https://github.com/lobehub/lobe-chat/wiki/Docker-Deployment) | [Docker 部署指引](https://github.com/lobehub/lobe-chat/wiki/Docker-Deployment.zh-CN)
18
- - [Deploying with Azure OpenAI](https://github.com/lobehub/lobe-chat/wiki/Deploy-with-Azure-OpenAI) | [使用 Azure OpenAI 部署](https://github.com/lobehub/lobe-chat/wiki/Deploy-with-Azure-OpenAI.zh-CN)
19
- - [Environment Variables](https://github.com/lobehub/lobe-chat/wiki/Environment-Variable) | [环境变量](https://github.com/lobehub/lobe-chat/wiki/Environment-Variable.zh-CN)
20
- - [Authentication Service](https://github.com/lobehub/lobe-chat/wiki/Authentication) | [身份验证服务](https://github.com/lobehub/lobe-chat/wiki/Authentication.zh-CN)
21
- - [Upstream Sync](https://github.com/lobehub/lobe-chat/wiki/Upstream-Sync) | [自部署保持更新](https://github.com/lobehub/lobe-chat/wiki/Upstream-Sync.zh-CN)
22
- - [Frequently Asked Questions](https://github.com/lobehub/lobe-chat/wiki/Common-Error) | [常见问题](https://github.com/lobehub/lobe-chat/wiki/Common-Error.zh-CN)
23
- - [Data Statistics](https://github.com/lobehub/lobe-chat/wiki/Analytics) | [数据统计](https://github.com/lobehub/lobe-chat/wiki/Analytics.zh-CN)
25
+ - [Internationalization Implementation Guide](https://github.com/lobehub/lobe-chat/wiki/Internationalization-Implementation) | [国际化实现指南](https://github.com/lobehub/lobe-chat/wiki/Internationalization-Implementation.zh-CN)
26
+ - [New Locale Guide](https://github.com/lobehub/lobe-chat/wiki/Add-New-Locale) | [新语种添加指南](https://github.com/lobehub/lobe-chat/wiki/Add-New-Locale.zh-CN)
24
27
 
25
- #### ⌨️ Development
28
+ #### ⌨️ State Management
26
29
 
27
- - [Technical Development Getting Started Guide](https://github.com/lobehub/lobe-chat/wiki/Intro) | [技术开发上手指南](https://github.com/lobehub/lobe-chat/wiki/Intro.zh-CN)
28
- - [Code Style and Contribution Guidelines](https://github.com/lobehub/lobe-chat/wiki/Contributing-Guidelines) | [代码风格与贡献指南](https://github.com/lobehub/lobe-chat/wiki/Contributing-Guidelines.zh-CN)
29
- - [Environment Setup Guide](https://github.com/lobehub/lobe-chat/wiki/Setup-Development) | [环境设置指南](https://github.com/lobehub/lobe-chat/wiki/Setup-Development.zh-CN)
30
- - [Architecture Design](https://github.com/lobehub/lobe-chat/wiki/Architecture) | [架构设计](https://github.com/lobehub/lobe-chat/wiki/Architecture.zh-CN)
31
- - [Directory Structure](https://github.com/lobehub/lobe-chat/wiki/Folder-Structure) | [目录架构](https://github.com/lobehub/lobe-chat/wiki/Folder-Structure.zh-CN)
32
30
  - [Best Practices for State Management](https://github.com/lobehub/lobe-chat/wiki/State-Management-Intro) | [状态管理最佳实践](https://github.com/lobehub/lobe-chat/wiki/State-Management-Intro.zh-CN)
33
- - [Data Store Selector](https://github.com/lobehub/lobe-chat/wiki/State-Management-Selectors) | [数据存储取数模块](https://github.com/lobehub/lobe-chat/wiki/State-Management-Selectors.zh-CN)
34
- - [Conversation API Implementation Logic](https://github.com/lobehub/lobe-chat/wiki/Chat-API) | [会话 API 实现逻辑](https://github.com/lobehub/lobe-chat/wiki/Chat-API.zh-CN)
35
- - [How to Develop a New Feature](https://github.com/lobehub/lobe-chat/wiki/Feature-Development) | [如何开发一个新功能](https://github.com/lobehub/lobe-chat/wiki/Feature-Development.zh-CN)
36
- - [Frontend](https://github.com/lobehub/lobe-chat/wiki/Feature-Development-Frontend) | [前端实现](https://github.com/lobehub/lobe-chat/wiki/Feature-Development-Frontend.zh-CN)
37
- - [Internationalization Implementation Guide](https://github.com/lobehub/lobe-chat/wiki/Internationalization-Implementation) | [国际化实现指南](https://github.com/lobehub/lobe-chat/wiki/Internationalization-Implementation.zh-CN)
38
- - [New Locale Guide](https://github.com/lobehub/lobe-chat/wiki/Add-New-Locale) | [新语种添加指南](https://github.com/lobehub/lobe-chat/wiki/Add-New-Locale.zh-CN)
39
- - [New Authentication Provider Guide](https://github.com/lobehub/lobe-chat/wiki/Add-New-Authentication-Providers) | [新身份验证方式开发指南](https://github.com/lobehub/lobe-chat/wiki/Add-New-Authentication-Providers.zh-CN)
40
- - [Testing Guide](https://github.com/lobehub/lobe-chat/wiki/Test) | [测试指南](https://github.com/lobehub/lobe-chat/wiki/Test.zh-CN)
41
- - [Resources and References](https://github.com/lobehub/lobe-chat/wiki/Resources) | [资源与参考](https://github.com/lobehub/lobe-chat/wiki/Resources.zh-CN)
31
+ - [Data Store Selector](https://github.com/lobehub/lobe-chat/wiki/State-Management-Selectors) | [数据存储取数模块](https://github.com/lobehub/lobe-chat/wiki/State-Management-Selectors.zh-CN)
42
32
 
43
33
  #### 🤖 Agents
44
34
 
@@ -46,7 +36,6 @@
46
36
 
47
37
  #### 🧩 Plugins
48
38
 
49
- - [Plugin Development Guide](https://github.com/lobehub/lobe-chat/wiki/Plugin-Development) | [插件开发指南](https://github.com/lobehub/lobe-chat/wiki/Plugin-Development.zh-CN)
50
39
  - [Plugin Index and Submit](https://github.com/lobehub/lobe-chat-plugins) | [插件索引与提交](https://github.com/lobehub/lobe-chat-plugins/blob/main/README.zh-CN.md)
51
40
  - [Plugin SDK Docs](https://chat-plugin-sdk.lobehub.com) | [插件 SDK 文档](https://chat-plugin-sdk.lobehub.com)
52
41
 
@@ -0,0 +1,18 @@
1
+ # Topics and Assistants
2
+
3
+ ## ChatGPT and "Topics"
4
+
5
+ In the official ChatGPT application, there is only the concept of "topics." As shown in the image, the user's historical conversation topics are listed in the sidebar.
6
+
7
+ ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279602474-fe7cb3f3-8eb7-40d3-a69f-6615393bbd4e.png)
8
+
9
+ However, in our usage, we have found that this model has many issues. For example, the information indexing of historical conversations is too scattered. Additionally, when dealing with repetitive tasks, it is difficult to have a stable entry point. For instance, if I want ChatGPT to help me translate a document, in this model, I would need to constantly create new topics and then set up the translation prompt I had previously created. When there are high-frequency tasks, this will result in a very inefficient interaction format.
10
+
11
+ ## "Topics" and "Assistants"
12
+
13
+ Therefore, in LobeChat, we have introduced the concept of **assistants**. An assistant is a complete functional module, each with its own responsibilities and tasks. Assistants can help you handle various tasks and provide professional advice and guidance.
14
+
15
+ ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279602489-89893e61-2791-4083-9b57-ed80884ad58b.png)
16
+
17
+ At the same time, we have integrated topics into each assistant. The benefit of this approach is that each assistant has an independent topic list. You can choose the corresponding assistant based on the current task and quickly switch between historical conversation records. This method is more in line with users' habits in common chat software, improving interaction efficiency.
18
+
@@ -0,0 +1,17 @@
1
+ # 话题与助手
2
+
3
+ ## ChatGPT 与「话题」
4
+
5
+ 在 ChatGPT 官方应用中,只存在话题的概念,如图所示,在侧边栏中是用户的历史对话话题列表。
6
+
7
+ ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279602474-fe7cb3f3-8eb7-40d3-a69f-6615393bbd4e.png)
8
+
9
+ 但在我们的使用过程中其实会发现这种模式存在很多问题,比如历史对话的信息索引过于分散问题,同时当处理一些重复任务时很难有一个稳定的入口,比如我希望有一个稳定的入口可以让 ChatGPT 帮助我翻译文档,在这个模式下,我需要不断新建新的话题同时再设置我之前创建好的翻译 Prompt 设定,当有高频任务存在时,这将是一个效率很低的交互形式。
10
+
11
+ ## 「话题」与「助手」
12
+
13
+ 因此在 LobeChat 中,我们引入了 **助手** 的概念。助手是一个完整的功能模块,每个助手都有自己的职责和任务。助手可以帮助你处理各种任务,并提供专业的建议和指导。
14
+
15
+ ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279602489-89893e61-2791-4083-9b57-ed80884ad58b.png)
16
+
17
+ 与此同时,我们将话题索引到每个助手内部。这样做的好处是,每个助手都有一个独立的话题列表,你可以根据当前任务选择对应的助手,并快速切换历史对话记录。这种方式更符合用户对常见聊天软件的使用习惯,提高了交互的效率。
@@ -0,0 +1,34 @@
1
+ import { Callout, Cards } from 'nextra/components';
2
+
3
+ # Custom Assistant Guide
4
+
5
+ As the basic functional unit of LobeChat, adding and iterating assistants is very important. Now you can add assistants to your favorites list in two ways.
6
+
7
+ ## `A` Add through the role market
8
+
9
+ If you are a beginner in Prompt writing, you might want to browse the assistant market of LobeChat first. Here, you can find commonly used assistants submitted by others and easily add them to your list with just one click, which is very convenient.
10
+
11
+ ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279588466-4c32041b-a8e6-4703-ba4a-f91b7800e359.png)
12
+
13
+ ## `B` Create a custom assistant
14
+
15
+ When you need to handle specific tasks, you need to consider creating a custom assistant to help you solve the problem. You can add and configure the assistant in detail in the following ways.
16
+
17
+ ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279587283-a3ea8dfd-70fb-47ee-ab00-e3911ac6a939.png) ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279587292-a3d102c6-f61e-4578-91f1-c0a4c97588e1.png)
18
+
19
+ <Callout type={'info'}>
20
+ **Quick Setup Tip**: You can conveniently modify the Prompt through the quick edit button in the sidebar.
21
+
22
+ </Callout>
23
+
24
+ ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279587294-388d1877-193e-4a50-9fe8-8fbcc3ccefa0.png) ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279587298-333da153-13b8-4557-a0a2-cff55e7bc1c0.png)
25
+
26
+ If you want to understand Prompt writing tips and common model parameter settings, you can continue to view:
27
+
28
+ <Cards>
29
+ <Cards.Card href={'/en/usage/agents/prompt'} title={'Prompt User Guide'}></Cards.Card>
30
+ <Cards.Card
31
+ href={'/en/usage/agents/model'}
32
+ title={'Large Language Model User Guide'}
33
+ ></Cards.Card>
34
+ </Cards>
@@ -0,0 +1,31 @@
1
+ import { Callout, Cards } from 'nextra/components';
2
+
3
+ # 自定义助手指南
4
+
5
+ 作为 LobeChat 的基础职能单位,助手的添加和迭代是非常重要的。现在你可以通过两种方式将助手添加到你的常用列表中
6
+
7
+ ## `A` 通过角色市场添加
8
+
9
+ 如果你是一个 Prompt 编写的新手,不妨先浏览一下 LobeChat 的助手市场。在这里,你可以找到其他人提交的常用助手,并且只需一键添加到你的列表中,非常方便。
10
+
11
+ ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279588466-4c32041b-a8e6-4703-ba4a-f91b7800e359.png)
12
+
13
+ ## `B` 通过新建自定义助手
14
+
15
+ 当你需要处理一些特定的任务时,你就需要考虑创建一个自定义助手来帮助你解决问题。可以通过以下方式添加并进行助手的详细配置
16
+
17
+ ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279587283-a3ea8dfd-70fb-47ee-ab00-e3911ac6a939.png) ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279587292-a3d102c6-f61e-4578-91f1-c0a4c97588e1.png)
18
+
19
+ <Callout type={'info'}>
20
+ **快捷设置技巧**: 可以通过侧边栏的快捷编辑按钮进行 Prompt 的便捷修改
21
+
22
+ </Callout>
23
+
24
+ ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279587294-388d1877-193e-4a50-9fe8-8fbcc3ccefa0.png) ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279587298-333da153-13b8-4557-a0a2-cff55e7bc1c0.png)
25
+
26
+ 如果你希望理解 Prompt 编写技巧和常见的模型参数设置,可以继续查看:
27
+
28
+ <Cards>
29
+ <Cards.Card href={'/zh/usage/agents/prompt'} title={'Prompt 使用指南'}></Cards.Card>
30
+ <Cards.Card href={'/zh/usage/agents/model'} title={'大语言模型使用指南'}></Cards.Card>
31
+ </Cards>
@@ -0,0 +1,68 @@
1
+ import { Callout } from 'nextra/components';
2
+
3
+ # Model Guide
4
+
5
+ ## ChatGPT
6
+
7
+ - **gpt-3.5-turbo**: Currently the fastest generating ChatGPT model, it is faster but may sacrifice some text quality, with a context length of 4k.
8
+ - **gpt-3.5-turbo-16k**: Similar to gpt-4, the context limit is increased to 16k tokens, with a higher cost.
9
+ - **gpt-4**: ChatGPT 4.0 has improved language understanding and generation capabilities compared to 3.5. It can better understand context and context, and generate more accurate and natural responses. This is thanks to improvements in the GPT-4 model, including better language modeling and deeper semantic understanding, but it may be slower than other models, with a context length of 8k.
10
+ - **gpt-4-32k**: Similar to gpt-4, the context limit is increased to 32k tokens, with a higher cost.
11
+
12
+ ## Concept of Model Parameters
13
+
14
+ LLM seems magical, but it is essentially a probability problem. The neural network generates a bunch of candidate words from the pre-trained model based on the input text and selects the high-probability ones as output. Most of the related parameters are associated with sampling (i.e., how to select the output from the candidate words).
15
+
16
+ ### `temperature`
17
+
18
+ This parameter controls the randomness of the model's output. The higher the value, the greater the randomness. Generally, when the same prompt is input multiple times, the model's output varies each time.
19
+
20
+ - Set to 0: Generates a fixed output for each prompt
21
+ - Lower values: More concentrated and deterministic output
22
+ - Higher values: More random output (more creative)
23
+
24
+ <Callout>
25
+ Generally, the longer and clearer the prompt, the better the quality and confidence of the model's
26
+ output. In such cases, the temperature value can be adjusted appropriately. Conversely, if the
27
+ prompt is short and ambiguous, setting a relatively high temperature value will result in unstable
28
+ model output.
29
+ </Callout>
30
+
31
+ <br />
32
+
33
+ ### `top_p`
34
+
35
+ Top-p is also a sampling parameter, but it differs from temperature in its sampling method. Before outputting, the model generates a bunch of tokens, and these tokens are ranked based on their quality. In the top-p sampling mode, the candidate word list is dynamic, and tokens are selected from the tokens based on a percentage. Top-p introduces randomness in token selection, allowing other high-scoring tokens to have a chance of being selected, rather than always choosing the highest-scoring one.
36
+
37
+ <Callout>
38
+ Top-p is similar to randomness, and it is generally not recommended to change it together with the
39
+ randomness of temperature.
40
+ </Callout>
41
+
42
+ <br />
43
+
44
+ ### `presence_penalty`
45
+
46
+ The presence penalty parameter can be seen as a punishment for repetitive content in the generated text. When this parameter is set high, the generation model will try to avoid producing repeated words, phrases, or sentences. Conversely, if the presence penalty parameter is set low, the generated text may contain more repetitive content. By adjusting the value of the presence penalty parameter, control over the originality and diversity of the generated text can be achieved. The importance of this parameter is mainly reflected in the following aspects:
47
+
48
+ - Enhancing the originality and diversity of the generated text: In certain applications, such as creative writing or generating news headlines, it is necessary for the generated text to have high originality and diversity. By increasing the value of the presence penalty parameter, the amount of repeated content in the generated text can be effectively reduced, thereby enhancing its originality and diversity.
49
+ - Preventing the generation of loops and meaningless content: In some cases, the generation model may produce repetitive or meaningless text that usually fails to convey useful information. By appropriately increasing the value of the presence penalty parameter, the probability of generating such meaningless content can be reduced, thereby improving the readability and practicality of the generated text.
50
+
51
+ <Callout>
52
+ It is worth noting that the presence penalty parameter, in conjunction with other parameters such
53
+ as temperature and top-p, collectively influences the quality of the generated text. Compared to
54
+ other parameters, the presence penalty parameter primarily focuses on the originality and
55
+ repetitiveness of the text, while the temperature and top-p parameters more significantly affect
56
+ the randomness and determinism of the generated text. By adjusting these parameters reasonably,
57
+ comprehensive control over the quality of the generated text can be achieved.
58
+ </Callout>
59
+
60
+ ### `frequency_penalty`
61
+
62
+ It is a mechanism that penalizes frequently occurring new vocabulary in the text to reduce the likelihood of the model repeating the same word. The larger the value, the more likely it is to reduce repeated words.
63
+
64
+ - `-2.0` When the morning news started broadcasting, I found that my TV now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now **(The highest frequency word is "now", accounting for 44.79%)**
65
+ - `-1.0` He always watches the news in the early morning, in front of the TV watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch **(The highest frequency word is "watch", accounting for 57.69%)**
66
+ - `0.0` When the morning sun poured into the small diner, a tired postman appeared at the door, carrying a bag of letters in his hands. The owner warmly prepared a breakfast for him, and he started sorting the mail while enjoying his breakfast. **(The highest frequency word is "of", accounting for 8.45%)**
67
+ - `1.0` A girl in deep sleep was woken up by a warm ray of sunshine, she saw the first ray of morning light, surrounded by birdsong and flowers, everything was full of vitality. \_ (The highest frequency word is "of", accounting for 5.45%)
68
+ - `2.0` Every morning, he would sit on the balcony to have breakfast. Under the soft setting sun, everything looked very peaceful. However, one day, when he was about to pick up his breakfast, an optimistic little bird flew by, bringing him a good mood for the day. \_ (The highest frequency word is "of", accounting for 4.94%)
@@ -0,0 +1,64 @@
1
+ import { Callout } from 'nextra/components';
2
+
3
+ # 模型指南
4
+
5
+ ## ChatGPT
6
+
7
+ - **gpt-3.5-turbo**:目前最生成速度最快的 chatgpt 模型更快,但可能会牺牲一些生成文本的质量,上下文长度为 4k。
8
+ - **gpt-3.5-turbo-16k**:同 gpt-4,上下文限制增加到 16k token,同时费率更高。
9
+ - **gpt-4**:ChatGPT 4.0 在语言理解和生成能力方面相对于 3.5 有所提升。它可以更好地理解上下文和语境,并生成更准确、自然的回答。这得益于 GPT-4 模型的改进,包括更好的语言建模和更深入的语义理解,但它的速度可能比其他模型慢,上下文长度为 8k。
10
+ - **gpt-4-32k**:同 gpt-4,上下文限制增加到 32k token,同时费率更高。
11
+
12
+ ## 模型参数概念
13
+
14
+ LLM 看似很神奇,但本质还是一个概率问题,神经网络根据输入的文本,从预训练的模型里面生成一堆候选词,选择概率高的作为输出,相关的参数,大多都是跟采样有关(也就是要如何从候选词里选择输出)。
15
+
16
+ ### `temperature`
17
+
18
+ 用于控制模型输出的结果的随机性,这个值越大随机性越大。一般我们多次输入相同的 prompt 之后,模型的每次输出都不一样。
19
+
20
+ - 设置为 0,对每个 prompt 都生成固定的输出
21
+ - 较低的值,输出更集中,更有确定性
22
+ - 较高的值,输出更随机(更有创意 )
23
+
24
+ <Callout>
25
+ 一般来说,prompt 越长,描述得越清楚,模型生成的输出质量就越好,置信度越高,这时可以适当调高
26
+ temperature 的值;反过来,如果 prompt 很短,很含糊,这时再设置一个比较高的 temperature
27
+ 值,模型的输出就很不稳定了。
28
+ </Callout>
29
+
30
+ <br />
31
+
32
+ ### `top_p`
33
+
34
+ 核采样 top_p 也是采样参数,跟 temperature 不一样的采样方式。模型在输出之前,会生成一堆 token,这些 token 根据质量高低排名,核采样模式中候选词列表是动态的,从 tokens 里按百分比选择候选词。 top-p 为选择 token 引入了随机性,让其他高分的 token 有被选择的机会,不会总是选最高分的。
35
+
36
+ <Callout>top_p 与随机性类似,一般来说不建议和随机性 temperature 一起更改</Callout>
37
+
38
+ <br />
39
+
40
+ ### `presence_penalty`
41
+
42
+ Presence Penalty 参数可以看作是对生成文本中重复内容的一种惩罚。当该参数设置较高时,生成模型会尽量避免产生重复的词语、短语或句子。相反,如果 Presence Penalty 参数较低,则生成的文本可能会包含更多重复的内容。通过调整 Presence Penalty 参数的值,可以实现对生成文本的原创性和多样性的控制。参数的重要性主要体现在以下几个方面:
43
+
44
+ - 提高生成文本的独创性和多样性:在某些应用场景下,如创意写作、生成新闻标题等,需要生成的文本具有较高的独创性和多样性。通过增加 Presence Penalty 参数的值,可以有效减少生成文本中的重复内容,从而提高文本的独创性和多样性。
45
+ - 防止生成循环和无意义的内容:在某些情况下,生成模型可能会产生循环、重复的文本,这些文本通常无法传达有效的信息。通过适当增加 Presence Penalty 参数的值,可以降低生成这类无意义内容的概率,提高生成文本的可读性和实用性。
46
+
47
+ <Callout>
48
+ 值得注意的是,Presence Penalty 参数与其他参数(如 Temperature 和
49
+ top-p)共同影响着生成文本的质量。对比其他参数,Presence Penalty
50
+ 参数主要关注文本的独创性和重复性,而 Temperature 和 top-p
51
+ 参数则更多地影响着生成文本的随机性和确定性。通过合理地调整这些参数,可以实现对生成文本质量的综合控制
52
+ </Callout>
53
+
54
+ <br />
55
+
56
+ ### `frequency_penalty`
57
+
58
+ 是一种机制,通过对文本中频繁出现的新词汇施加惩罚,以减少模型重复同一词语的可能性,值越大,越有可能降低重复字词。
59
+
60
+ - `-2.0` 当早间新闻开始播出,我发现我家电视现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在 _(频率最高的词是 “现在”,占比 44.79%)_
61
+ - `-1.0` 他总是在清晨看新闻,在电视前看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看 _(频率最高的词是 “看”,占比 57.69%)_
62
+ - `0.0` 当清晨的阳光洒进小餐馆时,一名疲倦的邮递员出现在门口,他的手中提着一袋信件。店主热情地为他准备了一份早餐,他在享用早餐的同时开始整理邮件。**(频率最高的词是 “的”,占比 8.45%)**
63
+ - `1.0` 一个深度睡眠的女孩被一阵温暖的阳光唤醒,她看到了早晨的第一缕阳光,周围是鸟语花香,一切都充满了生机。_(频率最高的词是 “的”,占比 5.45%)_
64
+ - `2.0` 每天早上,他都会在阳台上坐着吃早餐。在柔和的夕阳照耀下,一切看起来都非常宁静。然而有一天,当他准备端起早餐的时候,一只乐观的小鸟飞过,给他带来了一天的好心情。 _(频率最高的词是 “的”,占比 4.94%)_
@@ -0,0 +1,96 @@
1
+ import { Callout } from 'nextra/components';
2
+
3
+ # Guide to Using Prompts
4
+
5
+ ## Basic Concepts of Prompts
6
+
7
+ Generative AI is very useful, but it requires human guidance. In most cases, generative AI can be as capable as a new intern at a company, but it needs clear instructions to perform well. The ability to guide generative AI correctly is a very powerful skill. You can guide generative AI by sending a prompt, which is usually a text instruction. A prompt is the input provided to the assistant, and it will affect the output. A good prompt should be structured, clear, concise, and directive.
8
+
9
+ ## How to Write a Well-Structured Prompt
10
+
11
+ <Callout type={'info'}>
12
+ A structured prompt refers to the construction of the prompt having a clear logic and structure.
13
+ For example, if you want the model to generate an article, your prompt may need to include the
14
+ article's topic, outline, and style.{' '}
15
+ </Callout>
16
+
17
+ Let's look at a basic discussion prompt example:
18
+
19
+ > _"What are the most urgent environmental issues facing our planet, and what actions can individuals take to help address these issues?"_
20
+
21
+ We can convert it into a simple prompt for the assistant to answer the following questions: placed at the front.
22
+
23
+ ```prompt
24
+ Answer the following questions:
25
+ What are the most urgent environmental issues facing our planet, and what actions can individuals take to help address these issues?
26
+ ```
27
+
28
+ Since the results generated by this prompt are not consistent, some are only one or two sentences. A typical discussion response should have multiple paragraphs, so these results are not ideal. A good prompt should provide **specific formatting and content instructions**. You need to eliminate ambiguity in the language to improve consistency and quality. Here is a better prompt.
29
+
30
+ ```prompt
31
+ Write a highly detailed paper, including an introduction, body, and conclusion, to answer the following questions:
32
+ What are the most urgent environmental issues facing our planet,
33
+ and what actions can individuals take to help address these issues?
34
+ ```
35
+
36
+ The second prompt generates longer output and better structure. The use of the term "paper" in the prompt is intentional, as the assistant can understand the definition of a paper, making it more likely to generate coherent, structured responses.
37
+
38
+ ## How to Improve Quality and Effectiveness
39
+
40
+ <Callout type={'info'}>
41
+ There are several ways to improve the quality and effectiveness of prompts:
42
+
43
+ - **Be Clear About Your Needs:** The model's output will strive to meet your needs, so if your needs are not clear, the output may not meet expectations.
44
+ - **Use Correct Grammar and Spelling:** The model will try to mimic your language style, so if your language style is problematic, the output may also be problematic.
45
+ - **Provide Sufficient Contextual Information:** The model will generate output based on the contextual information you provide, so if the information is insufficient, it may not produce the desired results.
46
+
47
+ </Callout>
48
+
49
+ After formulating effective prompts for discussing issues, you now need to refine the generated results. This may involve adjusting the output to fit constraints such as word count or combining concepts from different generated results.
50
+
51
+ A simple method of iteration is to generate multiple outputs and review them to understand the concepts and structures being used. Once the outputs have been evaluated, you can select the most suitable ones and combine them into a coherent response. Another iterative method is to start small and **gradually expand**. This requires more than one prompt: an initial prompt for drafting the initial one or two paragraphs, followed by additional prompts to expand on the content already written. Here is a potential philosophical discussion prompt:
52
+
53
+ > _"Is mathematics an invention or a discovery? Use careful reasoning to explain your answer."_
54
+
55
+ Add it to a simple prompt as follows:
56
+
57
+ ```prompt
58
+ Write an opening paragraph to answer the following question:
59
+ Is mathematics an invention or a discovery? Use careful reasoning to explain your answer.
60
+ ```
61
+
62
+ After generating some responses, we found one that we like:
63
+
64
+ ```prompt
65
+ Philosophers and mathematicians have long debated whether mathematics is an invention or a discovery.
66
+ Some argue that the concepts and principles of mathematics exist independently of human thought, and therefore can be considered discovered rather than invented.
67
+ For example, the concepts of numbers, ratios, and geometric shapes are observed in the natural world and can be abstracted and systematically studied.
68
+ ```
69
+
70
+ It's a good start. Then, use another prompt to expand:
71
+
72
+ ```prompt
73
+ I am writing a detailed essay to answer the following prompt:
74
+ Is mathematics an invention or a discovery? Use careful reasoning to explain your answer. Here is my current situation: Philosophers and mathematicians have long debated whether mathematics is an invention or a discovery.
75
+ Some argue that the concepts and principles of mathematics exist independently of human thought, and therefore can be considered discovered rather than invented.
76
+ For example, the concepts of numbers, ratios, and geometric shapes are observed in the natural world and can be abstracted and systematically studied. Write the next paragraph of my essay.
77
+ ```
78
+
79
+ I used this prompt to generate several extensions and selected one that I liked, resulting in the following:
80
+
81
+ ```prompt
82
+ Philosophers and mathematicians have long debated whether mathematics is invented or discovered.
83
+ Some argue that the concepts and principles of mathematics exist independently of human thought, and therefore can be considered to be discovered rather than invented.
84
+ For example, the concepts of numbers, ratios, and geometric shapes are observed in the natural world and can be abstracted and systematically studied.
85
+ On the other hand, some believe that mathematics is largely an invention of human thought.
86
+ Mathematical principles are based on logical reasoning, which is a characteristic of human thought.
87
+ For instance, Euclidean geometry is based on abstract axioms and premises, accepted as true without the need for proof.
88
+ Therefore, geometry can be considered an invention of human thought rather than a discovery.
89
+ Similarly, mathematical formulas and equations are used to model and predict physical phenomena, which are the result of human reasoning.
90
+ ```
91
+
92
+ Using the prompt extensions, we can iteratively write and iterate at each step. This is very useful for situations that require **generating higher quality output and incremental modifications**.
93
+
94
+ ## Further Reading
95
+
96
+ - **Learn Prompting**: https://learnprompting.org/en-US/docs/intro