@lobehub/chat 1.67.2 → 1.68.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/.env.example +4 -0
  2. package/CHANGELOG.md +58 -0
  3. package/Dockerfile +2 -0
  4. package/Dockerfile.database +2 -0
  5. package/README.md +6 -5
  6. package/README.zh-CN.md +4 -3
  7. package/changelog/v1.json +21 -0
  8. package/docs/self-hosting/advanced/auth.mdx +6 -5
  9. package/docs/self-hosting/advanced/auth.zh-CN.mdx +6 -5
  10. package/docs/self-hosting/environment-variables/model-provider.mdx +16 -0
  11. package/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +16 -0
  12. package/docs/usage/providers/ppio.mdx +57 -0
  13. package/docs/usage/providers/ppio.zh-CN.mdx +55 -0
  14. package/locales/en-US/providers.json +3 -0
  15. package/locales/zh-CN/providers.json +4 -0
  16. package/package.json +5 -5
  17. package/packages/web-crawler/README.md +47 -20
  18. package/packages/web-crawler/README.zh-CN.md +61 -0
  19. package/packages/web-crawler/src/__test__/crawler.test.ts +179 -0
  20. package/packages/web-crawler/src/crawler.ts +8 -3
  21. package/packages/web-crawler/src/type.ts +2 -3
  22. package/packages/web-crawler/src/urlRules.ts +5 -0
  23. package/packages/web-crawler/src/utils/appUrlRules.test.ts +76 -0
  24. package/src/app/[variants]/(main)/settings/llm/ProviderList/providers.tsx +2 -0
  25. package/src/config/aiModels/index.ts +3 -0
  26. package/src/config/aiModels/ppio.ts +276 -0
  27. package/src/config/llm.ts +6 -0
  28. package/src/config/modelProviders/index.ts +4 -0
  29. package/src/config/modelProviders/ppio.ts +249 -0
  30. package/src/libs/agent-runtime/AgentRuntime.ts +7 -0
  31. package/src/libs/agent-runtime/ppio/__snapshots__/index.test.ts.snap +26 -0
  32. package/src/libs/agent-runtime/ppio/fixtures/models.json +42 -0
  33. package/src/libs/agent-runtime/ppio/index.test.ts +264 -0
  34. package/src/libs/agent-runtime/ppio/index.ts +51 -0
  35. package/src/libs/agent-runtime/ppio/type.ts +12 -0
  36. package/src/libs/agent-runtime/types/type.ts +1 -0
  37. package/src/libs/agent-runtime/utils/anthropicHelpers.ts +2 -2
  38. package/src/server/routers/tools/__test__/search.test.ts +146 -0
  39. package/src/store/chat/slices/builtinTool/actions/searXNG.test.ts +67 -0
  40. package/src/store/tool/slices/builtin/selectors.test.ts +12 -0
  41. package/src/store/tool/slices/builtin/selectors.ts +4 -1
  42. package/src/tools/web-browsing/Portal/PageContent/index.tsx +37 -2
  43. package/src/tools/web-browsing/Render/PageContent/Result.tsx +36 -3
  44. package/src/tools/web-browsing/Render/PageContent/index.tsx +11 -1
  45. package/src/types/tool/crawler.ts +2 -2
  46. package/src/types/user/settings/keyVaults.ts +1 -0
package/.env.example CHANGED
@@ -127,6 +127,10 @@ OPENAI_API_KEY=sk-xxxxxxxxx
127
127
 
128
128
  # TENCENT_CLOUD_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
129
129
 
130
+ ### PPIO ####
131
+
132
+ # PPIO_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
133
+
130
134
  ########################################
131
135
  ############ Market Service ############
132
136
  ########################################
