Skip to content

Commit 14a1f01

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 1839afa + 4168e5a commit 14a1f01

24 files changed

+70
-5
lines changed

.github/ISSUE_TEMPLATE/1_bug_report_cn.yml

+8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@ name: '🐛 反馈缺陷'
22
description: '反馈一个问题缺陷'
33
title: '[Bug] '
44
labels: ['🐛 Bug']
5+
type: Bug
56
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
在创建新的 Issue 之前,请先[搜索已有问题](https://github.com/lobehub/lobe-chat/issues),如果发现已有类似的问题,请给它 **👍 点赞**,这样可以帮助我们更快地解决问题。
11+
如果你在使用过程中遇到问题,可以尝试以下方式获取帮助:
12+
- 在 [GitHub Discussions](https://github.com/lobehub/lobe-chat/discussions) 的版块发起讨论。
13+
- 在 [LobeChat 社区](https://discord.gg/AYFPHvv2jT) 提问,与其他用户交流。
614
- type: dropdown
715
attributes:
816
label: '📦 部署环境'

.github/ISSUE_TEMPLATE/config.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
contact_links:
2-
- name: Questions and ideas | 问题和想法
2+
- name: Ask a question for self-hosting | 咨询自部署问题
3+
url: https://github.com/lobehub/lobe-chat/discussions/new?category=self-hosting-%E7%A7%81%E6%9C%89%E5%8C%96%E9%83%A8%E7%BD%B2
4+
about: Please post questions, and ideas in discussions. | 请在讨论区发布问题和想法。
5+
- name: Questions and ideas | 其他问题和想法
36
url: https://github.com/lobehub/lobe-chat/discussions/new/choose
47
about: Please post questions, and ideas in discussions. | 请在讨论区发布问题和想法。

changelog/v1.json

+14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
[
2+
{
3+
"children": {
4+
"fixes": ["Fix message roles for specific Azure OpenAI models."]
5+
},
6+
"date": "2025-02-20",
7+
"version": "1.62.2"
8+
},
9+
{
10+
"children": {
11+
"fixes": ["Add sambanova proxy url."]
12+
},
13+
"date": "2025-02-20",
14+
"version": "1.62.1"
15+
},
216
{
317
"children": {
418
"features": ["Support pplx search grounding."],

locales/ar/components.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "يدعم هذا النموذج قراءة وتعرف الملفات المرفوعة",
7878
"functionCall": "يدعم هذا النموذج استدعاء الوظائف",
7979
"reasoning": "يدعم هذا النموذج التفكير العميق",
80+
"search": "يدعم هذا النموذج البحث عبر الإنترنت",
8081
"tokens": "يدعم هذا النموذج حتى {{tokens}} رمزًا في جلسة واحدة",
8182
"vision": "يدعم هذا النموذج التعرف البصري"
8283
},

locales/bg-BG/components.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "Този модел поддържа качване на файлове и разпознаване",
7878
"functionCall": "Този модел поддържа функционални обаждания (Function Call)",
7979
"reasoning": "Този модел поддържа дълбочинно мислене",
80+
"search": "Този модел поддържа търсене в мрежата",
8081
"tokens": "Този модел поддържа до {{tokens}} токена за една сесия",
8182
"vision": "Този модел поддържа визуално разпознаване"
8283
},

locales/de-DE/components.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "Dieses Modell unterstützt das Hochladen von Dateien und deren Erkennung.",
7878
"functionCall": "Dieses Modell unterstützt Funktionsaufrufe.",
7979
"reasoning": "Dieses Modell unterstützt tiefes Denken",
80+
"search": "Dieses Modell unterstützt die Online-Suche",
8081
"tokens": "Dieses Modell unterstützt maximal {{tokens}} Tokens pro Sitzung.",
8182
"vision": "Dieses Modell unterstützt die visuelle Erkennung."
8283
},

locales/en-US/components.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "This model supports file upload for reading and recognition.",
7878
"functionCall": "This model supports function call.",
7979
"reasoning": "This model supports deep thinking",
80+
"search": "This model supports online search",
8081
"tokens": "This model supports up to {{tokens}} tokens in a single session.",
8182
"vision": "This model supports visual recognition."
8283
},

locales/es-ES/components.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "Este modelo admite la carga y reconocimiento de archivos.",
7878
"functionCall": "Este modelo admite llamadas de función.",
7979
"reasoning": "Este modelo admite un pensamiento profundo",
80+
"search": "Este modelo admite búsqueda en línea",
8081
"tokens": "Este modelo admite un máximo de {{tokens}} tokens por sesión.",
8182
"vision": "Este modelo admite el reconocimiento visual."
8283
},

locales/fa-IR/components.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "این مدل از بارگذاری و شناسایی فایل‌ها پشتیبانی می‌کند",
7878
"functionCall": "این مدل از فراخوانی توابع (Function Call) پشتیبانی می‌کند",
7979
"reasoning": "این مدل از تفکر عمیق پشتیبانی می‌کند",
80+
"search": "این مدل از جستجوی آنلاین پشتیبانی می‌کند",
8081
"tokens": "این مدل در هر جلسه حداکثر از {{tokens}} توکن پشتیبانی می‌کند",
8182
"vision": "این مدل از تشخیص بصری پشتیبانی می‌کند"
8283
},

