@lobehub/lobehub 2.0.0-next.310 → 2.0.0-next.312
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/.github/PULL_REQUEST_TEMPLATE.md +1 -1
- package/CHANGELOG.md +58 -0
- package/changelog/v1.json +21 -0
- package/docs/development/basic/chat-api.mdx +0 -1
- package/docs/development/basic/chat-api.zh-CN.mdx +0 -1
- package/e2e/README.md +1 -1
- package/e2e/src/features/community/detail-pages.feature +2 -2
- package/e2e/src/features/community/interactions.feature +5 -5
- package/e2e/src/features/community/smoke.feature +1 -1
- package/e2e/src/steps/community/detail-pages.steps.ts +6 -4
- package/e2e/src/steps/community/interactions.steps.ts +3 -3
- package/package.json +1 -1
- package/packages/builtin-tool-agent-builder/src/systemRole.ts +9 -0
- package/packages/model-runtime/src/core/BaseAI.ts +0 -2
- package/packages/model-runtime/src/core/ModelRuntime.test.ts +0 -37
- package/packages/model-runtime/src/core/ModelRuntime.ts +0 -5
- package/packages/model-runtime/src/core/RouterRuntime/baseRuntimeMap.ts +4 -0
- package/packages/model-runtime/src/core/RouterRuntime/createRuntime.test.ts +325 -200
- package/packages/model-runtime/src/core/RouterRuntime/createRuntime.ts +205 -64
- package/packages/model-runtime/src/core/openaiCompatibleFactory/index.ts +0 -14
- package/packages/model-runtime/src/providers/aihubmix/index.test.ts +14 -20
- package/packages/model-runtime/src/types/index.ts +0 -1
- package/packages/model-runtime/src/utils/createError.test.ts +0 -20
- package/packages/model-runtime/src/utils/createError.ts +0 -1
- package/public/favicon-32x-32-error.ico +0 -0
- package/public/favicon-32x32-done-dev.ico +0 -0
- package/public/favicon-32x32-done.ico +0 -0
- package/public/favicon-32x32-error-dev.ico +0 -0
- package/public/favicon-32x32-progress-dev.ico +0 -0
- package/public/favicon-32x32-progress.ico +0 -0
- package/public/favicon-done-dev.ico +0 -0
- package/public/favicon-done.ico +0 -0
- package/public/favicon-error-dev.ico +0 -0
- package/public/favicon-error.ico +0 -0
- package/public/favicon-progress-dev.ico +0 -0
- package/public/favicon-progress.ico +0 -0
- package/src/app/(backend)/market/agent/[[...segments]]/route.ts +3 -33
- package/src/app/(backend)/market/oidc/[[...segments]]/route.ts +5 -6
- package/src/app/(backend)/market/social/[[...segments]]/route.ts +5 -52
- package/src/app/(backend)/market/user/[username]/route.ts +3 -9
- package/src/app/(backend)/market/user/me/route.ts +3 -34
- package/src/app/[variants]/(main)/agent/profile/features/Header/AgentPublishButton/PublishResultModal.tsx +1 -1
- package/src/app/[variants]/(main)/community/(detail)/_layout/Header.tsx +15 -3
- package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Details/Overview/TagList.tsx +1 -1
- package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Details/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Details/SystemRole/TagList.tsx +1 -1
- package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Details/SystemRole/index.tsx +1 -1
- package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Header.tsx +2 -2
- package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Sidebar/ActionButton/AddAgent.tsx +1 -1
- package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Sidebar/ActionButton/index.tsx +1 -1
- package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Sidebar/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/StatusPage/index.tsx +2 -2
- package/src/app/[variants]/(main)/community/(detail)/user/features/UserAgentCard.tsx +2 -2
- package/src/app/[variants]/(main)/community/(detail)/user/features/UserFavoriteAgents.tsx +1 -1
- package/src/app/[variants]/(main)/community/(list)/(home)/index.tsx +2 -2
- package/src/app/[variants]/(main)/community/(list)/(home)/loading.tsx +1 -1
- package/src/app/[variants]/(main)/community/(list)/{assistant → agent}/Client.tsx +5 -1
- package/src/app/[variants]/(main)/community/(list)/{assistant → agent}/features/Category/index.tsx +1 -1
- package/src/app/[variants]/(main)/community/(list)/{assistant → agent}/features/List/Item.tsx +1 -1
- package/src/app/[variants]/(main)/community/(list)/{assistant → agent}/features/MarketSourceSwitch.tsx +1 -1
- package/src/app/[variants]/(main)/community/_layout/Sidebar/Header/Nav.tsx +2 -2
- package/src/app/[variants]/(main)/home/features/CommunityAgents/List.tsx +1 -1
- package/src/app/[variants]/(main)/home/features/CommunityAgents/index.tsx +1 -1
- package/src/app/[variants]/(mobile)/_layout/index.tsx +1 -1
- package/src/app/[variants]/(mobile)/router/mobileRouter.config.tsx +6 -6
- package/src/app/[variants]/router/desktopRouter.config.tsx +8 -8
- package/src/app/[variants]/share/t/[id]/_layout/index.tsx +1 -1
- package/src/features/ChatMiniMap/useMinimapData.ts +1 -1
- package/src/features/CommandMenu/SearchResults.tsx +1 -1
- package/src/features/Conversation/ChatList/components/VirtualizedList.tsx +20 -2
- package/src/features/Conversation/store/slices/virtuaList/action.ts +9 -0
- package/src/features/Electron/navigation/routeMetadata.ts +1 -1
- package/src/layout/GlobalProvider/FaviconProvider.tsx +92 -0
- package/src/layout/GlobalProvider/index.tsx +15 -11
- package/src/libs/next/config/define-config.ts +1 -1
- package/src/libs/trpc/lambda/middleware/marketSDK.ts +14 -23
- package/src/libs/trusted-client/index.ts +1 -1
- package/src/server/routers/lambda/market/index.ts +5 -0
- package/src/server/routers/lambda/market/oidc.ts +41 -61
- package/src/server/routers/tools/market.ts +12 -44
- package/src/server/services/agentRuntime/AgentRuntimeService.test.ts +7 -0
- package/src/server/services/agentRuntime/AgentRuntimeService.ts +1 -1
- package/src/server/services/aiAgent/__tests__/execAgent.threadId.test.ts +7 -0
- package/src/server/services/aiAgent/__tests__/execGroupSubAgentTask.test.ts +7 -0
- package/src/server/services/aiAgent/index.ts +9 -96
- package/src/server/services/discover/index.ts +11 -16
- package/src/server/services/market/index.ts +485 -0
- package/src/server/services/toolExecution/builtin.ts +11 -17
- package/src/server/services/toolExecution/index.ts +6 -2
- package/src/server/sitemap.test.ts +5 -5
- package/src/server/sitemap.ts +3 -3
- package/src/services/codeInterpreter.ts +0 -13
- package/packages/model-runtime/src/types/textToImage.ts +0 -36
- package/src/server/services/lobehubSkill/index.ts +0 -109
- /package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/DetailProvider.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Details/Capabilities/Block.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Details/Capabilities/Knowledge.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Details/Capabilities/KnowledgeItem.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Details/Capabilities/PluginItem.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Details/Capabilities/Plugins.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Details/Capabilities/index.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Details/Nav.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Details/Overview/index.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Details/Versions/index.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Details/index.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Sidebar/Related/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Sidebar/Summary/index.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Sidebar/TocList/index.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/features/Sidebar/index.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/index.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(detail)/{assistant → agent}/loading.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(list)/{assistant → agent}/_layout/index.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(list)/{assistant → agent}/_layout/style.ts +0 -0
- /package/src/app/[variants]/(main)/community/(list)/{assistant → agent}/features/Category/useCategory.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(list)/{assistant → agent}/features/List/TokenTag.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(list)/{assistant → agent}/features/List/index.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(list)/{assistant → agent}/index.tsx +0 -0
- /package/src/app/[variants]/(main)/community/(list)/{assistant → agent}/loading.tsx +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,64 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 2.0.0-next.312](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.311...v2.0.0-next.312)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2026-01-19**</sup>
|
|
8
|
+
|
|
9
|
+
#### ♻ Code Refactoring
|
|
10
|
+
|
|
11
|
+
- **misc**: Change the /community/assistant to /agent routes.
|
|
12
|
+
|
|
13
|
+
#### ✨ Features
|
|
14
|
+
|
|
15
|
+
- **misc**: Improve the agentbuilder systemRole.
|
|
16
|
+
|
|
17
|
+
<br/>
|
|
18
|
+
|
|
19
|
+
<details>
|
|
20
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
21
|
+
|
|
22
|
+
#### Code refactoring
|
|
23
|
+
|
|
24
|
+
- **misc**: Change the /community/assistant to /agent routes, closes [#11606](https://github.com/lobehub/lobe-chat/issues/11606) ([7f004c5](https://github.com/lobehub/lobe-chat/commit/7f004c5))
|
|
25
|
+
|
|
26
|
+
#### What's improved
|
|
27
|
+
|
|
28
|
+
- **misc**: Improve the agentbuilder systemRole, closes [#11608](https://github.com/lobehub/lobe-chat/issues/11608) ([2f032d4](https://github.com/lobehub/lobe-chat/commit/2f032d4))
|
|
29
|
+
|
|
30
|
+
</details>
|
|
31
|
+
|
|
32
|
+
<div align="right">
|
|
33
|
+
|
|
34
|
+
[](#readme-top)
|
|
35
|
+
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
## [Version 2.0.0-next.311](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.310...v2.0.0-next.311)
|
|
39
|
+
|
|
40
|
+
<sup>Released on **2026-01-19**</sup>
|
|
41
|
+
|
|
42
|
+
#### ♻ Code Refactoring
|
|
43
|
+
|
|
44
|
+
- **misc**: Refactor market sdk into market servers.
|
|
45
|
+
|
|
46
|
+
<br/>
|
|
47
|
+
|
|
48
|
+
<details>
|
|
49
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
50
|
+
|
|
51
|
+
#### Code refactoring
|
|
52
|
+
|
|
53
|
+
- **misc**: Refactor market sdk into market servers, closes [#11604](https://github.com/lobehub/lobe-chat/issues/11604) ([858cc20](https://github.com/lobehub/lobe-chat/commit/858cc20))
|
|
54
|
+
|
|
55
|
+
</details>
|
|
56
|
+
|
|
57
|
+
<div align="right">
|
|
58
|
+
|
|
59
|
+
[](#readme-top)
|
|
60
|
+
|
|
61
|
+
</div>
|
|
62
|
+
|
|
5
63
|
## [Version 2.0.0-next.310](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.309...v2.0.0-next.310)
|
|
6
64
|
|
|
7
65
|
<sup>Released on **2026-01-19**</sup>
|
package/changelog/v1.json
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"children": {
|
|
4
|
+
"improvements": [
|
|
5
|
+
"Change the /community/assistant to /agent routes."
|
|
6
|
+
],
|
|
7
|
+
"features": [
|
|
8
|
+
"Improve the agentbuilder systemRole."
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"date": "2026-01-19",
|
|
12
|
+
"version": "2.0.0-next.312"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"children": {
|
|
16
|
+
"improvements": [
|
|
17
|
+
"Refactor market sdk into market servers."
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"date": "2026-01-19",
|
|
21
|
+
"version": "2.0.0-next.311"
|
|
22
|
+
},
|
|
2
23
|
{
|
|
3
24
|
"children": {
|
|
4
25
|
"improvements": [
|
|
@@ -223,7 +223,6 @@ AgentRuntime is a core abstraction layer in Lobe Chat that encapsulates a unifie
|
|
|
223
223
|
chat(payload: ChatStreamPayload, options?: ChatCompetitionOptions): Promise<Response>;
|
|
224
224
|
embeddings?(payload: EmbeddingsPayload, options?: EmbeddingsOptions): Promise<Embeddings[]>;
|
|
225
225
|
models?(): Promise<any>;
|
|
226
|
-
textToImage?: (payload: TextToImagePayload) => Promise<string[]>;
|
|
227
226
|
textToSpeech?: (
|
|
228
227
|
payload: TextToSpeechPayload,
|
|
229
228
|
options?: TextToSpeechOptions,
|
|
@@ -223,7 +223,6 @@ AgentRuntime 是 Lobe Chat 中的一个核心抽象层,它封装了与不同 A
|
|
|
223
223
|
chat(payload: ChatStreamPayload, options?: ChatCompetitionOptions): Promise<Response>;
|
|
224
224
|
embeddings?(payload: EmbeddingsPayload, options?: EmbeddingsOptions): Promise<Embeddings[]>;
|
|
225
225
|
models?(): Promise<any>;
|
|
226
|
-
textToImage?: (payload: TextToImagePayload) => Promise<string[]>;
|
|
227
226
|
textToSpeech?: (
|
|
228
227
|
payload: TextToSpeechPayload,
|
|
229
228
|
options?: TextToSpeechOptions,
|
package/e2e/README.md
CHANGED
|
@@ -90,7 +90,7 @@ Feature: Community Smoke Tests
|
|
|
90
90
|
|
|
91
91
|
@COMMUNITY-SMOKE-001 @P0
|
|
92
92
|
Scenario: Load community assistant list page
|
|
93
|
-
Given I navigate to "/community/
|
|
93
|
+
Given I navigate to "/community/agent"
|
|
94
94
|
Then the page should load without errors
|
|
95
95
|
And I should see the page body
|
|
96
96
|
And I should see the search bar
|
|
@@ -11,7 +11,7 @@ Feature: Discover Detail Pages
|
|
|
11
11
|
|
|
12
12
|
@COMMUNITY-DETAIL-001 @P1
|
|
13
13
|
Scenario: Load assistant detail page and verify content
|
|
14
|
-
Given I navigate to "/community/
|
|
14
|
+
Given I navigate to "/community/agent"
|
|
15
15
|
And I wait for the page to fully load
|
|
16
16
|
When I click on the first assistant card
|
|
17
17
|
Then I should be on an assistant detail page
|
|
@@ -22,7 +22,7 @@ Feature: Discover Detail Pages
|
|
|
22
22
|
|
|
23
23
|
@COMMUNITY-DETAIL-002 @P1
|
|
24
24
|
Scenario: Navigate back from assistant detail page
|
|
25
|
-
Given I navigate to "/community/
|
|
25
|
+
Given I navigate to "/community/agent"
|
|
26
26
|
And I wait for the page to fully load
|
|
27
27
|
And I click on the first assistant card
|
|
28
28
|
When I click the back button
|
|
@@ -11,14 +11,14 @@ Feature: Discover Interactions
|
|
|
11
11
|
|
|
12
12
|
@COMMUNITY-INTERACT-001 @P1
|
|
13
13
|
Scenario: Search for assistants
|
|
14
|
-
Given I navigate to "/community/
|
|
14
|
+
Given I navigate to "/community/agent"
|
|
15
15
|
When I type "developer" in the search bar
|
|
16
16
|
And I wait for the search results to load
|
|
17
17
|
Then I should see filtered assistant cards
|
|
18
18
|
|
|
19
19
|
@COMMUNITY-INTERACT-002 @P1
|
|
20
20
|
Scenario: Filter assistants by category
|
|
21
|
-
Given I navigate to "/community/
|
|
21
|
+
Given I navigate to "/community/agent"
|
|
22
22
|
When I click on a category in the category menu
|
|
23
23
|
And I wait for the filtered results to load
|
|
24
24
|
Then I should see assistant cards filtered by the selected category
|
|
@@ -26,7 +26,7 @@ Feature: Discover Interactions
|
|
|
26
26
|
|
|
27
27
|
@COMMUNITY-INTERACT-003 @P1
|
|
28
28
|
Scenario: Navigate to next page of assistants
|
|
29
|
-
Given I navigate to "/community/
|
|
29
|
+
Given I navigate to "/community/agent"
|
|
30
30
|
When I click the next page button
|
|
31
31
|
And I wait for the next page to load
|
|
32
32
|
Then I should see different assistant cards
|
|
@@ -34,7 +34,7 @@ Feature: Discover Interactions
|
|
|
34
34
|
|
|
35
35
|
@COMMUNITY-INTERACT-004 @P1
|
|
36
36
|
Scenario: Navigate to assistant detail page
|
|
37
|
-
Given I navigate to "/community/
|
|
37
|
+
Given I navigate to "/community/agent"
|
|
38
38
|
When I click on the first assistant card
|
|
39
39
|
Then I should be navigated to the assistant detail page
|
|
40
40
|
And I should see the assistant detail content
|
|
@@ -95,7 +95,7 @@ Feature: Discover Interactions
|
|
|
95
95
|
Scenario: Navigate from home to assistant list
|
|
96
96
|
Given I navigate to "/community"
|
|
97
97
|
When I click on the "more" link in the featured assistants section
|
|
98
|
-
Then I should be navigated to "/community/
|
|
98
|
+
Then I should be navigated to "/community/agent"
|
|
99
99
|
And I should see the page body
|
|
100
100
|
|
|
101
101
|
@COMMUNITY-INTERACT-011 @P1
|
|
@@ -12,7 +12,7 @@ Feature: Community Smoke Tests
|
|
|
12
12
|
|
|
13
13
|
@COMMUNITY-SMOKE-002 @P0
|
|
14
14
|
Scenario: Load Assistant List Page
|
|
15
|
-
Given I navigate to "/community/
|
|
15
|
+
Given I navigate to "/community/agent"
|
|
16
16
|
Then the page should load without errors
|
|
17
17
|
And I should see the page body
|
|
18
18
|
And I should see the search bar
|
|
@@ -8,7 +8,7 @@ import { CustomWorld } from '../../support/world';
|
|
|
8
8
|
// ============================================
|
|
9
9
|
|
|
10
10
|
Given('I wait for the page to fully load', async function (this: CustomWorld) {
|
|
11
|
-
|
|
11
|
+
// Use domcontentloaded instead of networkidle to avoid hanging on persistent connections
|
|
12
12
|
await this.page.waitForLoadState('domcontentloaded', { timeout: 10_000 });
|
|
13
13
|
// Short wait for React hydration
|
|
14
14
|
await this.page.waitForTimeout(1000);
|
|
@@ -135,9 +135,9 @@ Then('I should be on the assistant list page', async function (this: CustomWorld
|
|
|
135
135
|
|
|
136
136
|
const currentUrl = this.page.url();
|
|
137
137
|
// Check if URL is assistant list (not detail page) or community home
|
|
138
|
-
// After back navigation, URL should be /community/
|
|
138
|
+
// After back navigation, URL should be /community/agent or /community
|
|
139
139
|
const isListPage =
|
|
140
|
-
(currentUrl.includes('/community/
|
|
140
|
+
(currentUrl.includes('/community/agent') &&
|
|
141
141
|
!/\/community\/assistant\/[\dA-Za-z-]+$/.test(currentUrl)) ||
|
|
142
142
|
currentUrl.endsWith('/community') ||
|
|
143
143
|
currentUrl.includes('/community#');
|
|
@@ -176,7 +176,9 @@ Then('I should see the model description', async function (this: CustomWorld) {
|
|
|
176
176
|
|
|
177
177
|
// Model detail page shows description below the title, it might be a placeholder like "model.description"
|
|
178
178
|
// or actual content. Just verify the page structure is correct.
|
|
179
|
-
const descriptionArea = this.page
|
|
179
|
+
const descriptionArea = this.page
|
|
180
|
+
.locator('main, article, [class*="detail"], [class*="content"]')
|
|
181
|
+
.first();
|
|
180
182
|
const isVisible = await descriptionArea.isVisible().catch(() => false);
|
|
181
183
|
|
|
182
184
|
// Pass if any content area is visible - the description might be a placeholder
|
|
@@ -376,11 +376,11 @@ Then('the URL should contain the category parameter', async function (this: Cust
|
|
|
376
376
|
console.log(` 📍 Selected category: ${this.testContext.selectedCategory}`);
|
|
377
377
|
|
|
378
378
|
// Check if URL contains a category-related parameter
|
|
379
|
-
// The URL format is: /community/
|
|
379
|
+
// The URL format is: /community/agent?category=xxx
|
|
380
380
|
const hasCategory =
|
|
381
381
|
currentUrl.includes('category=') ||
|
|
382
382
|
currentUrl.includes('tag=') ||
|
|
383
|
-
// For path-based routing like /community/
|
|
383
|
+
// For path-based routing like /community/agent/category-name
|
|
384
384
|
/\/community\/assistant\/[^/?]+/.test(currentUrl);
|
|
385
385
|
|
|
386
386
|
expect(
|
|
@@ -418,7 +418,7 @@ Then('the URL should contain the page parameter', async function (this: CustomWo
|
|
|
418
418
|
if (this.testContext.usedInfiniteScroll) {
|
|
419
419
|
console.log(' 📍 Used infinite scroll, page parameter not expected');
|
|
420
420
|
// Just verify we're still on the assistant page
|
|
421
|
-
expect(currentUrl.includes('/community/
|
|
421
|
+
expect(currentUrl.includes('/community/agent')).toBeTruthy();
|
|
422
422
|
return;
|
|
423
423
|
}
|
|
424
424
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/lobehub",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.312",
|
|
4
4
|
"description": "LobeHub - an open-source,comprehensive AI Agent 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",
|
|
@@ -86,6 +86,7 @@ Always adapt to user's language. Use natural descriptions, not raw field names.
|
|
|
86
86
|
5. **Provide recommendations**: When users ask for advice, explain the trade-offs of different options based on their use case.
|
|
87
87
|
6. **Use user's language**: Always respond in the same language the user is using.
|
|
88
88
|
7. **Keep it simple**: Focus on core settings. Don't overwhelm users with advanced options unless they ask.
|
|
89
|
+
8. **Install plugins one by one**: When multiple plugins need to be installed, install them sequentially one at a time instead of batching. This ensures better error handling, allows users to understand each plugin's purpose, and makes it easier to troubleshoot if something goes wrong.
|
|
89
90
|
</guidelines>
|
|
90
91
|
|
|
91
92
|
<configuration_knowledge>
|
|
@@ -202,6 +203,14 @@ Action: Use updateConfig with { config: { params: { temperature: 0.7 } } }
|
|
|
202
203
|
|
|
203
204
|
User: "我想调整对话配置" / "I want to configure chat settings"
|
|
204
205
|
Action: Explain the available chatConfig options and help them configure as needed.
|
|
206
|
+
|
|
207
|
+
User: "帮我安装网页浏览和图片生成这两个插件" / "Install web browsing and image generation plugins for me"
|
|
208
|
+
Action: Install plugins one by one:
|
|
209
|
+
1. First, use installPlugin to install "lobe-web-browsing", explain what it does
|
|
210
|
+
2. Wait for confirmation of success
|
|
211
|
+
3. Then, use installPlugin to install "lobe-image-generation", explain what it does
|
|
212
|
+
4. Confirm both plugins are installed successfully
|
|
213
|
+
This sequential approach ensures each plugin is properly installed and allows the user to understand each tool's purpose.
|
|
205
214
|
</examples>
|
|
206
215
|
|
|
207
216
|
<response_format>
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
GenerateObjectPayload,
|
|
14
14
|
ModelRequestOptions,
|
|
15
15
|
PullModelParams,
|
|
16
|
-
TextToImagePayload,
|
|
17
16
|
TextToSpeechOptions,
|
|
18
17
|
TextToSpeechPayload,
|
|
19
18
|
} from '../types';
|
|
@@ -28,7 +27,6 @@ export interface LobeRuntimeAI {
|
|
|
28
27
|
|
|
29
28
|
models?(): Promise<any>;
|
|
30
29
|
|
|
31
|
-
textToImage?: (payload: TextToImagePayload) => Promise<string[]>;
|
|
32
30
|
createImage?: (payload: CreateImagePayload) => Promise<CreateImageResponse>;
|
|
33
31
|
|
|
34
32
|
textToSpeech?: (
|
|
@@ -226,43 +226,6 @@ describe('ModelRuntime', () => {
|
|
|
226
226
|
});
|
|
227
227
|
});
|
|
228
228
|
|
|
229
|
-
describe('ModelRuntime textToImage method', () => {
|
|
230
|
-
it('should run correctly', async () => {
|
|
231
|
-
const payload = {
|
|
232
|
-
model: 'stable-diffusion',
|
|
233
|
-
prompt: 'A beautiful landscape',
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
const mockResponse = ['https://example.com/image1.jpg', 'https://example.com/image2.jpg'];
|
|
237
|
-
|
|
238
|
-
vi.spyOn(LobeOpenAI.prototype, 'textToImage').mockResolvedValue(mockResponse);
|
|
239
|
-
|
|
240
|
-
const result = await mockModelRuntime.textToImage(payload);
|
|
241
|
-
|
|
242
|
-
expect(LobeOpenAI.prototype.textToImage).toHaveBeenCalledWith(payload);
|
|
243
|
-
expect(result).toBe(mockResponse);
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
it('should handle undefined textToImage method gracefully', async () => {
|
|
247
|
-
const payload = {
|
|
248
|
-
model: 'stable-diffusion',
|
|
249
|
-
prompt: 'A beautiful landscape',
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
// Mock runtime without textToImage method
|
|
253
|
-
const runtimeWithoutTextToImage = {
|
|
254
|
-
textToImage: undefined,
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
// @ts-ignore - testing edge case
|
|
258
|
-
mockModelRuntime['_runtime'] = runtimeWithoutTextToImage;
|
|
259
|
-
|
|
260
|
-
const result = await mockModelRuntime.textToImage(payload);
|
|
261
|
-
|
|
262
|
-
expect(result).toBeUndefined();
|
|
263
|
-
});
|
|
264
|
-
});
|
|
265
|
-
|
|
266
229
|
describe('ModelRuntime createImage method', () => {
|
|
267
230
|
it('should run correctly', async () => {
|
|
268
231
|
const payload: CreateImagePayload = {
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
GenerateObjectPayload,
|
|
14
14
|
ModelRequestOptions,
|
|
15
15
|
PullModelParams,
|
|
16
|
-
TextToImagePayload,
|
|
17
16
|
TextToSpeechPayload,
|
|
18
17
|
} from '../types';
|
|
19
18
|
import { AgentRuntimeErrorType } from '../types/error';
|
|
@@ -79,10 +78,6 @@ export class ModelRuntime {
|
|
|
79
78
|
return this._runtime.generateObject!(payload);
|
|
80
79
|
}
|
|
81
80
|
|
|
82
|
-
async textToImage(payload: TextToImagePayload) {
|
|
83
|
-
return this._runtime.textToImage?.(payload);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
81
|
async createImage(payload: CreateImagePayload) {
|
|
87
82
|
return this._runtime.createImage?.(payload);
|
|
88
83
|
}
|
|
@@ -6,8 +6,10 @@ import { LobeDeepSeekAI } from '../../providers/deepseek';
|
|
|
6
6
|
import { LobeFalAI } from '../../providers/fal';
|
|
7
7
|
import { LobeGoogleAI } from '../../providers/google';
|
|
8
8
|
import { LobeMinimaxAI } from '../../providers/minimax';
|
|
9
|
+
import { LobeMoonshotAI } from '../../providers/moonshot';
|
|
9
10
|
import { LobeOpenAI } from '../../providers/openai';
|
|
10
11
|
import { LobeQwenAI } from '../../providers/qwen';
|
|
12
|
+
import { LobeVertexAI } from '../../providers/vertexai';
|
|
11
13
|
import { LobeXAI } from '../../providers/xai';
|
|
12
14
|
|
|
13
15
|
export const baseRuntimeMap = {
|
|
@@ -19,7 +21,9 @@ export const baseRuntimeMap = {
|
|
|
19
21
|
fal: LobeFalAI,
|
|
20
22
|
google: LobeGoogleAI,
|
|
21
23
|
minimax: LobeMinimaxAI,
|
|
24
|
+
moonshot: LobeMoonshotAI,
|
|
22
25
|
openai: LobeOpenAI,
|
|
23
26
|
qwen: LobeQwenAI,
|
|
27
|
+
vertexai: LobeVertexAI,
|
|
24
28
|
xai: LobeXAI,
|
|
25
29
|
};
|