@lobehub/lobehub 2.0.0-next.310 → 2.0.0-next.311
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 +25 -0
- package/changelog/v1.json +9 -0
- package/docs/development/basic/chat-api.mdx +0 -1
- package/docs/development/basic/chat-api.zh-CN.mdx +0 -1
- package/package.json +1 -1
- 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/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/features/ChatMiniMap/useMinimapData.ts +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/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/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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 2.0.0-next.311](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.310...v2.0.0-next.311)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2026-01-19**</sup>
|
|
8
|
+
|
|
9
|
+
#### ♻ Code Refactoring
|
|
10
|
+
|
|
11
|
+
- **misc**: Refactor market sdk into market servers.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### Code refactoring
|
|
19
|
+
|
|
20
|
+
- **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))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
## [Version 2.0.0-next.310](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.309...v2.0.0-next.310)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2026-01-19**</sup>
|
package/changelog/v1.json
CHANGED
|
@@ -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/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.311",
|
|
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",
|
|
@@ -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
|
};
|