Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/lobehub/lobe-chat
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Aug 24, 2024
2 parents 3179bf0 + 09af3b3 commit a92ce26
Show file tree
Hide file tree
Showing 17 changed files with 126 additions and 286 deletions.
67 changes: 67 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,73 @@

# Changelog

### [Version 1.12.14](https://github.com/lobehub/lobe-chat/compare/v1.12.13...v1.12.14)

<sup>Released on **2024-08-24**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix tts file saving in server mode.

<br/>

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

#### What's fixed

- **misc**: Fix tts file saving in server mode, closes [#3585](https://github.com/lobehub/lobe-chat/issues/3585) ([ab1cb47](https://github.com/lobehub/lobe-chat/commit/ab1cb47))

</details>

<div align="right">

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

</div>

### [Version 1.12.13](https://github.com/lobehub/lobe-chat/compare/v1.12.12...v1.12.13)

<sup>Released on **2024-08-24**</sup>

#### 💄 Styles

- **misc**: Update 01.AI models.

<br/>

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

#### Styles

- **misc**: Update 01.AI models, closes [#3586](https://github.com/lobehub/lobe-chat/issues/3586) ([c4a7f70](https://github.com/lobehub/lobe-chat/commit/c4a7f70))

</details>

<div align="right">

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

</div>

### [Version 1.12.12](https://github.com/lobehub/lobe-chat/compare/v1.12.11...v1.12.12)

<sup>Released on **2024-08-24**</sup>

<br/>

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

</details>

<div align="right">

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

</div>

### [Version 1.12.11](https://github.com/lobehub/lobe-chat/compare/v1.12.10...v1.12.11)

<sup>Released on **2024-08-23**</sup>
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.database
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ FROM base AS builder
ARG USE_CN_MIRROR

ENV NEXT_PUBLIC_SERVICE_MODE="server" \
APP_URL="http://app.com" \
DATABASE_DRIVER="node" \
DATABASE_URL="postgres://postgres:password@localhost:5432/postgres" \
KEY_VAULTS_SECRET="use-for-build"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,12 @@ Our marketplace is not just a showcase platform but also a collaborative space.

| Recent Submits | Description |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [TypeScript Solution Architect](https://chat-preview.lobehub.com/market?agent=typescript-developer)<br/><sup>By **[swarfte](https://github.com/swarfte)** on **2024-08-24**</sup> | Expert in TypeScript, Node.js, Vue.js 3, Nuxt.js 3, Express.js, React.js, and modern UI libraries.<br/>`type-script` `java-script` `web-development` `coding-standards` `best-practices` |
| [Variable Name Conversion Expert](https://chat-preview.lobehub.com/market?agent=variable-name-conversion)<br/><sup>By **[zengyishou](https://github.com/zengyishou)** on **2024-08-21**</sup> | In software development, naming variables is a common yet relatively time-consuming task. This assistant can automatically convert Chinese variable names into English variable names that conform to camelCase, PascalCase, snake_case, kebab-case, and constant naming conventions based on specific naming rules. This not only improves code readability but also alleviates the frustration of variable naming.<br/>`software-development` `variable-naming` `chinese-to-english` `code-standards` `automatic-conversion` |
| [Prompt Engineering Expert](https://chat-preview.lobehub.com/market?agent=ai-prompts-assistant)<br/><sup>By **[cyicz123](https://github.com/cyicz123)** on **2024-08-12**</sup> | Specializing in prompt optimization and design<br/>`prompt-engineering` `ai-interaction` `writing` `optimization` `consulting` |
| [Commit Message Generator](https://chat-preview.lobehub.com/market?agent=commit-assistant)<br/><sup>By **[cyicz123](https://github.com/cyicz123)** on **2024-08-12**</sup> | Expert at generating precise Git commit messages<br/>`programming` `git` `commit-message` `code-review` |
| [RO-SCIRAW Prompt Word Expert](https://chat-preview.lobehub.com/market?agent=rosciraw)<br/><sup>By **[kirklin](https://github.com/kirklin)** on **2024-08-06**</sup> | The RO-SCIRAW framework, created by Kirk Lin, is a methodology for prompt words that provides a new paradigm for building highly precise and efficient prompt words. Please enter the information for the persona you want to create.<br/>`prompt-word-framework` |

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

Expand Down
4 changes: 2 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,12 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地

| 最近新增 | 助手说明 |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [TypeScript 解决方案架构师](https://chat-preview.lobehub.com/market?agent=typescript-developer)<br/><sup>By **[swarfte](https://github.com/swarfte)** on **2024-08-24**</sup> | 精通 TypeScript、Node.js、Vue.js 3、Nuxt.js 3、Express.js、React.js 和现代 UI 库。<br/>`类型脚本` `java-script` `网页开发` `编码标准` `最佳实践` |
| [开发变量名转换专家](https://chat-preview.lobehub.com/market?agent=variable-name-conversion)<br/><sup>By **[zengyishou](https://github.com/zengyishou)** on **2024-08-21**</sup> | 在软件开发过程中,命名变量是一项常见却相对耗时的任务。本助手能够根据特定的命名规则自动将中文变量名转换为符合小驼峰、大驼峰、下划线、横线以及常量命名规范的英文变量名。这不仅提高了代码的可读性,还解决了变量命名的苦恼。<br/>`软件开发` `变量命名` `中文转英文` `代码规范` `自动转换` |
| [提示工程专家](https://chat-preview.lobehub.com/market?agent=ai-prompts-assistant)<br/><sup>By **[cyicz123](https://github.com/cyicz123)** on **2024-08-12**</sup> | 专精 Prompt 优化与设计<br/>`提示工程` `ai交互` `写作` `优化` `咨询` |
| [提交信息生成器](https://chat-preview.lobehub.com/market?agent=commit-assistant)<br/><sup>By **[cyicz123](https://github.com/cyicz123)** on **2024-08-12**</sup> | 擅长生成精准的 Git 提交信息<br/>`编程` `git` `提交信息` `代码审查` |
| [RO-SCIRAW 提示词专家](https://chat-preview.lobehub.com/market?agent=rosciraw)<br/><sup>By **[kirklin](https://github.com/kirklin)** on **2024-08-06**</sup> | RO-SCIRAW 框架是由 Kirk Lin 开创的提示词方法论,为构建高度精确和高效的提示词提供了一个全新的范式。请输入你要创建的分身信息。<br/>`提示词框架` |

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

Expand Down
5 changes: 4 additions & 1 deletion docs/self-hosting/advanced/auth.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
title: LobeChat Authentication Service Configuration
description: Learn how to configure external authentication services using Clerk or Next Auth for centralized user authorization management. Supported authentication services include Auth0, Azure ID, etc.
description: >-
Learn how to configure external authentication services using Clerk or Next
Auth for centralized user authorization management. Supported authentication
services include Auth0, Azure ID, etc.
tags:
- Authentication Service
- Next Auth
Expand Down
9 changes: 6 additions & 3 deletions docs/self-hosting/advanced/s3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ In this documentation, S3 refers to a compatible S3 storage solution, which supp

<Callout type={'warning'}>
Additionally, since this access domain is often a separate URL, it needs to be configured to allow cross-origin access to the site. Otherwise, cross-origin issues will occur in the browser.
</Callout>

</Callout>

### `S3_ENABLE_PATH_STYLE`

Expand All @@ -65,13 +66,15 @@ In this documentation, S3 refers to a compatible S3 storage solution, which supp
- path-style: `s3.example.net/mybucket/config.env`
- virtual-host: `mybucket.s3.example.net/config.env`

</Callout>

</Callout>

<Callout type={'tip'}>

Common S3 cloud service providers often default to the `virtual-host` mode, while self-deployed services like Minio default to using `path-style`. Therefore, if you use Minio as the S3 service, you need to set `S3_ENABLE_PATH_STYLE=1`.

</Callout>

</Callout>

</Steps>

Expand Down
2 changes: 0 additions & 2 deletions docs/self-hosting/advanced/s3.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@ S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com

常见的 S3 Cloud 服务商往往默认采用 `virtual-host` 模式,而自部署服务 minio 则默认使用的是 `path-style`。 因此如果你使用了 minio 作为 S3 服务,你需要设置 `S3_ENABLE_PATH_STYLE=1`


</Callout>


</Steps>

## S3 配置指南
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lobehub/chat",
"version": "1.12.11",
"version": "1.12.14",
"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.",
"keywords": [
"framework",
Expand Down
27 changes: 13 additions & 14 deletions src/config/modelProviders/zeroone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ const ZeroOne: ModelProviderCard = {
id: 'yi-large',
tokens: 32_768,
},
{
description:
'在 yi-large 模型的基础上支持并强化了工具调用的能力,适用于各种需要搭建 agent 或 workflow 的业务场景。',
displayName: 'Yi Large FC',
enabled: true,
functionCall: true,
id: 'yi-large-fc',
tokens: 32_768,
},
{
description: '中型尺寸模型升级微调,能力均衡,性价比高。深度优化指令遵循能力。',
displayName: 'Yi Medium',
Expand All @@ -32,6 +23,7 @@ const ZeroOne: ModelProviderCard = {
enabled: true,
id: 'yi-vision',
tokens: 16_384,
vision: true,
},
{
description: '200K 超长上下文窗口,提供长文本深度理解和生成能力。',
Expand All @@ -43,17 +35,26 @@ const ZeroOne: ModelProviderCard = {
{
description: '小而精悍,轻量极速模型。提供强化数学运算和代码编写能力。',
displayName: 'Yi Spark',
enabled: true,
id: 'yi-spark',
tokens: 16_384,
},
{
description:
'基于Yi-Large超强模型的高阶服务,结合检索与生成技术提供精准答案,支持客⼾私有知识库(请联系客服申请)。',
'基于 yi-large 超强模型的高阶服务,结合检索与生成技术提供精准答案,实时全网检索信息服务。',
displayName: 'Yi Large RAG',
enabled: true,
id: 'yi-large-rag',
tokens: 16_384,
},
{
description:
'在 yi-large 模型的基础上支持并强化了工具调用的能力,适用于各种需要搭建 agent 或 workflow 的业务场景。',
displayName: 'Yi Large FC',
enabled: true,
functionCall: true,
id: 'yi-large-fc',
tokens: 32_768,
},
{
description: '超高性价比、卓越性能。根据性能和推理速度、成本,进行平衡性高精度调优。',
displayName: 'Yi Large Turbo',
Expand All @@ -62,15 +63,13 @@ const ZeroOne: ModelProviderCard = {
tokens: 16_384,
},
{
description: '「兼容版本模型」文本推理能力增强。',
description: '初期版本,推荐使用 yi-large(新版本)',
displayName: 'Yi Large Preview',
enabled: true,
id: 'yi-large-preview',
tokens: 16_384,
},
],
checkModel: 'yi-large',
disableBrowserRequest: true,
id: 'zeroone',
name: '01.AI',
};
Expand Down
5 changes: 3 additions & 2 deletions src/database/server/models/__tests__/message.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,10 @@ describe('MessageModel', () => {

// 断言结果
expect(result[0].extra.translate).toEqual({ content: 'translated', from: 'en', to: 'zh' });
// TODO: 确认是否需要包含 tts 字段
expect(result[0].extra.tts).toEqual({
// contentMd5: 'md5', file: 'f1', voice: 'voice1'
contentMd5: 'md5',
file: 'f1',
voice: 'voice1',
});
});

Expand Down
25 changes: 8 additions & 17 deletions src/database/server/models/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,9 @@ export class MessageModel {
},

ttsId: messageTTS.id,

// TODO: 确认下如何处理 TTS 的读取
// ttsContentMd5: messageTTS.contentMd5,
// ttsFile: messageTTS.fileId,
// ttsVoice: messageTTS.voice,
ttsContentMd5: messageTTS.contentMd5,
ttsFile: messageTTS.fileId,
ttsVoice: messageTTS.voice,
/* eslint-enable */
})
.from(messages)
Expand All @@ -113,7 +111,7 @@ export class MessageModel {

const messageIds = result.map((message) => message.id as string);

if (messageIds.length === 0) return result;
if (messageIds.length === 0) return [];

// 2. get relative files
const rawRelatedFileList = await serverDB
Expand Down Expand Up @@ -166,14 +164,7 @@ export class MessageModel {
.where(inArray(messageQueries.messageId, messageIds));

return result.map(
({
model,
provider,
translate,
ttsId,
// ttsFile, ttsId, ttsContentMd5, ttsVoice,
...item
}) => {
({ model, provider, translate, ttsId, ttsFile, ttsContentMd5, ttsVoice, ...item }) => {
const messageQuery = messageQueriesList.find((relation) => relation.messageId === item.id);
return {
...item,
Expand All @@ -185,9 +176,9 @@ export class MessageModel {
translate,
tts: ttsId
? {
// contentMd5: ttsContentMd5,
// file: ttsFile,
// voice: ttsVoice,
contentMd5: ttsContentMd5,
file: ttsFile,
voice: ttsVoice,
}
: undefined,
},
Expand Down
2 changes: 1 addition & 1 deletion src/server/routers/lambda/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export const messageRouter = router({
value: z
.object({
contentMd5: z.string().optional(),
fileId: z.string().optional(),
file: z.string().optional(),
voice: z.string().optional(),
})
.or(z.literal(false)),
Expand Down
Loading

0 comments on commit a92ce26

Please sign in to comment.