locales/fr-FR/components.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "Ce modèle prend en charge la lecture et la reconnaissance de fichiers téléchargés.",
7878
"functionCall": "Ce modèle prend en charge les appels de fonction.",
7979
"reasoning": "Ce modèle prend en charge une réflexion approfondie",
80+
"search": "Ce modèle prend en charge la recherche en ligne",
8081
"tokens": "Ce modèle prend en charge jusqu'à {{tokens}} jetons par session.",
8182
"vision": "Ce modèle prend en charge la reconnaissance visuelle."
8283
},

locales/it-IT/components.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "Questo modello supporta il caricamento e il riconoscimento di file.",
7878
"functionCall": "Questo modello supporta la chiamata di funzioni.",
7979
"reasoning": "Questo modello supporta un pensiero profondo",
80+
"search": "Questo modello supporta la ricerca online",
8081
"tokens": "Questo modello supporta un massimo di {{tokens}} token per sessione.",
8182
"vision": "Questo modello supporta il riconoscimento visivo."
8283
},

locales/ja-JP/components.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "このモデルはファイルのアップロードと認識をサポートしています。",
7878
"functionCall": "このモデルは関数呼び出し(Function Call)をサポートしています。",
7979
"reasoning": "このモデルは深い思考をサポートしています",
80+
"search": "このモデルはオンライン検索をサポートしています",
8081
"tokens": "このモデルは1つのセッションあたり最大{{tokens}}トークンをサポートしています。",
8182
"vision": "このモデルはビジョン認識をサポートしています。"
8283
},

locales/ko-KR/components.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "이 모델은 파일 업로드 및 인식을 지원합니다",
7878
"functionCall": "이 모델은 함수 호출을 지원합니다",
7979
"reasoning": "이 모델은 깊이 있는 사고를 지원합니다.",
80+
"search": "이 모델은 온라인 검색을 지원합니다.",
8081
"tokens": "이 모델은 단일 세션당 최대 {{tokens}} 토큰을 지원합니다",
8182
"vision": "이 모델은 시각 인식을 지원합니다"
8283
},

locales/nl-NL/components.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "This model supports file upload for reading and recognition.",
7878
"functionCall": "This model supports function call.",
7979
"reasoning": "Dit model ondersteunt diepgaand denken",
80+
"search": "Dit model ondersteunt online zoeken",
8081
"tokens": "This model supports up to {{tokens}} tokens in a single session.",
8182
"vision": "This model supports visual recognition."
8283
},

locales/pl-PL/components.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "Ten model obsługuje wczytywanie plików i rozpoznawanie",
7878
"functionCall": "Ten model obsługuje wywołania funkcji (Function Call).",
7979
"reasoning": "Ten model wspiera głębokie myślenie",
80+
"search": "Ten model wspiera wyszukiwanie w sieci",
8081
"tokens": "Ten model obsługuje maksymalnie {{tokens}} tokenów w pojedynczej sesji.",
8182
"vision": "Ten model obsługuje rozpoznawanie wizualne."
8283
},

locales/pt-BR/components.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "Este modelo suporta leitura e reconhecimento de arquivos enviados.",
7878
"functionCall": "Este modelo suporta chamadas de função.",
7979
"reasoning": "Este modelo suporta pensamento profundo",
80+
"search": "Este modelo suporta pesquisa online",
8081
"tokens": "Este modelo suporta no máximo {{tokens}} tokens por sessão.",
8182
"vision": "Este modelo suporta reconhecimento visual."
8283
},

locales/ru-RU/components.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "Эта модель поддерживает загрузку и распознавание файлов",
7878
"functionCall": "Эта модель поддерживает вызов функций",
7979
"reasoning": "Эта модель поддерживает глубокое мышление",
80+
"search": "Эта модель поддерживает поиск в интернете",
8081
"tokens": "Эта модель поддерживает до {{tokens}} токенов в одной сессии",
8182
"vision": "Эта модель поддерживает распознавание изображений"
8283
},

