Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from lobehub:main #124

Merged
merged 5 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

# Changelog

### [Version 1.36.32](https://github.com/lobehub/lobe-chat/compare/v1.36.31...v1.36.32)

<sup>Released on **2024-12-17**</sup>

#### ♻ Code Refactoring

- **misc**: Refactor the drizzle code style.

<br/>

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

#### Code refactoring

- **misc**: Refactor the drizzle code style, closes [#5058](https://github.com/lobehub/lobe-chat/issues/5058) ([4057ad3](https://github.com/lobehub/lobe-chat/commit/4057ad3))

</details>

<div align="right">

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

</div>

### [Version 1.36.31](https://github.com/lobehub/lobe-chat/compare/v1.36.30...v1.36.31)

<sup>Released on **2024-12-17**</sup>
Expand Down
7 changes: 7 additions & 0 deletions changelog/v1.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
[
{
"children": {
"improvements": ["Refactor the drizzle code style."]
},
"date": "2024-12-17",
"version": "1.36.32"
},
{
"children": {
"improvements": ["Refactor the data fetch with clientDB init check."]
Expand Down
34 changes: 18 additions & 16 deletions docs/self-hosting/environment-variables/model-provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Related discussions:
### `OPENAI_MODEL_LIST`

- Type: Optional
- 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
- 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]
- Default: `-`
- Example: `+qwen-7b-chat,+glm-6b,-gpt-3.5-turbo,gpt-4-0125-preview=gpt-4-turbo`

Expand Down Expand Up @@ -94,7 +94,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
### `AZURE_MODEL_LIST`

- Type: Optional
- Description: Used to control the model list, use `+` to add a model, use `-` to hide a model, use `id->deplymentName=displayName` to customize the display name of a model, separated by commas. Definition syntax rules see
- Description: Used to control the model list, use `+` to add a model, use `-` to hide a model, use `id->deplymentName=displayName` to customize the display name of a model, separated by commas. Definition syntax rules see [model-list][model-list]
- Default: `-`
- Example: `gpt-35-turbo->my-deploy=GPT 3.5 Turbo` 或 `gpt-4-turbo->my-gpt4=GPT 4 Turbo<128000:vision:fc>`

Expand All @@ -117,7 +117,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
### `GOOGLE_MODEL_LIST`

- Type: Optional
- 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
- 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]
- Default: `-`
- Example: `-all,+gemini-1.5-flash-latest,+gemini-1.5-pro-latest`

Expand Down Expand Up @@ -188,7 +188,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
### `OPENROUTER_MODEL_LIST`

- Type: Optional
- Description: Used to specify a custom OpenRouter model list. Model definition syntax rules see
- Description: Used to specify a custom OpenRouter model list. Model definition syntax rules see [model-list][model-list]
- Default: `-`
- Example: `-all,+01-ai/yi-34b-chat,+huggingfaceh4/zephyr-7b-beta`

Expand All @@ -204,7 +204,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
### `GITHUB_MODEL_LIST`

- Type: Optional
- 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
- 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]
- Default: `-`
- Example: `-all,+gpt-4o,+gpt-4o-mini`

Expand All @@ -220,7 +220,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
### `TOGETHERAI_MODEL_LIST`

- Type: Optional
- Description: Used to specify a custom TogetherAI model list. Model definition syntax rules see
- Description: Used to specify a custom TogetherAI model list. Model definition syntax rules see [model-list][model-list]
- Default: `-`
- Example: `-all,+meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo,+meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo`

Expand All @@ -236,7 +236,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
### `FIREWORKSAI_MODEL_LIST`

- Type: Optional
- 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
- 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]
- Default: `-`
- Example: `-all,+accounts/fireworks/models/firefunction-v2,+accounts/fireworks/models/firefunction-v1`

Expand All @@ -259,7 +259,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
### `OLLAMA_MODEL_LIST`

- Type: Optional
- Description: Used to specify a custom Ollama language model. Model definition syntax rules see
- Description: Used to specify a custom Ollama language model. Model definition syntax rules see [model-list][model-list]
- Default: -
- Example: `llama2:7B`

Expand Down Expand Up @@ -332,7 +332,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
### `GROQ_MODEL_LIST`

- Type: Optional
- 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
- 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]
- Default: `-`
- Example: `-all,+gemma2-9b-it,+llama-3.1-8b-instant`

Expand All @@ -348,7 +348,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
### `ZHIPU_MODEL_LIST`

- Type: Optional
- 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
- 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]
- Default: `-`
- Example: `-all,+glm-4-alltools,+glm-4-plus`

Expand All @@ -364,7 +364,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
### `ZEROONE_MODEL_LIST`

- Type: Optional
- 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
- 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]
- Default: `-`
- Example: `-all,+yi-large,+yi-large-rag`

Expand All @@ -380,7 +380,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
### `QWEN_MODEL_LIST`

- Type: Optional
- 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
- 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]
- Default: `-`
- Example: `-all,+qwen-turbo-latest,+qwen-plus-latest`

Expand All @@ -405,7 +405,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
### `NOVITA_MODEL_LIST`

