@lobehub/chat 0.110.5 → 0.110.7

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.110.7](https://github.com/lobehub/lobe-chat/compare/v0.110.6...v0.110.7)
6
+
7
+ <sup>Released on **2023-12-11**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix language settings may not take effect.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix language settings may not take effect, closes [#595](https://github.com/lobehub/lobe-chat/issues/595) ([a5db64e](https://github.com/lobehub/lobe-chat/commit/a5db64e))
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 0.110.6](https://github.com/lobehub/lobe-chat/compare/v0.110.5...v0.110.6)
31
+
32
+ <sup>Released on **2023-12-11**</sup>
33
+
34
+ #### 🐛 Bug Fixes
35
+
36
+ - **misc**: Sharp missing in docker production.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### What's fixed
44
+
45
+ - **misc**: Sharp missing in docker production, closes [#603](https://github.com/lobehub/lobe-chat/issues/603) ([d89b48d](https://github.com/lobehub/lobe-chat/commit/d89b48d))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ### [Version 0.110.5](https://github.com/lobehub/lobe-chat/compare/v0.110.4...v0.110.5)
6
56
 
7
57
  <sup>Released on **2023-12-10**</sup>
package/Dockerfile CHANGED
@@ -1,5 +1,15 @@
1
1
  FROM node:20-slim AS base
2
2
 
3
+ ## Sharp dependencies, copy all the files for production
4
+ FROM base AS sharp
5
+ ENV PNPM_HOME="/pnpm"
6
+ ENV PATH="$PNPM_HOME:$PATH"
7
+ RUN corepack enable
8
+
9
+ WORKDIR /app
10
+
11
+ RUN pnpm add sharp
12
+
3
13
  ## Install dependencies only when needed
4
14
  FROM base AS builder
5
15
  ENV PNPM_HOME="/pnpm"
@@ -14,9 +24,6 @@ COPY package.json ./
14
24
  # RUN npm config set registry https://registry.npmmirror.com/
15
25
  RUN pnpm i
16
26
 
17
- # https://nextjs.org/docs/messages/sharp-missing-in-production
18
- ENV NEXT_SHARP_PATH /app/node_modules/sharp
19
-
20
27
  COPY . .
21
28
  RUN pnpm run build:docker # run build standalone for docker version
22
29
 
@@ -39,6 +46,7 @@ RUN chown nextjs:nodejs .next
39
46
  # https://nextjs.org/docs/advanced-features/output-file-tracing
40
47
  COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
41
48
  COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
49
+ COPY --from=sharp --chown=nextjs:nodejs /app/node_modules/.pnpm ./node_modules/.pnpm
42
50
 
43
51
  USER nextjs
44
52
 
package/README.md CHANGED
@@ -172,7 +172,7 @@ e-commerce platform data access, and various third-party services.
172
172
  | [Search Engine](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **LobeHub** on **2023-08-15**</sup> | [lobehub/chat-plugin-search-engine](https://github.com/lobehub/chat-plugin-search-engine) | Query search engine to get information<br/>`web` `search` |
173
173
  | [Realtime Weather](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **LobeHub** on **2023-08-12**</sup> | [lobehub/chat-plugin-realtime-weather](https://github.com/lobehub/chat-plugin-realtime-weather) | Get realtime weather information<br/>`weather` `realtime` |
174
174
 
175
- > 📊 Total plugins: [<kbd>**4**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
175
+ > 📊 Total plugins: [<kbd>**5**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
176
176
 
177
177
  <!-- PLUGIN LIST -->
178
178
 
@@ -204,14 +204,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
204
204
 
205
205
  <!-- AGENT LIST -->
206
206
 
207
- | Recent Submits | Description |
208
- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
209
- | [Recipe Generator](https://chat-preview.lobehub.com/market?agent=recipe-generator)<br/><sup>By **[Igroshka](https://github.com/Igroshka)** on **2023-12-08**</sup> | Describe the recipe, or send the name of the dish.<br/>`kitchen` `baking` `food` `recipes` `cook` |
210
- | [Code Wizard](https://chat-preview.lobehub.com/market?agent=friend-developer)<br/><sup>By **[Igroshka](https://github.com/Igroshka)** on **2023-12-07**</sup> | Master of programming in various languages<br/>`programming` `coding` `consultation` `friend` `helper` `it` `it` |
211
- | [Mr. Feynman](https://chat-preview.lobehub.com/market?agent=mrfeynman)<br/><sup>By **[jjy1000](https://github.com/jjy1000)** on **2023-12-04**</sup> | Explains complex knowledge concepts in a popular way to help you understand complex knowledge concepts. It can also explain knowledge types containing answers and questions.<br/>`general-teacher-assistant` |
212
- | [Organic Chemistry Researcher](https://chat-preview.lobehub.com/market?agent=organic-chemistry-researcher)<br/><sup>By **[y22emc2](https://github.com/y22emc2)** on **2023-12-02**</sup> | Specializes in academic translation and writing in the field of organic chemistry<br/>`organic-chemistry` `research` `translation` `writing` `academic-articles` |
207
+ | Recent Submits | Description |
208
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
209
+ | [HTTP Request Master](https://chat-preview.lobehub.com/market?agent=http-request-master)<br/><sup>By **[Igroshka](https://github.com/Igroshka)** on **2023-12-08**</sup> | I support extensive customization) To work, be sure to download and enable the "Website Crawler" plugin!<br/>`http-request` `http` `request` `web` |
210
+ | [Recipe Generator](https://chat-preview.lobehub.com/market?agent=recipe-generator)<br/><sup>By **[Igroshka](https://github.com/Igroshka)** on **2023-12-08**</sup> | Describe the recipe, or send the name of the dish.<br/>`kitchen` `baking` `food` `recipes` `cook` |
211
+ | [Code Wizard](https://chat-preview.lobehub.com/market?agent=friend-developer)<br/><sup>By **[Igroshka](https://github.com/Igroshka)** on **2023-12-07**</sup> | Master of programming in various languages<br/>`programming` `coding` `consultation` `friend` `helper` `it` `it` |
212
+ | [Mr. Feynman](https://chat-preview.lobehub.com/market?agent=mrfeynman)<br/><sup>By **[jjy1000](https://github.com/jjy1000)** on **2023-12-04**</sup> | Explains complex knowledge concepts in a popular way to help you understand complex knowledge concepts. It can also explain knowledge types containing answers and questions.<br/>`general-teacher-assistant` |
213
213
 
214
- > 📊 Total agents: [<kbd>**56**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
214
+ > 📊 Total agents: [<kbd>**57**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
215
215
 
216
216
  <!-- AGENT LIST -->
217
217
 
package/README.zh-CN.md CHANGED
@@ -153,7 +153,7 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
153
153
  | [搜索引擎](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **LobeHub** on **2023-08-15**</sup> | [lobehub/chat-plugin-search-engine](https://github.com/lobehub/chat-plugin-search-engine) | 查询搜索引擎以获取信息<br/>`网络` `搜索` |
154
154
  | [实时天气](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **LobeHub** on **2023-08-12**</sup> | [lobehub/chat-plugin-realtime-weather](https://github.com/lobehub/chat-plugin-realtime-weather) | 获取实时天气信息<br/>`天气` `实时` |
155
155
 
156
- > 📊 Total plugins: [<kbd>**4**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
156
+ > 📊 Total plugins: [<kbd>**5**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
157
157
 
158
158
  <!-- PLUGIN LIST -->
159
159
 
@@ -181,14 +181,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
181
181
 
182
182
  <!-- AGENT LIST -->
183
183
 
184
- | 最近新增 | 助手说明 |
185
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
186
- | [食谱生成器](https://chat-preview.lobehub.com/market?agent=recipe-generator)<br/><sup>By **[Igroshka](https://github.com/Igroshka)** on **2023-12-08**</sup> | 描述食谱,或发送菜名。<br/>`厨房` `烘焙` `食物` `食谱` `烹饪` |
187
- | [代码魔法师](https://chat-preview.lobehub.com/market?agent=friend-developer)<br/><sup>By **[Igroshka](https://github.com/Igroshka)** on **2023-12-07**</sup> | 精通多种编程语言的大师<br/>`编程` `编码` `咨询` `朋友` `助手` `it` `it` |
188
- | [Mr. Feynman](https://chat-preview.lobehub.com/market?agent=mrfeynman)<br/><sup>By **[jjy1000](https://github.com/jjy1000)** on **2023-12-04**</sup> | 对你提出的复杂知识概念进行通俗性解释,帮助你理解复杂的知识概念。同时可以对包含答案和问题的知识类型进行解释。<br/>`通用教师助手` |
189
- | [有机化学研究员](https://chat-preview.lobehub.com/market?agent=organic-chemistry-researcher)<br/><sup>By **[y22emc2](https://github.com/y22emc2)** on **2023-12-02**</sup> | 擅长有机化学领域的学术翻译和写作<br/>`有机化学` `科研` `翻译` `写作` `学术文章` |
184
+ | 最近新增 | 助手说明 |
185
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
186
+ | [HTTP 请求大师](https://chat-preview.lobehub.com/market?agent=http-request-master)<br/><sup>By **[Igroshka](https://github.com/Igroshka)** on **2023-12-08**</sup> | 我支持广泛的定制。要使用,请确保下载并启用 “网站爬虫” 插件!<br/>`http-request` `http` `request` `web` |
187
+ | [食谱生成器](https://chat-preview.lobehub.com/market?agent=recipe-generator)<br/><sup>By **[Igroshka](https://github.com/Igroshka)** on **2023-12-08**</sup> | 描述食谱,或发送菜名。<br/>`厨房` `烘焙` `食物` `食谱` `烹饪` |
188
+ | [代码魔法师](https://chat-preview.lobehub.com/market?agent=friend-developer)<br/><sup>By **[Igroshka](https://github.com/Igroshka)** on **2023-12-07**</sup> | 精通多种编程语言的大师<br/>`编程` `编码` `咨询` `朋友` `助手` `it` `it` |
189
+ | [Mr. Feynman](https://chat-preview.lobehub.com/market?agent=mrfeynman)<br/><sup>By **[jjy1000](https://github.com/jjy1000)** on **2023-12-04**</sup> | 对你提出的复杂知识概念进行通俗性解释,帮助你理解复杂的知识概念。同时可以对包含答案和问题的知识类型进行解释。<br/>`通用教师助手` |
190
190
 
191
- > 📊 Total agents: [<kbd>**56**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
191
+ > 📊 Total agents: [<kbd>**57**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
192
192
 
193
193
  <!-- AGENT LIST -->
194
194
 
@@ -42,6 +42,10 @@ $ docker run -d -p 3210:3210 \
42
42
  > - The password set in the official Docker image is `lobe66` by default. Replace it with your own password to improve security.
43
43
  > - For a complete list of environment variables supported by LobeChat, please refer to the [Environment Variables](https://github.com/lobehub/lobe-chat/wiki/Environment-Variable.zh-CN) section.
44
44
 
45
+ > \[!WARNING]
46
+ >
47
+ > If the architecture of your **deployed server differs from the container architecture**, you may need to perform cross-compilation for **Sharp**. For further details, please refer to the documentation on [Sharp Cross-platform](https://sharp.pixelplumbing.com/install#cross-platform).
48
+
45
49
  #### Use a proxy address
46
50
 
47
51
  If you need to use OpenAI service through a proxy, you can use the `OPENAI_PROXY_URL` environment variable to configure the proxy address:
@@ -42,6 +42,10 @@ $ docker run -d -p 3210:3210 \
42
42
  > - 官方 Docker 镜像中设定的密码默认为 `lobe66`,请将其替换为自己的密码以提升安全性
43
43
  > - LobeChat 支持的完整环境变量列表请参考 [环境变量](https://github.com/lobehub/lobe-chat/wiki/Environment-Variable.zh-CN) 部分
44
44
 
45
+ > \[!WARNING]
46
+ >
47
+ > 注意,当**部署架构与镜像的不一致时**,需要对 **Sharp** 进行交叉编译,详见 [Sharp 交叉编译](https://sharp.pixelplumbing.com/install#cross-platform)
48
+
45
49
  #### 使用代理地址
46
50
 
47
51
  如果你需要通过代理使用 OpenAI 服务,你可以使用 `OPENAI_PROXY_URL` 环境变量来配置代理地址:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.110.5",
3
+ "version": "0.110.7",
4
4
  "description": "An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application",
5
5
  "keywords": [
6
6
  "chatbot",
@@ -30,6 +30,8 @@ export const DEFAUTT_AGENT_TTS_CONFIG: LobeAgentTTSConfig = {
30
30
 
31
31
  export const VISION_MODEL_DEFAULT_MAX_TOKENS = 1000;
32
32
 
33
+ export const COOKIE_CACHE_DAYS = 30;
34
+
33
35
  export const DEFAULT_AGENT_CONFIG: LobeAgentConfig = {
34
36
  autoCreateTopicThreshold: 2,
35
37
  displayMode: 'chat',
@@ -4,6 +4,7 @@ import { initReactI18next } from 'react-i18next';
4
4
 
5
5
  import { getClientConfig } from '@/config/client';
6
6
  import { DEFAULT_LANG, LOBE_LOCALE_COOKIE } from '@/const/locale';
7
+ import { COOKIE_CACHE_DAYS } from '@/const/settings';
7
8
  import type { Namespaces } from '@/types/locale';
8
9
  import { isOnServerSide } from '@/utils/env';
9
10
 
@@ -39,6 +40,7 @@ export const createI18nNext = (lang?: string) => {
39
40
  defaultNS: ['error', 'common'],
40
41
  detection: {
41
42
  caches: ['cookie'],
43
+ cookieMinutes: 60 * 24 * COOKIE_CACHE_DAYS,
42
44
  lookupCookie: LOBE_LOCALE_COOKIE,
43
45
  },
44
46
  fallbackLng: DEFAULT_LANG,
@@ -1,4 +1,10 @@
1
+ import dayjs from 'dayjs';
2
+
3
+ import { COOKIE_CACHE_DAYS } from '@/const/settings';
4
+
1
5
  export const setCookie = (key: string, value: string | undefined) => {
6
+ const expires = dayjs().add(COOKIE_CACHE_DAYS, 'day').toISOString();
7
+
2
8
  // eslint-disable-next-line unicorn/no-document-cookie
3
- document.cookie = `${key}=${value};path=/;`;
9
+ document.cookie = `${key}=${value};expires=${expires};path=/;`;
4
10
  };