locales/tr-TR/components.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "Bu model dosya yükleme ve tanımayı destekler",
7878
"functionCall": "Bu model fonksiyon çağrısını destekler",
7979
"reasoning": "Bu model derin düşünmeyi destekler",
80+
"search": "Bu model çevrimiçi aramayı destekler",
8081
"tokens": "Bu model tek bir oturumda en fazla {{tokens}} Token destekler",
8182
"vision": "Bu model görüntü tanımıyı destekler"
8283
},

locales/vi-VN/components.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "Mô hình này hỗ trợ tải lên và nhận diện tệp",
7878
"functionCall": "Mô hình này hỗ trợ cuộc gọi hàm (Function Call)",
7979
"reasoning": "Mô hình này hỗ trợ tư duy sâu sắc",
80+
"search": "Mô hình này hỗ trợ tìm kiếm trực tuyến",
8081
"tokens": "Mỗi phiên của mô hình này hỗ trợ tối đa {{tokens}} Tokens",
8182
"vision": "Mô hình này hỗ trợ nhận diện hình ảnh"
8283
},

locales/zh-CN/components.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "该模型支持上传文件读取与识别",
7878
"functionCall": "该模型支持函数调用(Function Call)",
7979
"reasoning": "该模型支持深度思考",
80+
"search": "该模型支持联网搜索",
8081
"tokens": "该模型单个会话最多支持 {{tokens}} Tokens",
8182
"vision": "该模型支持视觉识别"
8283
},
@@ -115,4 +116,4 @@
115116
"thought": "已深度思考(用时 {{duration}} 秒)",
116117
"thoughtWithDuration": "已深度思考"
117118
}
118-
}
119+
}

locales/zh-TW/components.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"file": "該模型支援上傳檔案讀取與辨識",
7878
"functionCall": "該模型支援函式呼叫(Function Call)",
7979
"reasoning": "該模型支持深度思考",
80+
"search": "該模型支援聯網搜尋",
8081
"tokens": "該模型單一會話最多支援 {{tokens}} Tokens",
8182
"vision": "該模型支援視覺辨識"
8283
},

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
"drizzle-orm": "^0.39.0",
160160
"drizzle-zod": "^0.5.1",
161161
"fast-deep-equal": "^3.1.3",
162-
"file-type": "^19.6.0",
162+
"file-type": "^20.0.0",
163163
"framer-motion": "^11.16.0",
164164
"gpt-tokenizer": "^2.8.1",
165165
"i18next": "^24.2.1",

src/config/modelProviders/sambanova.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ const SambaNova: ModelProviderCard = {
1010
name: 'SambaNova',
1111
settings: {
1212
disableBrowserRequest: true,
13+
proxyUrl: {
14+
placeholder: 'https://api.sambanova.ai/v1',
15+
},
1316
sdkType: 'openai',
1417
},
1518
url: 'https://cloud.sambanova.ai',
1619
};
1720

18-
export default SambaNova;
21+
export default SambaNova;

src/libs/agent-runtime/azureOpenai/index.ts

+20-1
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,28 @@ export class LobeAzureOpenAI implements LobeRuntimeAI {
3333
const { messages, model, ...params } = payload;
3434
// o1 series models on Azure OpenAI does not support streaming currently
3535
const enableStreaming = model.includes('o1') ? false : (params.stream ?? true);
36+
37+
// Convert 'system' role to 'user' or 'developer' based on the model
38+
const systemToUserModels = new Set([
39+
'o1-preview',
40+
'o1-preview-2024-09-12',
41+
'o1-mini',
42+
'o1-mini-2024-09-12',
43+
]);
44+
45+
const updatedMessages = messages.map((message) => ({
46+
...message,
47+
role:
48+
(model.includes('o1') || model.includes('o3')) && message.role === 'system'
49+
? [...systemToUserModels].some((sub) => model.includes(sub))
50+
? 'user'
51+
: 'developer'
52+
: message.role,
53+
}));
54+
3655
try {
3756
const response = await this.client.chat.completions.create({
38-
messages: messages as OpenAI.ChatCompletionMessageParam[],
57+
messages: updatedMessages as OpenAI.ChatCompletionMessageParam[],
3958
model,
4059
...params,
4160
max_completion_tokens: null,

0 commit comments

Comments
 (0)