File tree 24 files changed +70
-5
lines changed
libs/agent-runtime/azureOpenai
24 files changed +70
-5
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,15 @@ name: '🐛 反馈缺陷'
2
2
description : ' 反馈一个问题缺陷'
3
3
title : ' [Bug] '
4
4
labels : ['🐛 Bug']
5
+ type : Bug
5
6
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) 提问,与其他用户交流。
6
14
- type : dropdown
7
15
attributes :
8
16
label : ' 📦 部署环境'
Original file line number Diff line number Diff line change 1
1
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 | 其他问题和想法
3
6
url : https://github.com/lobehub/lobe-chat/discussions/new/choose
4
7
about : Please post questions, and ideas in discussions. | 请在讨论区发布问题和想法。
Original file line number Diff line number Diff line change 1
1
[
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
+ },
2
16
{
3
17
"children" : {
4
18
"features" : [" Support pplx search grounding." ],
Original file line number Diff line number Diff line change 77
77
"file" : " يدعم هذا النموذج قراءة وتعرف الملفات المرفوعة" ,
78
78
"functionCall" : " يدعم هذا النموذج استدعاء الوظائف" ,
79
79
"reasoning" : " يدعم هذا النموذج التفكير العميق" ,
80
+ "search" : " يدعم هذا النموذج البحث عبر الإنترنت" ,
80
81
"tokens" : " يدعم هذا النموذج حتى {{tokens}} رمزًا في جلسة واحدة" ,
81
82
"vision" : " يدعم هذا النموذج التعرف البصري"
82
83
},
Original file line number Diff line number Diff line change 77
77
"file" : " Този модел поддържа качване на файлове и разпознаване" ,
78
78
"functionCall" : " Този модел поддържа функционални обаждания (Function Call)" ,
79
79
"reasoning" : " Този модел поддържа дълбочинно мислене" ,
80
+ "search" : " Този модел поддържа търсене в мрежата" ,
80
81
"tokens" : " Този модел поддържа до {{tokens}} токена за една сесия" ,
81
82
"vision" : " Този модел поддържа визуално разпознаване"
82
83
},
Original file line number Diff line number Diff line change 77
77
"file" : " Dieses Modell unterstützt das Hochladen von Dateien und deren Erkennung." ,
78
78
"functionCall" : " Dieses Modell unterstützt Funktionsaufrufe." ,
79
79
"reasoning" : " Dieses Modell unterstützt tiefes Denken" ,
80
+ "search" : " Dieses Modell unterstützt die Online-Suche" ,
80
81
"tokens" : " Dieses Modell unterstützt maximal {{tokens}} Tokens pro Sitzung." ,
81
82
"vision" : " Dieses Modell unterstützt die visuelle Erkennung."
82
83
},
Original file line number Diff line number Diff line change 77
77
"file" : " This model supports file upload for reading and recognition." ,
78
78
"functionCall" : " This model supports function call." ,
79
79
"reasoning" : " This model supports deep thinking" ,
80
+ "search" : " This model supports online search" ,
80
81
"tokens" : " This model supports up to {{tokens}} tokens in a single session." ,
81
82
"vision" : " This model supports visual recognition."
82
83
},
Original file line number Diff line number Diff line change 77
77
"file" : " Este modelo admite la carga y reconocimiento de archivos." ,
78
78
"functionCall" : " Este modelo admite llamadas de función." ,
79
79
"reasoning" : " Este modelo admite un pensamiento profundo" ,
80
+ "search" : " Este modelo admite búsqueda en línea" ,
80
81
"tokens" : " Este modelo admite un máximo de {{tokens}} tokens por sesión." ,
81
82
"vision" : " Este modelo admite el reconocimiento visual."
82
83
},
Original file line number Diff line number Diff line change 77
77
"file" : " این مدل از بارگذاری و شناسایی فایلها پشتیبانی میکند" ,
78
78
"functionCall" : " این مدل از فراخوانی توابع (Function Call) پشتیبانی میکند" ,
79
79
"reasoning" : " این مدل از تفکر عمیق پشتیبانی میکند" ,
80
+ "search" : " این مدل از جستجوی آنلاین پشتیبانی میکند" ,
80
81
"tokens" : " این مدل در هر جلسه حداکثر از {{tokens}} توکن پشتیبانی میکند" ,
81
82
"vision" : " این مدل از تشخیص بصری پشتیبانی میکند"
82
83
},
Original file line number Diff line number Diff line change 77
77
"file" : " Ce modèle prend en charge la lecture et la reconnaissance de fichiers téléchargés." ,
78
78
"functionCall" : " Ce modèle prend en charge les appels de fonction." ,
79
79
"reasoning" : " Ce modèle prend en charge une réflexion approfondie" ,
80
+ "search" : " Ce modèle prend en charge la recherche en ligne" ,
80
81
"tokens" : " Ce modèle prend en charge jusqu'à {{tokens}} jetons par session." ,
81
82
"vision" : " Ce modèle prend en charge la reconnaissance visuelle."
82
83
},
Original file line number Diff line number Diff line change 77
77
"file" : " Questo modello supporta il caricamento e il riconoscimento di file." ,
78
78
"functionCall" : " Questo modello supporta la chiamata di funzioni." ,
79
79
"reasoning" : " Questo modello supporta un pensiero profondo" ,
80
+ "search" : " Questo modello supporta la ricerca online" ,
80
81
"tokens" : " Questo modello supporta un massimo di {{tokens}} token per sessione." ,
81
82
"vision" : " Questo modello supporta il riconoscimento visivo."
82
83
},
Original file line number Diff line number Diff line change 77
77
"file" : " このモデルはファイルのアップロードと認識をサポートしています。" ,
78
78
"functionCall" : " このモデルは関数呼び出し(Function Call)をサポートしています。" ,
79
79
"reasoning" : " このモデルは深い思考をサポートしています" ,
80
+ "search" : " このモデルはオンライン検索をサポートしています" ,
80
81
"tokens" : " このモデルは1つのセッションあたり最大{{tokens}}トークンをサポートしています。" ,
81
82
"vision" : " このモデルはビジョン認識をサポートしています。"
82
83
},
Original file line number Diff line number Diff line change 77
77
"file" : " 이 모델은 파일 업로드 및 인식을 지원합니다" ,
78
78
"functionCall" : " 이 모델은 함수 호출을 지원합니다" ,
79
79
"reasoning" : " 이 모델은 깊이 있는 사고를 지원합니다." ,
80
+ "search" : " 이 모델은 온라인 검색을 지원합니다." ,
80
81
"tokens" : " 이 모델은 단일 세션당 최대 {{tokens}} 토큰을 지원합니다" ,
81
82
"vision" : " 이 모델은 시각 인식을 지원합니다"
82
83
},
Original file line number Diff line number Diff line change 77
77
"file" : " This model supports file upload for reading and recognition." ,
78
78
"functionCall" : " This model supports function call." ,
79
79
"reasoning" : " Dit model ondersteunt diepgaand denken" ,
80
+ "search" : " Dit model ondersteunt online zoeken" ,
80
81
"tokens" : " This model supports up to {{tokens}} tokens in a single session." ,
81
82
"vision" : " This model supports visual recognition."
82
83
},
Original file line number Diff line number Diff line change 77
77
"file" : " Ten model obsługuje wczytywanie plików i rozpoznawanie" ,
78
78
"functionCall" : " Ten model obsługuje wywołania funkcji (Function Call)." ,
79
79
"reasoning" : " Ten model wspiera głębokie myślenie" ,
80
+ "search" : " Ten model wspiera wyszukiwanie w sieci" ,
80
81
"tokens" : " Ten model obsługuje maksymalnie {{tokens}} tokenów w pojedynczej sesji." ,
81
82
"vision" : " Ten model obsługuje rozpoznawanie wizualne."
82
83
},
Original file line number Diff line number Diff line change 77
77
"file" : " Este modelo suporta leitura e reconhecimento de arquivos enviados." ,
78
78
"functionCall" : " Este modelo suporta chamadas de função." ,
79
79
"reasoning" : " Este modelo suporta pensamento profundo" ,
80
+ "search" : " Este modelo suporta pesquisa online" ,
80
81
"tokens" : " Este modelo suporta no máximo {{tokens}} tokens por sessão." ,
81
82
"vision" : " Este modelo suporta reconhecimento visual."
82
83
},
Original file line number Diff line number Diff line change 77
77
"file" : " Эта модель поддерживает загрузку и распознавание файлов" ,
78
78
"functionCall" : " Эта модель поддерживает вызов функций" ,
79
79
"reasoning" : " Эта модель поддерживает глубокое мышление" ,
80
+ "search" : " Эта модель поддерживает поиск в интернете" ,
80
81
"tokens" : " Эта модель поддерживает до {{tokens}} токенов в одной сессии" ,
81
82
"vision" : " Эта модель поддерживает распознавание изображений"
82
83
},
Original file line number Diff line number Diff line change 77
77
"file" : " Bu model dosya yükleme ve tanımayı destekler" ,
78
78
"functionCall" : " Bu model fonksiyon çağrısını destekler" ,
79
79
"reasoning" : " Bu model derin düşünmeyi destekler" ,
80
+ "search" : " Bu model çevrimiçi aramayı destekler" ,
80
81
"tokens" : " Bu model tek bir oturumda en fazla {{tokens}} Token destekler" ,
81
82
"vision" : " Bu model görüntü tanımıyı destekler"
82
83
},
Original file line number Diff line number Diff line change 77
77
"file" : " Mô hình này hỗ trợ tải lên và nhận diện tệp" ,
78
78
"functionCall" : " Mô hình này hỗ trợ cuộc gọi hàm (Function Call)" ,
79
79
"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" ,
80
81
"tokens" : " Mỗi phiên của mô hình này hỗ trợ tối đa {{tokens}} Tokens" ,
81
82
"vision" : " Mô hình này hỗ trợ nhận diện hình ảnh"
82
83
},
Original file line number Diff line number Diff line change 77
77
"file" : " 该模型支持上传文件读取与识别" ,
78
78
"functionCall" : " 该模型支持函数调用(Function Call)" ,
79
79
"reasoning" : " 该模型支持深度思考" ,
80
+ "search" : " 该模型支持联网搜索" ,
80
81
"tokens" : " 该模型单个会话最多支持 {{tokens}} Tokens" ,
81
82
"vision" : " 该模型支持视觉识别"
82
83
},
115
116
"thought" : " 已深度思考(用时 {{duration}} 秒)" ,
116
117
"thoughtWithDuration" : " 已深度思考"
117
118
}
118
- }
119
+ }
Original file line number Diff line number Diff line change 77
77
"file" : " 該模型支援上傳檔案讀取與辨識" ,
78
78
"functionCall" : " 該模型支援函式呼叫(Function Call)" ,
79
79
"reasoning" : " 該模型支持深度思考" ,
80
+ "search" : " 該模型支援聯網搜尋" ,
80
81
"tokens" : " 該模型單一會話最多支援 {{tokens}} Tokens" ,
81
82
"vision" : " 該模型支援視覺辨識"
82
83
},
Original file line number Diff line number Diff line change 159
159
"drizzle-orm" : " ^0.39.0" ,
160
160
"drizzle-zod" : " ^0.5.1" ,
161
161
"fast-deep-equal" : " ^3.1.3" ,
162
- "file-type" : " ^19.6 .0" ,
162
+ "file-type" : " ^20.0 .0" ,
163
163
"framer-motion" : " ^11.16.0" ,
164
164
"gpt-tokenizer" : " ^2.8.1" ,
165
165
"i18next" : " ^24.2.1" ,
Original file line number Diff line number Diff line change @@ -10,9 +10,12 @@ const SambaNova: ModelProviderCard = {
10
10
name : 'SambaNova' ,
11
11
settings : {
12
12
disableBrowserRequest : true ,
13
+ proxyUrl : {
14
+ placeholder : 'https://api.sambanova.ai/v1' ,
15
+ } ,
13
16
sdkType : 'openai' ,
14
17
} ,
15
18
url : 'https://cloud.sambanova.ai' ,
16
19
} ;
17
20
18
- export default SambaNova ;
21
+ export default SambaNova ;
Original file line number Diff line number Diff line change @@ -33,9 +33,28 @@ export class LobeAzureOpenAI implements LobeRuntimeAI {
33
33
const { messages, model, ...params } = payload ;
34
34
// o1 series models on Azure OpenAI does not support streaming currently
35
35
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
+
36
55
try {
37
56
const response = await this . client . chat . completions . create ( {
38
- messages : messages as OpenAI . ChatCompletionMessageParam [ ] ,
57
+ messages : updatedMessages as OpenAI . ChatCompletionMessageParam [ ] ,
39
58
model,
40
59
...params ,
41
60
max_completion_tokens : null ,
You can’t perform that action at this time.
0 commit comments