@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.
Files changed (32) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/changelog/v1.json +9 -0
  3. package/package.json +1 -1
  4. package/packages/model-bank/package.json +1 -0
  5. package/packages/model-bank/src/aiModels/aihubmix.ts +27 -0
  6. package/packages/model-bank/src/aiModels/google.ts +69 -10
  7. package/packages/model-bank/src/aiModels/index.ts +3 -0
  8. package/packages/model-bank/src/aiModels/infiniai.ts +5 -22
  9. package/packages/model-bank/src/aiModels/ollamacloud.ts +12 -0
  10. package/packages/model-bank/src/aiModels/siliconcloud.ts +0 -61
  11. package/packages/model-bank/src/aiModels/vertexai.ts +88 -1
  12. package/packages/model-bank/src/aiModels/zenmux.ts +1423 -0
  13. package/packages/model-bank/src/const/modelProvider.ts +1 -0
  14. package/packages/model-bank/src/standard-parameters/index.ts +9 -0
  15. package/packages/model-runtime/src/core/openaiCompatibleFactory/index.test.ts +2 -2
  16. package/packages/model-runtime/src/core/streams/google/index.ts +7 -2
  17. package/packages/model-runtime/src/core/streams/openai/__snapshots__/responsesStream.test.ts.snap +166 -166
  18. package/packages/model-runtime/src/index.ts +1 -1
  19. package/packages/model-runtime/src/providers/google/createImage.ts +1 -0
  20. package/packages/model-runtime/src/providers/google/index.ts +11 -1
  21. package/packages/model-runtime/src/providers/zenmux/index.test.ts +320 -0
  22. package/packages/model-runtime/src/providers/zenmux/index.ts +84 -0
  23. package/packages/model-runtime/src/runtimeMap.ts +2 -0
  24. package/packages/types/src/user/settings/keyVaults.ts +1 -0
  25. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ResolutionSelect.tsx +88 -0
  26. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/index.tsx +9 -0
  27. package/src/config/modelProviders/index.ts +3 -0
  28. package/src/config/modelProviders/zenmux.ts +21 -0
  29. package/src/envs/llm.ts +6 -0
  30. package/src/locales/default/image.ts +8 -0
  31. package/src/store/chat/slices/aiChat/actions/__tests__/conversationLifecycle.test.ts +3 -0
  32. 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
  },