@lobehub/lobehub 2.0.0-next.101 → 2.0.0-next.102
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 +25 -0
- package/changelog/v1.json +9 -0
- package/package.json +1 -1
- package/packages/model-bank/package.json +1 -0
- package/packages/model-bank/src/aiModels/aihubmix.ts +27 -0
- package/packages/model-bank/src/aiModels/google.ts +69 -10
- package/packages/model-bank/src/aiModels/index.ts +3 -0
- package/packages/model-bank/src/aiModels/infiniai.ts +5 -22
- package/packages/model-bank/src/aiModels/ollamacloud.ts +12 -0
- package/packages/model-bank/src/aiModels/siliconcloud.ts +0 -61
- package/packages/model-bank/src/aiModels/vertexai.ts +88 -1
- package/packages/model-bank/src/aiModels/zenmux.ts +1423 -0
- package/packages/model-bank/src/const/modelProvider.ts +1 -0
- package/packages/model-bank/src/standard-parameters/index.ts +9 -0
- package/packages/model-runtime/src/core/openaiCompatibleFactory/index.test.ts +2 -2
- package/packages/model-runtime/src/core/streams/google/index.ts +7 -2
- package/packages/model-runtime/src/core/streams/openai/__snapshots__/responsesStream.test.ts.snap +166 -166
- package/packages/model-runtime/src/index.ts +1 -1
- package/packages/model-runtime/src/providers/google/createImage.ts +1 -0
- package/packages/model-runtime/src/providers/google/index.ts +11 -1
- package/packages/model-runtime/src/providers/zenmux/index.test.ts +320 -0
- package/packages/model-runtime/src/providers/zenmux/index.ts +84 -0
- package/packages/model-runtime/src/runtimeMap.ts +2 -0
- package/packages/types/src/user/settings/keyVaults.ts +1 -0
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ResolutionSelect.tsx +88 -0
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/index.tsx +9 -0
- package/src/config/modelProviders/index.ts +3 -0
- package/src/config/modelProviders/zenmux.ts +21 -0
- package/src/envs/llm.ts +6 -0
- package/src/locales/default/image.ts +8 -0
- package/src/store/chat/slices/aiChat/actions/__tests__/conversationLifecycle.test.ts +3 -0
- package/src/store/chat/slices/aiChat/actions/streamingExecutor.ts +11 -0
|
@@ -2,6 +2,7 @@ import { act, renderHook } from '@testing-library/react';
|
|
|
2
2
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
3
3
|
|
|
4
4
|
import { aiChatService } from '@/services/aiChat';
|
|
5
|
+
import { getSessionStoreState } from '@/store/session';
|
|
5
6
|
|
|
6
7
|
import { useChatStore } from '../../../../store';
|
|
7
8
|
import { TEST_CONTENT, TEST_IDS, createMockMessage } from './fixtures';
|
|
@@ -30,6 +31,8 @@ beforeEach(() => {
|
|
|
30
31
|
resetTestEnvironment();
|
|
31
32
|
setupMockSelectors();
|
|
32
33
|
spyOnMessageService();
|
|
34
|
+
const sessionStore = getSessionStoreState();
|
|
35
|
+
vi.spyOn(sessionStore, 'triggerSessionUpdate').mockResolvedValue(undefined);
|
|
33
36
|
|
|
34
37
|
act(() => {
|
|
35
38
|
useChatStore.setState({
|
|
@@ -530,6 +530,17 @@ export const streamingExecutor: StateCreator<
|
|
|
530
530
|
get().completeOperation(reasoningOperationId);
|
|
531
531
|
reasoningOperationId = undefined;
|
|
532
532
|
}
|
|
533
|
+
break;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
case 'stop': {
|
|
537
|
+
// Complete reasoning operation when receiving stop signal
|
|
538
|
+
if (!duration && reasoningOperationId) {
|
|
539
|
+
duration = Date.now() - thinkingStartAt;
|
|
540
|
+
get().completeOperation(reasoningOperationId);
|
|
541
|
+
reasoningOperationId = undefined;
|
|
542
|
+
}
|
|
543
|
+
break;
|
|
533
544
|
}
|
|
534
545
|
}
|
|
535
546
|
},
|