@lobehub/chat 1.34.2 → 1.34.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.34.4](https://github.com/lobehub/lobe-chat/compare/v1.34.3...v1.34.4)
6
+
7
+ <sup>Released on **2024-11-27**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Add switch portal thread.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Add switch portal thread, closes [#4819](https://github.com/lobehub/lobe-chat/issues/4819) ([8dbf3ce](https://github.com/lobehub/lobe-chat/commit/8dbf3ce))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
30
+ ### [Version 1.34.3](https://github.com/lobehub/lobe-chat/compare/v1.34.2...v1.34.3)
31
+
32
+ <sup>Released on **2024-11-27**</sup>
33
+
34
+ #### 🐛 Bug Fixes
35
+
36
+ - **misc**: Fix fallback behavior of default mode in AgentRuntime.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### What's fixed
44
+
45
+ - **misc**: Fix fallback behavior of default mode in AgentRuntime, closes [#4813](https://github.com/lobehub/lobe-chat/issues/4813) ([e7cb62e](https://github.com/lobehub/lobe-chat/commit/e7cb62e))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ### [Version 1.34.2](https://github.com/lobehub/lobe-chat/compare/v1.34.1...v1.34.2)
6
56
 
7
57
  <sup>Released on **2024-11-27**</sup>
package/README.md CHANGED
@@ -285,14 +285,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
285
285
 
286
286
  <!-- AGENT LIST -->
287
287
 
288
- | Recent Submits | Description |
289
- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
290
- | [All Translation Assistant (with Phonetic Symbols)](https://chat-preview.lobehub.com/market?agent=translation-assistant)<br/><sup>By **[HttpStatusOK](https://github.com/HttpStatusOK)** on **2024-11-26**</sup> | This is a tool that integrates translation and phonetic symbols, aimed at helping users learn words better during translation.<br/>`translation` `language-learning` |
291
- | [Master E's Tech Executive Assistant (EA)](https://chat-preview.lobehub.com/market?agent=alex)<br/><sup>By **[ApexAppdevelopment](https://github.com/ApexAppdevelopment)** on **2024-11-20**</sup> | Highly intelligent and loyal Executive Assistant (EA) specializing in software engineering support and strategic solutions for Master E.<br/>`executive-assistant` `software-engineering` `project-management` `technical-support` `optimization` |
292
- | [Human Author Simulator](https://chat-preview.lobehub.com/market?agent=human-writer-simulator)<br/><sup>By **[yufei96](https://github.com/yufei96)** on **2024-11-20**</sup> | Eliminate the characteristics of AI-generated content<br/>`ai-interaction` `writing` `optimization` `consultation` |
293
- | [Wisdom Guide](https://chat-preview.lobehub.com/market?agent=life-wisdom-guides)<br/><sup>By **[changjiong](https://github.com/changjiong)** on **2024-11-20**</sup> | Skilled in Guidance<br/>`life-coaching` `philosophical-reflection` `consultation` `heuristic-dialogue` |
294
-
295
- > 📊 Total agents: [<kbd>**440**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
288
+ | Recent Submits | Description |
289
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
290
+ | [Backend Development Assistant](https://chat-preview.lobehub.com/market?agent=backend-assistant)<br/><sup>By **[zeno980](https://github.com/zeno980)** on **2024-11-26**</sup> | Skilled in backend development tasks<br/>`backend-development` `ai-technology` `web-applications` `spring` `sql` |
291
+ | [Bilingual Dictionary Expert](https://chat-preview.lobehub.com/market?agent=english-chinese-dictionary-expert)<br/><sup>By **[swarfte](https://github.com/swarfte)** on **2024-11-26**</sup> | Expert in bilingual English-Chinese vocabulary translation and analysis<br/>`translation` `language-learning` `vocabulary` `dictionary` |
292
+ | [SSC Incremental](https://chat-preview.lobehub.com/market?agent=great-for-analysis-coding-and-rubber-ducking)<br/><sup>By **[Base03](https://github.com/Base03)** on **2024-11-26**</sup> | Claude minus the Reddit<br/>`technology` `analysis` `software` `ai` `research` |
293
+ | [Interviewer's Assistant](https://chat-preview.lobehub.com/market?agent=interviewer-assistant)<br/><sup>By **[xandertang](https://github.com/Dr-T)** on **2024-11-26**</sup> | Proficient in designing and evaluating interview questions for product managers, generating interview questions based on resume interpretation results.<br/>`interview` `resume` `recruitment` `efficiency` |
294
+
295
+ > 📊 Total agents: [<kbd>**446**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
296
296
 
297
297
  <!-- AGENT LIST -->
298
298
 
package/README.zh-CN.md CHANGED
@@ -274,14 +274,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
274
274
 
275
275
  <!-- AGENT LIST -->
276
276
 
277
- | 最近新增 | 助手说明 |
278
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
279
- | [All 译英助手(带音标)](https://chat-preview.lobehub.com/market?agent=translation-assistant)<br/><sup>By **[HttpStatusOK](https://github.com/HttpStatusOK)** on **2024-11-26**</sup> | 这是一款集翻译和音标于一体的工具,旨在帮助翻译时更好地学习单词。<br/>`翻译` `语言学习` |
280
- | [Master E 的技术执行助理(EA)](https://chat-preview.lobehub.com/market?agent=alex)<br/><sup>By **[ApexAppdevelopment](https://github.com/ApexAppdevelopment)** on **2024-11-20**</sup> | 高度智能且忠诚的执行助理(EA),专注于为 Master E 提供软件工程支持和战略解决方案。<br/>`执行助理` `软件工程` `项目管理` `技术支持` `优化` |
281
- | [人类作者模拟器](https://chat-preview.lobehub.com/market?agent=human-writer-simulator)<br/><sup>By **[yufei96](https://github.com/yufei96)** on **2024-11-20**</sup> | 消除 AI 生成内容的特征<br/>`ai交互` `写作` `优化` `咨询` |
282
- | [智慧引导者](https://chat-preview.lobehub.com/market?agent=life-wisdom-guides)<br/><sup>By **[changjiong](https://github.com/changjiong)** on **2024-11-20**</sup> | 擅长引导<br/>`人生指导` `哲学思考` `咨询` `启发式对话` |
283
-
284
- > 📊 Total agents: [<kbd>**440**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
277
+ | 最近新增 | 助手说明 |
278
+ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
279
+ | [后端开发助手](https://chat-preview.lobehub.com/market?agent=backend-assistant)<br/><sup>By **[zeno980](https://github.com/zeno980)** on **2024-11-26**</sup> | 擅长后端开发任务<br/>`后端开发` `ai技术` `web应用` `spring` `sql` |
280
+ | [双语词典专家](https://chat-preview.lobehub.com/market?agent=english-chinese-dictionary-expert)<br/><sup>By **[swarfte](https://github.com/swarfte)** on **2024-11-26**</sup> | 双语英语 - 中文词汇翻译和分析专家<br/>`翻译` `语言学习` `词汇` `词典` |
281
+ | [SSC 增量](https://chat-preview.lobehub.com/market?agent=great-for-analysis-coding-and-rubber-ducking)<br/><sup>By **[Base03](https://github.com/Base03)** on **2024-11-26**</sup> | Claude 减去 Reddit<br/>`技术` `分析` `软件` `人工智能` `研究` |
282
+ | [面试官助手](https://chat-preview.lobehub.com/market?agent=interviewer-assistant)<br/><sup>By **[xandertang](https://github.com/Dr-T)** on **2024-11-26**</sup> | Proficient in designing and evaluating interview questions for product managers, generating interview questions based on resume interpretation results.<br/>`面试` `简历` `招聘` `效率` |
283
+
284
+ > 📊 Total agents: [<kbd>**446**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
285
285
 
286
286
  <!-- AGENT LIST -->
287
287
 
package/changelog/v1.json CHANGED
@@ -1,4 +1,22 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Add switch portal thread."
6
+ ]
7
+ },
8
+ "date": "2024-11-27",
9
+ "version": "1.34.4"
10
+ },
11
+ {
12
+ "children": {
13
+ "fixes": [
14
+ "Fix fallback behavior of default mode in AgentRuntime."
15
+ ]
16
+ },
17
+ "date": "2024-11-27",
18
+ "version": "1.34.3"
19
+ },
2
20
  {
3
21
  "children": {
4
22
  "improvements": [
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "{{title}} نسخة",
33
33
  "emptyAgent": "لا يوجد مساعد",
34
34
  "historyRange": "نطاق التاريخ",
35
+ "historySummary": "ملخص الرسائل التاريخية",
35
36
  "inbox": {
36
37
  "desc": "قم بتشغيل مجموعة الدماغ وأشعل شرارة التفكير. مساعدك الذكي، هنا حيث يمكنك التواصل بكل شيء",
37
38
  "title": "دردشة عشوائية"
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "{{title}} Копие",
33
33
  "emptyAgent": "Няма наличен асистент",
34
34
  "historyRange": "Диапазон на историята",
35
+ "historySummary": "Исторически обобщение на съобщения",
35
36
  "inbox": {
36
37
  "desc": "Активирай мозъчния клъстер и събуди креативното мислене. Твоят виртуален агент е тук, за да общува с теб за всичко.",
37
38
  "title": "Просто чати"
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "{{title}} Kopie",
33
33
  "emptyAgent": "Kein Assistent verfügbar",
34
34
  "historyRange": "Verlaufsbereich",
35
+ "historySummary": "Zusammenfassung historischer Nachrichten",
35
36
  "inbox": {
36
37
  "desc": "Aktiviere das Gehirncluster und entfache den Funken des Denkens. Dein intelligenter Assistent, der mit dir über alles kommuniziert.",
37
38
  "title": "Lass uns plaudern"
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "{{title}} Copy",
33
33
  "emptyAgent": "No assistant available",
34
34
  "historyRange": "History Range",
35
+ "historySummary": "Historical Message Summary",
35
36
  "inbox": {
36
37
  "desc": "Activate the brain cluster and spark creative thinking. Your virtual assistant is here to communicate with you about everything.",
37
38
  "title": "Just Chat"
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "{{title}} Copia",
33
33
  "emptyAgent": "No hay asistente disponible",
34
34
  "historyRange": "Rango de historial",
35
+ "historySummary": "Resumen de mensajes históricos",
35
36
  "inbox": {
36
37
  "desc": "Despierta la mente con el poder del cerebro colectivo. Tu asistente inteligente está aquí para conversar contigo sobre cualquier cosa.",
37
38
  "title": "Charla casual"
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "نسخه‌ای از {{title}}",
33
33
  "emptyAgent": "دستیار موجود نیست",
34
34
  "historyRange": "محدوده تاریخی",
35
+ "historySummary": "خلاصه پیام‌های تاریخی",
35
36
  "inbox": {
36
37
  "desc": "خوشه‌های مغزی را فعال کنید و جرقه‌های تفکر را برانگیزید. دستیار هوشمند شما اینجاست تا با شما در مورد هر چیزی صحبت کند.",
37
38
  "title": "گپ دوستانه"
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "{{title}} Copie",
33
33
  "emptyAgent": "Aucun assistant disponible",
34
34
  "historyRange": "Plage d'historique",
35
+ "historySummary": "Résumé des messages historiques",
35
36
  "inbox": {
36
37
  "desc": "Débloquez le potentiel de votre esprit. Votre agent intelligent est là pour discuter avec vous de tout et de rien.",
37
38
  "title": "Discutons un peu"
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "{{title}} Copia",
33
33
  "emptyAgent": "Nessun assistente disponibile",
34
34
  "historyRange": "Intervallo cronologico",
35
+ "historySummary": "Riepilogo della storia",
35
36
  "inbox": {
36
37
  "desc": "Attiva il cluster cerebrale, accendi la scintilla del pensiero. Il tuo assistente intelligente, qui per comunicare con te su tutto.",
37
38
  "title": "Chiacchierata casuale"
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "{{title}} のコピー",
33
33
  "emptyAgent": "エージェントがいません",
34
34
  "historyRange": "履歴範囲",
35
+ "historySummary": "履歴メッセージの要約",
35
36
  "inbox": {
36
37
  "desc": "脳のクラスターを起動し、創造性を引き出しましょう。あなたのスマートアシスタントは、あなたとすべてのことについてここでコミュニケーションします。",
37
38
  "title": "気軽におしゃべり"
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "{{title}} 복사본",
33
33
  "emptyAgent": "도우미가 없습니다",
34
34
  "historyRange": "대화 기록 범위",
35
+ "historySummary": "역사 메시지 요약",
35
36
  "inbox": {
36
37
  "desc": "뇌 클러스터를 활성화하여 창의적인 아이디어를 끌어내는 인공지능 비서입니다. 여기서 모든 것에 대해 대화합니다.",
37
38
  "title": "무작위 대화"
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "{{title}} Kopie",
33
33
  "emptyAgent": "Geen assistent beschikbaar",
34
34
  "historyRange": "Geschiedenisbereik",
35
+ "historySummary": "Geschiedenis samenvatting",
35
36
  "inbox": {
36
37
  "desc": "Activeer de hersencluster en laat de vonken van gedachten overslaan. Je slimme assistent, hier om met je over alles te praten.",
37
38
  "title": "Praat maar raak"
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "{{title}} kopia",
33
33
  "emptyAgent": "Brak asystenta",
34
34
  "historyRange": "Zakres historii",
35
+ "historySummary": "Podsumowanie wiadomości historycznych",
35
36
  "inbox": {
36
37
  "desc": "Włącz klastry mózgów, rozpal iskrę myślenia. Twój inteligentny asystent, gotowy do rozmowy o wszystkim.",
37
38
  "title": "Pogadajmy sobie"
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "{{title}} Cópia",
33
33
  "emptyAgent": "Sem assistente disponível",
34
34
  "historyRange": "Intervalo de Histórico",
35
+ "historySummary": "Resumo das mensagens históricas",
35
36
  "inbox": {
36
37
  "desc": "Ative o cluster cerebral, inspire faíscas de pensamento. Seu assistente inteligente, aqui para conversar sobre tudo.",
37
38
  "title": "Conversa Aleatória"
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "{{title}} Копия",
33
33
  "emptyAgent": "Нет ассистента",
34
34
  "historyRange": "История сообщений",
35
+ "historySummary": "Сводка исторических сообщений",
35
36
  "inbox": {
36
37
  "desc": "Зажги искру мысли, открой кластер мозгов. Твой виртуальный ассистент, готовый обсудить все с тобой.",
37
38
  "title": "Просто поболтаем"
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "{{title}} Kopya",
33
33
  "emptyAgent": "Asistan yok",
34
34
  "historyRange": "Geçmiş Aralığı",
35
+ "historySummary": "Tarihsel haber özeti",
35
36
  "inbox": {
36
37
  "desc": "Beyin fırtınasını başlatın ve yaratıcı düşünmeye başlayın. Sanal asistanınız burada, her konuda sizinle iletişim kurmak için hazır.",
37
38
  "title": "Sohbet Et"
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "{{title}} Bản sao",
33
33
  "emptyAgent": "Không có trợ lý",
34
34
  "historyRange": "Phạm vi lịch sử",
35
+ "historySummary": "Tóm tắt tin tức lịch sử",
35
36
  "inbox": {
36
37
  "desc": "Kích hoạt cụm não, khơi dậy tia lửa tư duy. Trợ lý thông minh của bạn, ở đây để trò chuyện với bạn về mọi thứ.",
37
38
  "title": "Chuyện phiếm"
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "{{title}} 副本",
33
33
  "emptyAgent": "暂无助手",
34
34
  "historyRange": "历史范围",
35
+ "historySummary": "历史消息总结",
35
36
  "inbox": {
36
37
  "desc": "开启大脑集群,激发思维火花。你的智能助理,在这里与你交流一切",
37
38
  "title": "随便聊聊"
@@ -32,6 +32,7 @@
32
32
  "duplicateTitle": "{{title}} 副本",
33
33
  "emptyAgent": "暫無助手",
34
34
  "historyRange": "歷史範圍",
35
+ "historySummary": "歷史消息總結",
35
36
  "inbox": {
36
37
  "desc": "開啟大腦集群,激發思維火花。你的智能助理,在這裡與你交流一切",
37
38
  "title": "隨便聊聊"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.34.2",
3
+ "version": "1.34.4",
4
4
  "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.",
5
5
  "keywords": [
6
6
  "framework",
@@ -4,6 +4,7 @@ import { Typography } from 'antd';
4
4
  import { createStyles } from 'antd-style';
5
5
  import { ScrollText } from 'lucide-react';
6
6
  import { memo } from 'react';
7
+ import { useTranslation } from 'react-i18next';
7
8
  import { Center, Flexbox } from 'react-layout-kit';
8
9
 
9
10
  import { useChatStore } from '@/store/chat';
@@ -28,6 +29,7 @@ const useStyles = createStyles(({ css, token }) => ({
28
29
 
29
30
  const History = memo(() => {
30
31
  const { styles, theme } = useStyles();
32
+ const { t } = useTranslation('chat');
31
33
  const [content, model] = useChatStore((s) => {
32
34
  const history = topicSelectors.currentActiveTopicSummary(s);
33
35
  return [history?.content, history?.model];
@@ -46,8 +48,7 @@ const History = memo(() => {
46
48
  style={{ color: theme.colorTextDescription }}
47
49
  />
48
50
  </Center>
49
- <Typography.Text type={'secondary'}>历史消息总结</Typography.Text>
50
-
51
+ <Typography.Text type={'secondary'}>{t('historySummary')}</Typography.Text>
51
52
  {model && (
52
53
  <div>
53
54
  <ModelTag model={model} />
@@ -1,20 +1,43 @@
1
1
  import { ActionIcon } from '@lobehub/ui';
2
- import { XIcon } from 'lucide-react';
2
+ import { ArrowLeftRight, XIcon } from 'lucide-react';
3
+ import { memo } from 'react';
4
+ import { Flexbox } from 'react-layout-kit';
3
5
 
4
6
  import SidebarHeader from '@/components/SidebarHeader';
5
7
  import { useChatStore } from '@/store/chat';
6
8
 
7
9
  import Title from './Title';
8
10
 
9
- const Header = () => {
10
- const closeThreadPortal = useChatStore((s) => s.closeThreadPortal);
11
+ const Header = memo(() => {
12
+ const [hasPortal, portalThreadId, closeThreadPortal, switchThread] = useChatStore((s) => [
13
+ !!s.portalThreadId,
14
+ s.portalThreadId,
15
+ s.closeThreadPortal,
16
+ s.switchThread,
17
+ ]);
18
+
11
19
  return (
12
20
  <SidebarHeader
13
- actions={<ActionIcon icon={XIcon} onClick={closeThreadPortal} />}
21
+ actions={
22
+ <Flexbox horizontal>
23
+ {hasPortal && (
24
+ <ActionIcon
25
+ icon={ArrowLeftRight}
26
+ onClick={() => {
27
+ if (!portalThreadId) return;
28
+
29
+ switchThread(portalThreadId);
30
+ closeThreadPortal();
31
+ }}
32
+ />
33
+ )}
34
+ <ActionIcon icon={XIcon} onClick={closeThreadPortal} />
35
+ </Flexbox>
36
+ }
14
37
  style={{ paddingBlock: 8, paddingInline: 8 }}
15
38
  title={<Title />}
16
39
  />
17
40
  );
18
- };
41
+ });
19
42
 
20
43
  export default Header;
@@ -33,6 +33,7 @@ export default {
33
33
  duplicateTitle: '{{title}} 副本',
34
34
  emptyAgent: '暂无助手',
35
35
  historyRange: '历史范围',
36
+ historySummary: '历史消息总结',
36
37
  inbox: {
37
38
  desc: '开启大脑集群,激发思维火花。你的智能助理,在这里与你交流一切',
38
39
  title: '随便聊聊',
@@ -370,6 +370,28 @@ describe('initAgentRuntimeWithUserPayload method', () => {
370
370
  expect(runtime['_runtime']).toBeInstanceOf(LobeWenxinAI);
371
371
  });
372
372
 
373
+ it('OpenAI provider: without apikey with OPENAI_PROXY_URL', async () => {
374
+ process.env.OPENAI_PROXY_URL = 'https://proxy.example.com/v1';
375
+
376
+ const jwtPayload: JWTPayload = {};
377
+ const runtime = await initAgentRuntimeWithUserPayload(ModelProvider.OpenAI, jwtPayload);
378
+ expect(runtime['_runtime']).toBeInstanceOf(LobeOpenAI);
379
+ // 应返回 OPENAI_PROXY_URL
380
+ expect(runtime['_runtime'].baseURL).toBe('https://proxy.example.com/v1');
381
+ });
382
+
383
+ it('Qwen AI provider: without apiKey and endpoint with OPENAI_PROXY_URL', async () => {
384
+ process.env.OPENAI_PROXY_URL = 'https://proxy.example.com/v1';
385
+
386
+ const jwtPayload: JWTPayload = {};
387
+ const runtime = await initAgentRuntimeWithUserPayload(ModelProvider.Qwen, jwtPayload);
388
+
389
+ // 假设 LobeQwenAI 是 Qwen 提供者的实现类
390
+ expect(runtime['_runtime']).toBeInstanceOf(LobeQwenAI);
391
+ // endpoint 不存在,应返回 DEFAULT_BASE_URL
392
+ expect(runtime['_runtime'].baseURL).toBe('https://dashscope.aliyuncs.com/compatible-mode/v1');
393
+ });
394
+
373
395
  it('Unknown Provider', async () => {
374
396
  const jwtPayload = {};
375
397
  const runtime = await initAgentRuntimeWithUserPayload('unknown', jwtPayload);
@@ -33,7 +33,7 @@ const getLlmOptionsFromPayload = (provider: string, payload: JWTPayload) => {
33
33
  default: {
34
34
  let upperProvider = provider.toUpperCase();
35
35
 
36
- if (!llmConfig[`${upperProvider}_API_KEY`]) {
36
+ if (!( `${upperProvider}_API_KEY` in llmConfig)) {
37
37
  upperProvider = ModelProvider.OpenAI.toUpperCase(); // Use OpenAI options as default
38
38
  }
39
39