Skip to content

Commit

Permalink
Merge branch 'main' into fix/clean-openai-model
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx authored Dec 11, 2023
2 parents 14dd342 + 4a8dfa5 commit 5639b60
Show file tree
Hide file tree
Showing 13 changed files with 197 additions and 26 deletions.
75 changes: 75 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,81 @@

# Changelog

### [Version 0.110.7](https://github.com/lobehub/lobe-chat/compare/v0.110.6...v0.110.7)

<sup>Released on **2023-12-11**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix language settings may not take effect.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

- **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))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 0.110.6](https://github.com/lobehub/lobe-chat/compare/v0.110.5...v0.110.6)

<sup>Released on **2023-12-11**</sup>

#### 🐛 Bug Fixes

- **misc**: Sharp missing in docker production.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

- **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))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 0.110.5](https://github.com/lobehub/lobe-chat/compare/v0.110.4...v0.110.5)

<sup>Released on **2023-12-10**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix setting plugin i18n.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

- **misc**: Fix setting plugin i18n, closes [#606](https://github.com/lobehub/lobe-chat/issues/606) ([4e18ebf](https://github.com/lobehub/lobe-chat/commit/4e18ebf))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 0.110.4](https://github.com/lobehub/lobe-chat/compare/v0.110.3...v0.110.4)

<sup>Released on **2023-12-08**</sup>
Expand Down
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
FROM node:20-slim AS base

## Sharp dependencies, copy all the files for production
FROM base AS sharp
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

WORKDIR /app

RUN pnpm add sharp

## Install dependencies only when needed
FROM base AS builder
ENV PNPM_HOME="/pnpm"
Expand All @@ -14,9 +24,6 @@ COPY package.json ./
# RUN npm config set registry https://registry.npmmirror.com/
RUN pnpm i

# https://nextjs.org/docs/messages/sharp-missing-in-production
ENV NEXT_SHARP_PATH /app/node_modules/sharp

COPY . .
RUN pnpm run build:docker # run build standalone for docker version

Expand All @@ -39,6 +46,7 @@ RUN chown nextjs:nodejs .next
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=sharp --chown=nextjs:nodejs /app/node_modules/.pnpm ./node_modules/.pnpm

USER nextjs

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ e-commerce platform data access, and various third-party services.
| [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` |
| [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` |

> 📊 Total plugins: [<kbd>**4**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
> 📊 Total plugins: [<kbd>**5**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
<!-- PLUGIN LIST -->

Expand Down Expand Up @@ -204,14 +204,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
<!-- AGENT LIST -->

| Recent Submits | Description |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [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` |
| [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` |
| [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` |
| [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` |
| Recent Submits | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [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` |
| [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` |
| [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` |
| [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` |

> 📊 Total agents: [<kbd>**56**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
> 📊 Total agents: [<kbd>**57**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
<!-- AGENT LIST -->

Expand Down
16 changes: 8 additions & 8 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
| [搜索引擎](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/>`网络` `搜索` |
| [实时天气](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/>`天气` `实时` |

> 📊 Total plugins: [<kbd>**4**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
> 📊 Total plugins: [<kbd>**5**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
<!-- PLUGIN LIST -->

Expand Down Expand Up @@ -181,14 +181,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
<!-- AGENT LIST -->

| 最近新增 | 助手说明 |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| [食谱生成器](https://chat-preview.lobehub.com/market?agent=recipe-generator)<br/><sup>By **[Igroshka](https://github.com/Igroshka)** on **2023-12-08**</sup> | 描述食谱,或发送菜名。<br/>`厨房` `烘焙` `食物` `食谱` `烹饪` |
| [代码魔法师](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` |
| [Mr. Feynman](https://chat-preview.lobehub.com/market?agent=mrfeynman)<br/><sup>By **[jjy1000](https://github.com/jjy1000)** on **2023-12-04**</sup> | 对你提出的复杂知识概念进行通俗性解释,帮助你理解复杂的知识概念。同时可以对包含答案和问题的知识类型进行解释。<br/>`通用教师助手` |
| [有机化学研究员](https://chat-preview.lobehub.com/market?agent=organic-chemistry-researcher)<br/><sup>By **[y22emc2](https://github.com/y22emc2)** on **2023-12-02**</sup> | 擅长有机化学领域的学术翻译和写作<br/>`有机化学` `科研` `翻译` `写作` `学术文章` |
| 最近新增 | 助手说明 |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
| [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` |
| [食谱生成器](https://chat-preview.lobehub.com/market?agent=recipe-generator)<br/><sup>By **[Igroshka](https://github.com/Igroshka)** on **2023-12-08**</sup> | 描述食谱,或发送菜名。<br/>`厨房` `烘焙` `食物` `食谱` `烹饪` |
| [代码魔法师](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` |
| [Mr. Feynman](https://chat-preview.lobehub.com/market?agent=mrfeynman)<br/><sup>By **[jjy1000](https://github.com/jjy1000)** on **2023-12-04**</sup> | 对你提出的复杂知识概念进行通俗性解释,帮助你理解复杂的知识概念。同时可以对包含答案和问题的知识类型进行解释。<br/>`通用教师助手` |

> 📊 Total agents: [<kbd>**56**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
> 📊 Total agents: [<kbd>**57**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
<!-- AGENT LIST -->

Expand Down
4 changes: 4 additions & 0 deletions docs/Docker-Deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ $ docker run -d -p 3210:3210 \
> - The password set in the official Docker image is `lobe66` by default. Replace it with your own password to improve security.
> - 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.
> \[!WARNING]
>
> 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).
#### Use a proxy address

If you need to use OpenAI service through a proxy, you can use the `OPENAI_PROXY_URL` environment variable to configure the proxy address:
Expand Down
4 changes: 4 additions & 0 deletions docs/Docker-Deployment.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ $ docker run -d -p 3210:3210 \
> - 官方 Docker 镜像中设定的密码默认为 `lobe66`,请将其替换为自己的密码以提升安全性
> - LobeChat 支持的完整环境变量列表请参考 [环境变量](https://github.com/lobehub/lobe-chat/wiki/Environment-Variable.zh-CN) 部分
> \[!WARNING]
>
> 注意,当**部署架构与镜像的不一致时**,需要对 **Sharp** 进行交叉编译,详见 [Sharp 交叉编译](https://sharp.pixelplumbing.com/install#cross-platform)
#### 使用代理地址

如果你需要通过代理使用 OpenAI 服务,你可以使用 `OPENAI_PROXY_URL` 环境变量来配置代理地址:
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lobehub/chat",
"version": "0.110.4",
"version": "0.110.7",
"description": "An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application",
"keywords": [
"chatbot",
Expand Down Expand Up @@ -144,7 +144,7 @@
"@types/ua-parser-js": "^0.7",
"@types/uuid": "^9",
"@umijs/lint": "^4",
"@vitest/coverage-v8": "^1",
"@vitest/coverage-v8": "0.34.6",
"commitlint": "^18",
"consola": "^3",
"dpdm": "^3",
Expand All @@ -162,7 +162,7 @@
"stylelint": "^15",
"ts-node": "^10",
"typescript": "^5",
"vitest": "^1"
"vitest": "0.34.6"
},
"publishConfig": {
"access": "public",
Expand Down
2 changes: 2 additions & 0 deletions src/const/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export const DEFAUTT_AGENT_TTS_CONFIG: LobeAgentTTSConfig = {

export const VISION_MODEL_DEFAULT_MAX_TOKENS = 1000;

export const COOKIE_CACHE_DAYS = 30;

export const DEFAULT_AGENT_CONFIG: LobeAgentConfig = {
autoCreateTopicThreshold: 2,
displayMode: 'chat',
Expand Down
4 changes: 2 additions & 2 deletions src/features/AgentSetting/AgentPlugin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const AgentPlugin = memo(() => {
s.toggleAgentPlugin,
]);

const installedPlugins = useToolStore(pluginSelectors.installedPlugins, isEqual);
const installedPlugins = useToolStore(pluginSelectors.installedPluginMetaList, isEqual);
const useFetchInstalledPlugins = useToolStore((s) => s.useFetchInstalledPlugins);

const { isLoading } = useFetchInstalledPlugins();
Expand All @@ -36,7 +36,7 @@ const AgentPlugin = memo(() => {

// =========== Plugin List =========== //

const list = installedPlugins.map(({ identifier, type, manifest: { meta } = {} }) => {
const list = installedPlugins.map(({ identifier, type, meta }) => {
const isCustomPlugin = type === 'customPlugin';

return {
Expand Down
2 changes: 2 additions & 0 deletions src/locales/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { initReactI18next } from 'react-i18next';

import { getClientConfig } from '@/config/client';
import { DEFAULT_LANG, LOBE_LOCALE_COOKIE } from '@/const/locale';
import { COOKIE_CACHE_DAYS } from '@/const/settings';
import type { Namespaces } from '@/types/locale';
import { isOnServerSide } from '@/utils/env';

Expand Down Expand Up @@ -39,6 +40,7 @@ export const createI18nNext = (lang?: string) => {
defaultNS: ['error', 'common'],
detection: {
caches: ['cookie'],
cookieMinutes: 60 * 24 * COOKIE_CACHE_DAYS,
lookupCookie: LOBE_LOCALE_COOKIE,
},
fallbackLng: DEFAULT_LANG,
Expand Down
Loading

0 comments on commit 5639b60

Please sign in to comment.