package/CHANGELOG.md CHANGED
@@ -2,6 +2,64 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.68.1](https://github.com/lobehub/lobe-chat/compare/v1.68.0...v1.68.1)
6
+
7
+ <sup>Released on **2025-03-03**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix page crash with crawler error.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix page crash with crawler error, closes [#6662](https://github.com/lobehub/lobe-chat/issues/6662) ([0c24251](https://github.com/lobehub/lobe-chat/commit/0c24251))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
30
+ ## [Version 1.68.0](https://github.com/lobehub/lobe-chat/compare/v1.67.2...v1.68.0)
31
+
32
+ <sup>Released on **2025-03-03**</sup>
33
+
34
+ #### ✨ Features
35
+
36
+ - **misc**: Add new model provider PPIO.
37
+
38
+ #### 🐛 Bug Fixes
39
+
40
+ - **misc**: Fix search web-browsing display bug.
41
+
42
+ <br/>
43
+
44
+ <details>
45
+ <summary><kbd>Improvements and Fixes</kbd></summary>
46
+
47
+ #### What's improved
48
+
49
+ - **misc**: Add new model provider PPIO, closes [#6133](https://github.com/lobehub/lobe-chat/issues/6133) ([23a3fda](https://github.com/lobehub/lobe-chat/commit/23a3fda))
50
+
51
+ #### What's fixed
52
+
53
+ - **misc**: Fix search web-browsing display bug, closes [#6653](https://github.com/lobehub/lobe-chat/issues/6653) ([f472643](https://github.com/lobehub/lobe-chat/commit/f472643))
54
+
55
+ </details>
56
+
57
+ <div align="right">
58
+
59
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
60
+
61
+ </div>
62
+
5
63
  ### [Version 1.67.2](https://github.com/lobehub/lobe-chat/compare/v1.67.1...v1.67.2)
6
64
 
7
65
  <sup>Released on **2025-03-02**</sup>
package/Dockerfile CHANGED
@@ -197,6 +197,8 @@ ENV \
197
197
  OPENROUTER_API_KEY="" OPENROUTER_MODEL_LIST="" \
198
198
  # Perplexity
199
199
  PERPLEXITY_API_KEY="" PERPLEXITY_MODEL_LIST="" PERPLEXITY_PROXY_URL="" \
200
+ # PPIO
201
+ PPIO_API_KEY="" PPIO_MODEL_LIST="" \
200
202
  # Qwen
201
203
  QWEN_API_KEY="" QWEN_MODEL_LIST="" QWEN_PROXY_URL="" \
202
204
  # SambaNova
@@ -240,6 +240,8 @@ ENV \
240
240
  OPENROUTER_API_KEY="" OPENROUTER_MODEL_LIST="" \
241
241
  # Perplexity
242
242
  PERPLEXITY_API_KEY="" PERPLEXITY_MODEL_LIST="" PERPLEXITY_PROXY_URL="" \
243
+ # PPIO
244
+ PPIO_API_KEY="" PPIO_MODEL_LIST="" \
243
245
  # Qwen
244
246
  QWEN_API_KEY="" QWEN_MODEL_LIST="" QWEN_PROXY_URL="" \
245
247
  # SambaNova
package/README.md CHANGED
@@ -191,13 +191,14 @@ We have implemented support for the following model service providers:
191
191
  - **[Bedrock](https://lobechat.com/discover/provider/bedrock)**: Bedrock is a service provided by Amazon AWS, focusing on delivering advanced AI language and visual models for enterprises. Its model family includes Anthropic's Claude series, Meta's Llama 3.1 series, and more, offering a range of options from lightweight to high-performance, supporting tasks such as text generation, conversation, and image processing for businesses of varying scales and needs.
192
192
  - **[Google](https://lobechat.com/discover/provider/google)**: Google's Gemini series represents its most advanced, versatile AI models, developed by Google DeepMind, designed for multimodal capabilities, supporting seamless understanding and processing of text, code, images, audio, and video. Suitable for various environments from data centers to mobile devices, it significantly enhances the efficiency and applicability of AI models.
193
193
  - **[DeepSeek](https://lobechat.com/discover/provider/deepseek)**: DeepSeek is a company focused on AI technology research and application, with its latest model DeepSeek-V2.5 integrating general dialogue and code processing capabilities, achieving significant improvements in human preference alignment, writing tasks, and instruction following.
194
+ - **[PPIO](https://lobechat.com/discover/provider/ppio)**: PPIO supports stable and cost-efficient open-source LLM APIs, such as DeepSeek, Llama, Qwen etc.
194
195
  - **[HuggingFace](https://lobechat.com/discover/provider/huggingface)**: The HuggingFace Inference API provides a fast and free way for you to explore thousands of models for various tasks. Whether you are prototyping for a new application or experimenting with the capabilities of machine learning, this API gives you instant access to high-performance models across multiple domains.
195
196
  - **[OpenRouter](https://lobechat.com/discover/provider/openrouter)**: OpenRouter is a service platform providing access to various cutting-edge large model interfaces, supporting OpenAI, Anthropic, LLaMA, and more, suitable for diverse development and application needs. Users can flexibly choose the optimal model and pricing based on their requirements, enhancing the AI experience.
196
197
  - **[Cloudflare Workers AI](https://lobechat.com/discover/provider/cloudflare)**: Run serverless GPU-powered machine learning models on Cloudflare's global network.
197
- - **[GitHub](https://lobechat.com/discover/provider/github)**: With GitHub Models, developers can become AI engineers and leverage the industry's leading AI models.
198
198
 
199
- <details><summary><kbd>See more providers (+26)</kbd></summary>
199
+ <details><summary><kbd>See more providers (+27)</kbd></summary>
200
200
 
201
+ - **[GitHub](https://lobechat.com/discover/provider/github)**: With GitHub Models, developers can become AI engineers and leverage the industry's leading AI models.
201
202
  - **[Novita](https://lobechat.com/discover/provider/novita)**: Novita AI is a platform providing a variety of large language models and AI image generation API services, flexible, reliable, and cost-effective. It supports the latest open-source models like Llama3 and Mistral, offering a comprehensive, user-friendly, and auto-scaling API solution for generative AI application development, suitable for the rapid growth of AI startups.
202
203
  - **[Together AI](https://lobechat.com/discover/provider/togetherai)**: Together AI is dedicated to achieving leading performance through innovative AI models, offering extensive customization capabilities, including rapid scaling support and intuitive deployment processes to meet various enterprise needs.
203
204
  - **[Fireworks AI](https://lobechat.com/discover/provider/fireworksai)**: Fireworks AI is a leading provider of advanced language model services, focusing on functional calling and multimodal processing. Its latest model, Firefunction V2, is based on Llama-3, optimized for function calling, conversation, and instruction following. The visual language model FireLLaVA-13B supports mixed input of images and text. Other notable models include the Llama series and Mixtral series, providing efficient multilingual instruction following and generation support.
@@ -227,7 +228,7 @@ We have implemented support for the following model service providers:
227
228
 
228
229
  </details>
229
230
 
230
- > 📊 Total providers: [<kbd>**36**</kbd>](https://lobechat.com/discover/providers)
231
+ > 📊 Total providers: [<kbd>**37**</kbd>](https://lobechat.com/discover/providers)
231
232
 
232
233
  <!-- PROVIDER LIST -->
233
234
 
@@ -668,7 +669,7 @@ If you would like to learn more details, please feel free to look at our [📘 D
668
669
 
669
670
  ## 🤝 Contributing
670
671
 
671
- Contributions of all types are more than welcome; if you are interested in contributing code, feel free to check out our GitHub [Issues][github-issues-link] and [Projects][github-project-link] to get stuck in to show us what youre made of.
672
+ Contributions of all types are more than welcome; if you are interested in contributing code, feel free to check out our GitHub [Issues][github-issues-link] and [Projects][github-project-link] to get stuck in to show us what you're made of.
672
673
 
673
674
  > \[!TIP]
674
675
  >
@@ -889,7 +890,7 @@ This project is [Apache 2.0](./LICENSE) licensed.
889
890
  [profile-link]: https://github.com/lobehub
890
891
  [share-linkedin-link]: https://linkedin.com/feed
891
892
  [share-linkedin-shield]: https://img.shields.io/badge/-share%20on%20linkedin-black?labelColor=black&logo=linkedin&logoColor=white&style=flat-square
892
- [share-mastodon-link]: https://mastodon.social/share?text=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeChat%20-%20An%20open-source,%20extensible%20(Function%20Calling),%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT/LLM%20web%20application.%20https://github.com/lobehub/lobe-chat%20#chatbot%20#chatGPT%20#openAI
893
+ [share-mastodon-link]: https://mastodon.social/share?text=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeChat%20-%20An%20open-source,%20extensible%20%28Function%20Calling%29,%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT%2FLLM%20web%20application.%20https://github.com/lobehub/lobe-chat%20#chatbot%20#chatGPT%20#openAI
893
894
  [share-mastodon-shield]: https://img.shields.io/badge/-share%20on%20mastodon-black?labelColor=black&logo=mastodon&logoColor=white&style=flat-square
894
895
  [share-reddit-link]: https://www.reddit.com/submit?title=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeChat%20-%20An%20open-source%2C%20extensible%20%28Function%20Calling%29%2C%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT%2FLLM%20web%20application.%20%23chatbot%20%23chatGPT%20%23openAI&url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat
895
896
  [share-reddit-shield]: https://img.shields.io/badge/-share%20on%20reddit-black?labelColor=black&logo=reddit&logoColor=white&style=flat-square
package/README.zh-CN.md CHANGED
@@ -191,13 +191,14 @@ LobeChat 支持文件上传与知识库功能,你可以上传文件、图片
191
191
  - **[Bedrock](https://lobechat.com/discover/provider/bedrock)**: Bedrock 是亚马逊 AWS 提供的一项服务,专注于为企业提供先进的 AI 语言模型和视觉模型。其模型家族包括 Anthropic 的 Claude 系列、Meta 的 Llama 3.1 系列等,涵盖从轻量级到高性能的多种选择,支持文本生成、对话、图像处理等多种任务,适用于不同规模和需求的企业应用。
192
192
  - **[Google](https://lobechat.com/discover/provider/google)**: Google 的 Gemini 系列是其最先进、通用的 AI 模型,由 Google DeepMind 打造,专为多模态设计,支持文本、代码、图像、音频和视频的无缝理解与处理。适用于从数据中心到移动设备的多种环境,极大提升了 AI 模型的效率与应用广泛性。
193
193
  - **[DeepSeek](https://lobechat.com/discover/provider/deepseek)**: DeepSeek 是一家专注于人工智能技术研究和应用的公司,其最新模型 DeepSeek-V3 多项评测成绩超越 Qwen2.5-72B 和 Llama-3.1-405B 等开源模型,性能对齐领军闭源模型 GPT-4o 与 Claude-3.5-Sonnet。
194
+ - **[PPIO](https://lobechat.com/discover/provider/ppio)**: PPIO 派欧云提供稳定、高性价比的开源模型 API 服务,支持 DeepSeek 全系列、Llama、Qwen 等行业领先大模型。
194
195
  - **[HuggingFace](https://lobechat.com/discover/provider/huggingface)**: HuggingFace Inference API 提供了一种快速且免费的方式,让您可以探索成千上万种模型,适用于各种任务。无论您是在为新应用程序进行原型设计,还是在尝试机器学习的功能,这个 API 都能让您即时访问多个领域的高性能模型。
195
196
  - **[OpenRouter](https://lobechat.com/discover/provider/openrouter)**: OpenRouter 是一个提供多种前沿大模型接口的服务平台,支持 OpenAI、Anthropic、LLaMA 及更多,适合多样化的开发和应用需求。用户可根据自身需求灵活选择最优的模型和价格,助力 AI 体验的提升。
196
197
  - **[Cloudflare Workers AI](https://lobechat.com/discover/provider/cloudflare)**: 在 Cloudflare 的全球网络上运行由无服务器 GPU 驱动的机器学习模型。
197
- - **[GitHub](https://lobechat.com/discover/provider/github)**: 通过 GitHub 模型,开发人员可以成为 AI 工程师,并使用行业领先的 AI 模型进行构建。
198
198
 
199
- <details><summary><kbd>See more providers (+26)</kbd></summary>
199
+ <details><summary><kbd>See more providers (+27)</kbd></summary>
200
200
 
201
+ - **[GitHub](https://lobechat.com/discover/provider/github)**: 通过 GitHub 模型,开发人员可以成为 AI 工程师,并使用行业领先的 AI 模型进行构建。
201
202
  - **[Novita](https://lobechat.com/discover/provider/novita)**: Novita AI 是一个提供多种大语言模型与 AI 图像生成的 API 服务的平台,灵活、可靠且具有成本效益。它支持 Llama3、Mistral 等最新的开源模型,并为生成式 AI 应用开发提供了全面、用户友好且自动扩展的 API 解决方案,适合 AI 初创公司的快速发展。
202
203
  - **[Together AI](https://lobechat.com/discover/provider/togetherai)**: Together AI 致力于通过创新的 AI 模型实现领先的性能,提供广泛的自定义能力,包括快速扩展支持和直观的部署流程,满足企业的各种需求。
203
204
  - **[Fireworks AI](https://lobechat.com/discover/provider/fireworksai)**: Fireworks AI 是一家领先的高级语言模型服务商,专注于功能调用和多模态处理。其最新模型 Firefunction V2 基于 Llama-3,优化用于函数调用、对话及指令跟随。视觉语言模型 FireLLaVA-13B 支持图像和文本混合输入。其他 notable 模型包括 Llama 系列和 Mixtral 系列,提供高效的多语言指令跟随与生成支持。
@@ -227,7 +228,7 @@ LobeChat 支持文件上传与知识库功能,你可以上传文件、图片
227
228
 
228
229
  </details>
229
230
 
230
- > 📊 Total providers: [<kbd>**36**</kbd>](https://lobechat.com/discover/providers)
231
+ > 📊 Total providers: [<kbd>**37**</kbd>](https://lobechat.com/discover/providers)
231
232
 
232
233
  <!-- PROVIDER LIST -->
233
234
 
package/changelog/v1.json CHANGED
@@ -1,4 +1,25 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Fix page crash with crawler error."
6
+ ]
7
+ },
8
+ "date": "2025-03-03",
9
+ "version": "1.68.1"
10
+ },
11
+ {
12
+ "children": {
13
+ "features": [
14
+ "Add new model provider PPIO."
15
+ ],
16
+ "fixes": [
17
+ "Fix search web-browsing display bug."
18
+ ]
19
+ },
20
+ "date": "2025-03-03",
21
+ "version": "1.68.0"
22
+ },
2
23
  {
3
24
  "children": {
4
25
  "fixes": [
@@ -27,11 +27,12 @@ By setting the environment variables `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CL
27
27
 
28
28
  Before using NextAuth, please set the following variables in LobeChat's environment variables:
29
29
 
30
- | Environment Variable | Type | Description |
31
- | ------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
32
- | `NEXT_AUTH_SECRET` | Required | The key used to encrypt Auth.js session tokens. You can use the following command: `openssl rand -base64 32`, or visit `https://generate-secret.vercel.app/32` to generate the key. |
33
- | `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js when performing OAuth verification. Set this only if the default generated redirect address is incorrect. `https://example.com/api/auth` |
34
- | `NEXT_AUTH_SSO_PROVIDERS` | Optional | This environment variable is used to enable multiple identity verification sources simultaneously, separated by commas, for example, `auth0,microsoft-entra-id,authentik`. |
30
+ | Environment Variable | Type | Description |
31
+ | ------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
32
+ | `NEXT_PUBLIC_ENABLE_NEXT_AUTH` | Required | This is used to enable the NextAuth service. Set it to `1` to enable it; changing this setting requires recompiling the application. Users deploying with the `lobehub/lobe-chat-database` image have this configuration added by default. |
33
+ | `NEXT_AUTH_SECRET` | Required | The key used to encrypt Auth.js session tokens. You can use the following command: `openssl rand -base64 32`, or visit `https://generate-secret.vercel.app/32` to generate the key. |
34
+ | `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js when performing OAuth verification. Set this only if the default generated redirect address is incorrect. `https://example.com/api/auth` |
35
+ | `NEXT_AUTH_SSO_PROVIDERS` | Optional | This environment variable is used to enable multiple identity verification sources simultaneously, separated by commas, for example, `auth0,microsoft-entra-id,authentik`. |
35
36
 
36
37
  Currently supported identity verification services include:
37
38
 
@@ -24,11 +24,12 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全
24
24
 
25
25
  在使用 NextAuth 之前,请先在 LobeChat 的环境变量中设置以下变量:
26
26
 
27
- | 环境变量 | 类型 | 描述 |
28
- | ------------------------- | -- | ------------------------------------------------------------------------------------------------------------ |
29
- | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令: `openssl rand -base64 32`,或者访问 `https://generate-secret.vercel.app/32` 生成秘钥。 |
30
- | `NEXTAUTH_URL` | 必选 | URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
31
- | `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 该环境变量用于同时启用多个身份验证源,以逗号 `,` 分割,例如 `auth0,microsoft-entra-id,authentik`。 |
27
+ | 环境变量 | 类型 | 描述 |
28
+ | ------------------------------ | -- | ------------------------------------------------------------------------------------------------------------ |
29
+ | `NEXT_PUBLIC_ENABLE_NEXT_AUTH` | 必选 | 用于启用 NextAuth 服务,设置为 `1` 以启用,更改此项需要重新编译应用。使用 `lobehub/lobe-chat-database` 镜像部署的用户已经默认添加了该项配置。 |
30
+ | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令: `openssl rand -base64 32`,或者访问 `https://generate-secret.vercel.app/32` 生成秘钥。 |
31
+ | `NEXTAUTH_URL` | 必选 | URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
32
+ | `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 该环境变量用于同时启用多个身份验证源,以逗号 `,` 分割,例如 `auth0,microsoft-entra-id,authentik`。 |
32
33
 
33
34
  目前支持的身份验证服务有:
34
35
 
@@ -217,6 +217,22 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
217
217
  - Default: `-`
218
218
  - Example: `-all,+01-ai/yi-34b-chat,+huggingfaceh4/zephyr-7b-beta`
219
219
 
220
+ ## PPIO
221
+
222
+ ### `PPIO_API_KEY`
223
+
224
+ - Type: Required
225
+ - Description: This your PPIO API Key.
226
+ - Default: -
227
+ - Example: `sk_xxxxxxxxxx`
228
+
229
+ ### `PPIO_MODEL_LIST`
230
+
231
+ - Type: Optional
232
+ - Description: Used to control the model list, use `+` to add a model, use `-` to hide a model, use `model_name=display_name` to customize the display name of a model, separated by commas. Definition syntax rules see [model-list][model-list]
233
+ - Default: `-`
234
+ - Example: `-all,+deepseek/deepseek-v3/community,+deepseek/deepseek-r1-distill-llama-70b`
235
+
220
236
  ## Github
221
237
 
222
238
  ### `GITHUB_TOKEN`
@@ -215,6 +215,22 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
215
215
  - 默认值:`-`
216
216
  - 示例:`-all,+01-ai/yi-34b-chat,+huggingfaceh4/zephyr-7b-beta`
217
217
 
218
+ ## PPIO
219
+
220
+ ### `PPIO_API_KEY`
221
+
222
+ - 类型:必选
223
+ - 描述:这是你在 PPIO 网站申请的 API 密钥
224
+ - 默认值:-
225
+ - 示例:`sk_xxxxxxxxxxxx`
226
+
227
+ ### `PPIO_MODEL_LIST`
228
+
229
+ - 类型:可选
230
+ - 描述:用来控制模型列表,使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名<扩展配置>` 来自定义模型的展示名,用英文逗号隔开。模型定义语法规则见 [模型列表][model-list]
231
+ - 默认值:`-`
232
+ - 示例:`-all,+deepseek/deepseek-v3/community,+deepseek/deepseek-r1-distill-llama-70b`
233
+
218
234
  ## Github
219
235
 
220
236
  ### `GITHUB_TOKEN`
@@ -0,0 +1,57 @@
1
+ ---
2
+ title: Using PPIO API Key in LobeChat
3
+ description: >-
4
+ Learn how to integrate PPIO's language model APIs into LobeChat. Follow
5
+ the steps to register, create an PPIO API key, configure settings, and
6
+ chat with our various AI models.
7
+ tags:
8
+ - PPIO
9
+ - DeepSeek
10
+ - Llama
11
+ - Qwen
12
+ - uncensored
13
+ - API key
14
+ - Web UI
15
+ ---
16
+
17
+ # Using PPIO in LobeChat
18
+
19
+ <Image alt={'Using PPIO in LobeChat'} cover src={''} />
20
+
21
+ [PPIO](https://ppinfra.com?utm_source=github_lobe-chat&utm_medium=github_readme&utm_campaign=link) supports stable and cost-efficient open-source LLM APIs, such as DeepSeek, Llama, Qwen etc.
22
+
23
+ This document will guide you on how to integrate PPIO in LobeChat:
24
+
25
+ <Steps>
26
+ ### Step 1: Register and Log in to PPIO
27
+
28
+ - Visit [PPIO](https://ppinfra.com?utm_source=github_lobe-chat&utm_medium=github_readme&utm_campaign=link) and create an account
29
+ - Upon registration, PPIO will provide a ¥5 credit (about 5M tokens).
30
+
31
+ <Image alt={'Register PPIO'} height={457} inStep src={'https://github.com/user-attachments/assets/7cb3019b-78c1-48e0-a64c-a6a4836affd9'} />
32
+
33
+ ### Step 2: Obtain the API Key
34
+
35
+ - Visit PPIO's [key management page](https://ppinfra.com/settings/key-management), create and copy an API Key.
36
+
37
+ <Image alt={'Obtain PPIO API key'} inStep src={'https://github.com/user-attachments/assets/5abcf21d-5a6c-4fc8-8de6-bc47d4d2fa98'} />
38
+
39
+ ### Step 3: Configure PPIO in LobeChat
40
+
41
+ - Visit the `Settings` interface in LobeChat
42
+ - Find the setting for `PPIO` under `Language Model`
43
+
44
+ <Image alt={'Enter PPIO API key in LobeChat'} inStep src={'https://github.com/user-attachments/assets/000d6a5b-f8d4-4fd5-84cd-31556c5c1efd'} />
45
+
46
+ - Open PPIO and enter the obtained API key
47
+ - Choose a PPIO model for your assistant to start the conversation
48
+
49
+ <Image alt={'Select and use PPIO model'} inStep src={'https://github.com/user-attachments/assets/207888f1-df21-4063-8e66-97b0d9cfa02e'} />
50
+
51
+ <Callout type={'warning'}>
52
+ During usage, you may need to pay the API service provider, please refer to PPIO's [pricing
53
+ policy](https://ppinfra.com/llm-api?utm_source=github_lobe-chat&utm_medium=github_readme&utm_campaign=link).
54
+ </Callout>
55
+ </Steps>
56
+
57
+ You can now engage in conversations using the models provided by PPIO in LobeChat.
@@ -0,0 +1,55 @@
1
+ ---
2
+ title: 在 LobeChat 中使用 PPIO 派欧云 API Key
3
+ description: >-
4
+ 学习如何将 PPIO 派欧云的 LLM API 集成到 LobeChat 中。跟随以下步骤注册 PPIO 账号、创建 API
5
+ Key、并在 LobeChat 中进行设置。
6
+ tags:
7
+ - PPIO
8
+ - PPInfra
9
+ - DeepSeek
10
+ - Qwen
11
+ - Llama3
12
+ - API key
13
+ - Web UI
14
+ ---
15
+
16
+ # 在 LobeChat 中使用 PPIO 派欧云
17
+
18
+ <Image alt={'在 LobeChat 中使用 PPIO'} cover src={''} />
19
+
20
+ [PPIO 派欧云](https://ppinfra.com?utm_source=github_lobe-chat&utm_medium=github_readme&utm_campaign=link)提供稳定、高性价比的开源模型 API 服务,支持 DeepSeek 全系列、Llama、Qwen 等行业领先大模型。
21
+
22
+ 本文档将指导你如何在 LobeChat 中使用 PPIO:
23
+
24
+ <Steps>
25
+ ### 步骤一:注册 PPIO 派欧云账号并登录
26
+
27
+ - 访问 [PPIO 派欧云](https://ppinfra.com?utm_source=github_lobe-chat&utm_medium=github_readme&utm_campaign=link) 并注册账号
28
+ - 注册后,PPIO 会赠送 5 元(约 500 万 tokens)的使用额度
29
+
30
+ <Image alt={'注册 PPIO'} height={457} inStep src={'https://github.com/user-attachments/assets/7cb3019b-78c1-48e0-a64c-a6a4836affd9'} />
31
+
32
+ ### 步骤二:创建 API 密钥
33
+
34
+ - 访问 PPIO 派欧云的 [密钥管理页面](https://ppinfra.com/settings/key-management) ,创建并且复制一个 API 密钥.
35
+
36
+ <Image alt={'创建 PPIO API 密钥'} inStep src={'https://github.com/user-attachments/assets/5abcf21d-5a6c-4fc8-8de6-bc47d4d2fa98'} />
37
+
38
+ ### 步骤三:在 LobeChat 中配置 PPIO 派欧云
39
+
40
+ - 访问 LobeChat 的 `设置` 界面
41
+ - 在 `语言模型` 下找到 `PPIO` 的设置项
42
+ - 打开 PPIO 并填入获得的 API 密钥
43
+
44
+ <Image alt={'在 LobeChat 中输入 PPIO API 密钥'} inStep src={'https://github.com/user-attachments/assets/4eaadac7-595c-41ad-a6e0-64c3105577d7'} />
45
+
46
+ - 为你的助手选择一个 Novita AI 模型即可开始对话
47
+
48
+ <Image alt={'选择并使用 PPIO 模型'} inStep src={'https://github.com/user-attachments/assets/8cf66e00-04fe-4bad-9e3d-35afc7d9aa58'} />
49
+
50
+ <Callout type={'warning'}>
51
+ 在使用过程中你可能需要向 API 服务提供商付费,PPIO 的 API 费用参考[这里](https://ppinfra.com/llm-api?utm_source=github_lobe-chat&utm_medium=github_readme&utm_campaign=link)。
52
+ </Callout>
53
+ </Steps>
54
+
55
+ 至此你已经可以在 LobeChat 中使用 Novita AI 提供的模型进行对话了。
@@ -139,5 +139,8 @@
139
139
  },
140
140
  "zhipu": {
141
141
  "description": "Zhipu AI offers an open platform for multimodal and language models, supporting a wide range of AI application scenarios, including text processing, image understanding, and programming assistance."
142
+ },
143
+ "ppio": {
144
+ "description": "PPIO supports stable and cost-efficient open-source LLM APIs, such as DeepSeek, Llama, Qwen etc."
142
145
  }
143
146
  }
@@ -139,5 +139,9 @@
139
139
  },
140
140
  "zhipu": {
141
141
  "description": "智谱 AI 提供多模态与语言模型的开放平台,支持广泛的AI应用场景,包括文本处理、图像理解与编程辅助等。"
142
+ },
143
+ "ppio": {
144
+ "description": "PPIO 派欧云提供稳定、高性价比的开源模型 API 服务,支持 DeepSeek 全系列、Llama、Qwen 等行业领先大模型。"
142
145
  }
143
146
  }
147
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.67.2",
3
+ "version": "1.68.1",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -30,11 +30,11 @@
30
30
  ],
31
31
  "scripts": {
32
32
  "build": "next build",
33
- "build:analyze": "ANALYZE=true next build",
34
- "build:docker": "DOCKER=true next build && npm run build-sitemap",
35
33
  "postbuild": "npm run build-sitemap && npm run build-migrate-db",
36
34
  "build-migrate-db": "bun run db:migrate",
37
35
  "build-sitemap": "tsx ./scripts/buildSitemapIndex/index.ts",
36
+ "build:analyze": "ANALYZE=true next build",
37
+ "build:docker": "DOCKER=true next build && npm run build-sitemap",
38
38
  "db:generate": "drizzle-kit generate && npm run db:generate-client",
39
39
  "db:generate-client": "tsx ./scripts/migrateClientDB/compile-migrations.ts",
40
40
  "db:migrate": "MIGRATION_DB=1 tsx ./scripts/migrateServerDB/index.ts",
@@ -62,11 +62,11 @@
62
62
  "start": "next start -p 3210",
63
63
  "stylelint": "stylelint \"src/**/*.{js,jsx,ts,tsx}\" --fix",
64
64
  "test": "npm run test-app && npm run test-server",
65
- "test:update": "vitest -u",
66
65
  "test-app": "vitest run --config vitest.config.ts",
67
66
  "test-app:coverage": "vitest run --config vitest.config.ts --coverage",
68
67
  "test-server": "vitest run --config vitest.server.config.ts",
69
68
  "test-server:coverage": "vitest run --config vitest.server.config.ts --coverage",
69
+ "test:update": "vitest -u",
70
70
  "type-check": "tsc --noEmit",
71
71
  "webhook:ngrok": "ngrok http http://localhost:3011",
72
72
  "workflow:cdn": "tsx ./scripts/cdnWorkflow/index.ts",
@@ -107,7 +107,7 @@
107
107
  "dependencies": {
108
108
  "@ant-design/icons": "^5.5.2",
109
109
  "@ant-design/pro-components": "^2.8.3",
110
- "@anthropic-ai/sdk": "^0.37.0",
110
+ "@anthropic-ai/sdk": "^0.39.0",
111
111
  "@auth/core": "^0.38.0",
112
112
  "@aws-sdk/client-bedrock-runtime": "^3.723.0",
113
113
  "@aws-sdk/client-s3": "^3.723.0",
@@ -1,34 +1,61 @@
1
1
  # @lobechat/web-crawler
2
2
 
3
- LobeChat 内置的网页抓取模块,用于从网页中提取结构化内容,并转换为 Markdown 格式。
3
+ LobeChat's built-in web crawling module for intelligent extraction of web content and conversion to Markdown format.
4
4
 
5
- ## 📝 简介
5
+ ## 📝 Introduction
6
6
 
7
- `@lobechat/web-crawler` LobeChat 项目的内部组件,专门负责网页内容的抓取和处理。它能够智能地从各种网页中提取有意义的内容,剔除广告、导航栏等干扰元素,并将结果转换为结构良好的 Markdown 文本。
7
+ `@lobechat/web-crawler` is a core component of LobeChat responsible for intelligent web content crawling and processing. It extracts valuable content from various webpages, filters out distracting elements, and generates structured Markdown text.
8
8
 
9
- ## 🔍 主要功能
9
+ ## 🛠️ Core Features
10
10
 
11
- - **网页内容抓取**:支持从各类网站获取原始 HTML 内容
12
- - **智能内容提取**:使用 Mozilla Readability 算法识别页面中的主要内容
13
- - **降级处理机制**:当标准抓取失败时,自动切换到 Browserless.io 服务进行渲染抓取(需要自行配置环境变量)
14
- - **Markdown 转换**:将提取的 HTML 内容转换为易于 AI 处理的 Markdown 格式
11
+ - **Intelligent Content Extraction**: Identifies main content based on Mozilla Readability algorithm
12
+ - **Multi-level Crawling Strategy**: Supports multiple crawling implementations including basic crawling, Jina, and Browserless rendering
13
+ - **Custom URL Rules**: Handles specific website crawling logic through a flexible rule system
15
14
 
16
- ## 🛠️ 技术实现
15
+ ## 🤝 Contribution
17
16
 
18
- 该模块主要依赖以下技术:
17
+ Web structures are diverse and complex. We welcome community contributions for specific website crawling rules. You can participate in improvements through:
19
18
 
20
- - **@mozilla/readability**:提供了强大的内容提取算法
21
- - **happy-dom**:轻量级的服务端 DOM 实现
22
- - **node-html-markdown**:高效的 HTML 到 Markdown 转换工具
19
+ ### How to Contribute URL Rules
23
20
 
24
- ## 🤝 共建改进
21
+ 1. Add new rules to the [urlRules.ts](https://github.com/lobehub/lobe-chat/blob/main/packages/web-crawler/src/urlRules.ts) file
22
+ 2. Rule example:
25
23
 
26
- 由于网页结构的多样性和复杂性,内容提取可能会遇到各种挑战。如果您发现某些网站的抓取效果不佳,欢迎通过以下方式参与改进:
24
+ ```typescript
25
+ // Example: handling specific websites
26
+ const url = [
27
+ // ... other URL matching rules
28
+ {
29
+ // URL matching pattern, supports regex
30
+ urlPattern: 'https://example.com/articles/(.*)',
27
31
 
28
- 1. 提交具体的问题网址和期望的输出结果
29
- 2. 分享您对特定网站类型的处理经验
30
- 3. 提出针对性的算法或配置调整建议
32
+ // Optional: URL transformation, redirects to an easier-to-crawl version
33
+ urlTransform: 'https://example.com/print/$1',
31
34
 
32
- ## 📌 注意事项
35
+ // Optional: specify crawling implementation, supports 'naive', 'jina', and 'browserless'
36
+ impls: ['naive', 'jina', 'browserless'],
33
37
 
34
- 这是 LobeHub 的内部模块(`"private": true`),不作为独立包发布使用。它专为 LobeChat 的特定需求设计,与其他系统组件紧密集成。
38
+ // Optional: content filtering configuration
39
+ filterOptions: {
40
+ // Whether to enable Readability algorithm for filtering distracting elements
41
+ enableReadability: true,
42
+ // Whether to convert to plain text
43
+ pureText: false,
44
+ },
45
+ },
46
+ ];
47
+ ```
48
+
49
+ ### Rule Submission Process
50
+
51
+ 1. Fork the [LobeChat repository](https://github.com/lobehub/lobe-chat)
52
+ 2. Add or modify URL rules
53
+ 3. Submit a Pull Request describing:
54
+
55
+ - Target website characteristics
56
+ - Problems solved by the rule
57
+ - Test cases (example URLs)
58
+
59
+ ## 📌 Note
60
+
61
+ This is an internal module of LobeHub (`"private": true`), designed specifically for LobeChat and not published as a standalone package.
@@ -0,0 +1,61 @@
1
+ # @lobechat/web-crawler
2
+
3
+ LobeChat 内置的网页抓取模块,用于智能提取网页内容并转换为 Markdown 格式。
4
+
5
+ ## 📝 简介
6
+
7
+ `@lobechat/web-crawler` 是 LobeChat 的核心组件,负责网页内容的智能抓取与处理。它能够从各类网页中提取有价值的内容,过滤掉干扰元素,并生成结构化的 Markdown 文本。
8
+
9
+ ## 🛠️ 核心功能
10
+
11
+ - **智能内容提取**:基于 Mozilla Readability 算法识别主要内容
12
+ - **多级抓取策略**:支持多种抓取实现,包括基础抓取、Jina 和 Browserless 渲染抓取
13
+ - **自定义 URL 规则**:通过灵活的规则系统处理特定网站的抓取逻辑
14
+
15
+ ## 🤝 参与共建
16
+
17
+ 网页结构多样复杂,我们欢迎社区贡献特定网站的抓取规则。您可以通过以下方式参与改进:
18
+
19
+ ### 如何贡献 URL 规则
20
+
21
+ 1. 在 [urlRules.ts](https://github.com/lobehub/lobe-chat/blob/main/packages/web-crawler/src/urlRules.ts) 文件中添加新规则
22
+ 2. 规则示例:
23
+
24
+ ```typescript
25
+ // 示例:处理特定网站
26
+ const url = [
27
+ // ... 其他 url 匹配规则
28
+ {
29
+ // URL 匹配模式,仅支持正则表达式
30
+ urlPattern: 'https://example.com/articles/(.*)',
31
+
32
+ // 可选:URL 转换,用于重定向到更易抓取的版本
33
+ urlTransform: 'https://example.com/print/$1',
34
+
35
+ // 可选:指定抓取实现方式,支持 'naive'、'jina' 和 'browserless' 三种
36
+ impls: ['naive', 'jina', 'browserless'],
37
+
38
+ // 可选:内容过滤配置
39
+ filterOptions: {
40
+ // 是否启用 Readability 算法,用于过滤干扰元素
41
+ enableReadability: true,
42
+ // 是否转换为纯文本
43
+ pureText: false,
44
+ },
45
+ },
46
+ ];
47
+ ```
48
+
49
+ ### 规则提交流程
50
+
51
+ 1. Fork [LobeChat 仓库](https://github.com/lobehub/lobe-chat)
52
+ 2. 添加或修改 URL 规则
53
+ 3. 提交 Pull Request 并描述:
54
+
55
+ - 目标网站特点
56
+ - 规则解决的问题
57
+ - 测试用例(示例 URL)
58
+
59
+ ## 📌 注意事项
60
+
61
+ 这是 LobeHub 的内部模块(`"private": true`),专为 LobeChat 设计,不作为独立包发布使用。