- Type: Optional
- 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
- 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]
- Default: `-`
- Example: `-all,+meta-llama/llama-3.1-8b-instruct,+meta-llama/llama-3.1-70b-instruct`

Expand Down Expand Up @@ -455,7 +455,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
### `SILICONCLOUD_MODEL_LIST`

- Type: Optional
- 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
- 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]
- Default: `-`
- Example: `-all,+deepseek-ai/DeepSeek-V2.5,+Qwen/Qwen2.5-7B-Instruct`

Expand Down Expand Up @@ -498,6 +498,8 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
### `HUNYUAN_MODEL_LIST`

- Type: Optional
- 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
- 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]
- Default: `-`
- Example: `-all,+hunyuan-lite,+hunyuan-standard`
- Example: `-all,+hunyuan-lite,+hunyuan-standard`

[model-list]: /docs/self-hosting/advanced/model-list
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,13 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
- 默认值:-
- 示例:`pplx-xxxxxx...xxxxxx`

### `PERPLEXITY_MODEL_LIST`

- 类型:可选
- 描述:用于指定自定义 Perplexity 语言模型。模型定义语法规则见 [模型列表][model-list]
- 默认值:-
- 示例: `-all,+llama-3.1-sonar-small-128k-online,+llama-3.1-sonar-small-128k-chat`

### `PERPLEXITY_PROXY_URL`

- 类型:可选
Expand Down
24 changes: 12 additions & 12 deletions docs/self-hosting/server-database/dokploy.zh-CN.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
title: 在 Dokploy 上部署 LobeChat 的服务端数据库版本
description: 本文详细介绍如何在 Dokploy 中部署服务端数据库版 LobeChat,包括数据库配置、身份验证服务配置的设置步骤。
tags:
- 服务端数据库
- Postgres
- Clerk
- Dokploy部署
- 数据库配置
- 身份验证服务
- 环境变量配置
---
---
title: 在 Dokploy 上部署 LobeChat 的服务端数据库版本
description: 本文详细介绍如何在 Dokploy 中部署服务端数据库版 LobeChat,包括数据库配置、身份验证服务配置的设置步骤。
tags:
- 服务端数据库
- Postgres
- Clerk
- Dokploy部署
- 数据库配置
- 身份验证服务
- 环境变量配置
---

# 在 Dokploy 上部署服务端数据库版
本文将详细介绍如何在 Dokploy 中部署服务端数据库版 LobeChat。
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.36.31",
"version": "1.36.32",
"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
29 changes: 11 additions & 18 deletions src/database/repositories/dataImporter/__tests__/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// @vitest-environment node
import { eq, inArray } from 'drizzle-orm';
import { eq, inArray } from 'drizzle-orm/expressions';
import { beforeEach, describe, expect, it, vi } from 'vitest';

import { getTestDBInstance } from '@/database/server/core/dbForTest';
import {
agents,
agentsToSessions,
Expand All @@ -12,6 +11,7 @@ import {
topics,
users,
} from '@/database/schemas';
import { getTestDBInstance } from '@/database/server/core/dbForTest';
import { CURRENT_CONFIG_VERSION } from '@/migrations';
import { ImporterEntryData } from '@/types/importer';

Expand Down Expand Up @@ -60,8 +60,7 @@ describe('DataImporter', () => {
it('should skip existing session groups and return correct result', async () => {
await serverDB
.insert(sessionGroups)
.values({ clientId: 'group1', name: 'Existing Group', userId })
.execute();
.values({ clientId: 'group1', name: 'Existing Group', userId });

const data: ImporterEntryData = {
version: CURRENT_CONFIG_VERSION,
Expand Down Expand Up @@ -141,7 +140,7 @@ describe('DataImporter', () => {
});

it('should skip existing sessions and return correct result', async () => {
await serverDB.insert(sessions).values({ clientId: 'session1', userId }).execute();
await serverDB.insert(sessions).values({ clientId: 'session1', userId });

const data: ImporterEntryData = {
version: CURRENT_CONFIG_VERSION,
Expand Down Expand Up @@ -477,10 +476,7 @@ describe('DataImporter', () => {
});

it('should skip existing topics and return correct result', async () => {
await serverDB
.insert(topics)
.values({ clientId: 'topic1', title: 'Existing Topic', userId })
.execute();
await serverDB.insert(topics).values({ clientId: 'topic1', title: 'Existing Topic', userId });

const data: ImporterEntryData = {
version: CURRENT_CONFIG_VERSION,
Expand Down Expand Up @@ -616,15 +612,12 @@ describe('DataImporter', () => {
});

it('should skip existing messages and return correct result', async () => {
await serverDB
.insert(messages)
.values({
clientId: 'msg1',
content: 'Existing Message',
role: 'user',
userId,
})
.execute();
await serverDB.insert(messages).values({
clientId: 'msg1',
content: 'Existing Message',
role: 'user',
userId,
});

const data: ImporterEntryData = {
version: CURRENT_CONFIG_VERSION,
Expand Down
Loading
Loading