@lobehub/chat 1.110.3 → 1.110.5

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 (58) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/changelog/v1.json +18 -0
  3. package/package.json +1 -1
  4. package/packages/types/package.json +5 -13
  5. package/packages/types/src/aiProvider.ts +2 -2
  6. package/packages/types/src/importer.ts +4 -4
  7. package/packages/types/src/index.ts +3 -0
  8. package/packages/types/src/llm.ts +2 -2
  9. package/packages/types/src/rag.ts +1 -1
  10. package/packages/types/src/serverConfig.ts +3 -6
  11. package/packages/types/src/trace/action.ts +24 -1
  12. package/packages/types/src/trace/enum.ts +32 -0
  13. package/packages/types/src/trace/index.ts +1 -0
  14. package/packages/types/src/user/index.ts +3 -3
  15. package/src/app/(backend)/_deprecated/createBizOpenAI/auth.ts +1 -1
  16. package/src/app/(backend)/_deprecated/createBizOpenAI/createAzureOpenai.ts +1 -1
  17. package/src/app/(backend)/_deprecated/createBizOpenAI/createOpenai.ts +1 -1
  18. package/src/app/(backend)/_deprecated/createBizOpenAI/index.ts +1 -1
  19. package/src/app/(backend)/middleware/auth/index.test.ts +1 -1
  20. package/src/app/(backend)/middleware/auth/index.ts +1 -1
  21. package/src/app/(backend)/middleware/auth/utils.ts +1 -1
  22. package/src/app/(backend)/webapi/chat/[provider]/route.test.ts +1 -1
  23. package/src/app/(backend)/webapi/chat/[provider]/route.ts +1 -1
  24. package/src/app/(backend)/webapi/models/[provider]/pull/route.ts +1 -1
  25. package/src/app/(backend)/webapi/models/[provider]/route.ts +1 -1
  26. package/src/app/(backend)/webapi/plugin/gateway/route.ts +2 -2
  27. package/src/app/(backend)/webapi/text-to-image/[provider]/route.ts +1 -1
  28. package/src/app/(backend)/webapi/trace/route.ts +1 -1
  29. package/src/app/[variants]/(main)/settings/llm/components/Checker.tsx +1 -1
  30. package/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/Checker.tsx +1 -1
  31. package/src/const/trace.ts +2 -33
  32. package/src/features/AgentSetting/store/action.ts +2 -2
  33. package/src/features/Conversation/Error/index.tsx +1 -1
  34. package/src/features/Portal/Artifacts/Header.tsx +1 -1
  35. package/src/libs/model-runtime/ModelRuntime.test.ts +1 -1
  36. package/src/libs/model-runtime/ModelRuntime.ts +1 -2
  37. package/src/libs/model-runtime/google/index.ts +8 -98
  38. package/src/libs/model-runtime/utils/googleErrorParser.test.ts +228 -0
  39. package/src/libs/model-runtime/utils/googleErrorParser.ts +228 -0
  40. package/src/libs/traces/event.test.ts +1 -2
  41. package/src/libs/traces/event.ts +1 -1
  42. package/src/server/modules/ModelRuntime/trace.ts +2 -6
  43. package/src/services/__tests__/chat.test.ts +1 -1
  44. package/src/services/chat.ts +1 -2
  45. package/src/store/chat/slices/aiChat/actions/generateAIChat.ts +1 -1
  46. package/src/store/chat/slices/aiChat/actions/memory.ts +1 -1
  47. package/src/store/chat/slices/message/action.test.ts +1 -1
  48. package/src/store/chat/slices/message/action.ts +1 -2
  49. package/src/store/chat/slices/plugin/action.ts +1 -1
  50. package/src/store/chat/slices/topic/action.ts +1 -1
  51. package/src/store/chat/slices/translate/action.ts +1 -1
  52. package/src/utils/errorResponse.test.ts +1 -1
  53. package/src/utils/errorResponse.ts +1 -1
  54. package/src/utils/fetch/__tests__/parseError.test.ts +1 -1
  55. package/src/utils/fetch/fetchSSE.ts +1 -1
  56. package/src/utils/fetch/parseError.ts +1 -1
  57. package/packages/types/src/share.ts +0 -7
  58. /package/{packages/types/src → src/types}/locale.ts +0 -0
@@ -1,9 +1,9 @@
1
+ import { TraceEventType } from '@lobechat/types';
1
2
  import * as lobeUIModules from '@lobehub/ui';
2
3
  import { act, renderHook, waitFor } from '@testing-library/react';
3
4
  import { mutate } from 'swr';
4
5
  import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
5
6
 
6
- import { TraceEventType } from '@/const/trace';
7
7
  import { messageService } from '@/services/message';
8
8
  import { topicService } from '@/services/topic';
9
9
  import { messageMapKey } from '@/store/chat/utils/messageMapKey';
@@ -1,12 +1,11 @@
1
1
  /* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
2
2
  // Disable the auto sort key eslint rule to make the code more logic and readable
3
- import { ChatErrorType } from '@lobechat/types/fetch';
3
+ import { ChatErrorType, TraceEventType } from '@lobechat/types';
4
4
  import { copyToClipboard } from '@lobehub/ui';
5
5
  import isEqual from 'fast-deep-equal';
6
6
  import { SWRResponse, mutate } from 'swr';
7
7
  import { StateCreator } from 'zustand/vanilla';
8
8
 
9
- import { TraceEventType } from '@/const/trace';
10
9
  import { useClientDataSWR } from '@/libs/swr';
11
10
  import { messageService } from '@/services/message';
12
11
  import { topicService } from '@/services/topic';
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
2
- import { ChatErrorType } from '@lobechat/types/fetch';
2
+ import { ChatErrorType } from '@lobechat/types';
3
3
  import { PluginErrorType } from '@lobehub/chat-plugin-sdk';
4
4
  import isEqual from 'fast-deep-equal';
5
5
  import { t } from 'i18next';
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
2
2
  // Note: To make the code more logic and readable, we just disable the auto sort key eslint rule
3
3
  // DON'T REMOVE THE FIRST LINE
4
+ import { TraceNameMap } from '@lobechat/types';
4
5
  import isEqual from 'fast-deep-equal';
5
6
  import { t } from 'i18next';
6
7
  import useSWR, { SWRResponse, mutate } from 'swr';
@@ -9,7 +10,6 @@ import { StateCreator } from 'zustand/vanilla';
9
10
  import { chainSummaryTitle } from '@/chains/summaryTitle';
10
11
  import { message } from '@/components/AntdStaticMethods';
11
12
  import { LOADING_FLAT } from '@/const/message';
12
- import { TraceNameMap } from '@/const/trace';
13
13
  import { useClientDataSWR } from '@/libs/swr';
14
14
  import { chatService } from '@/services/chat';
15
15
  import { messageService } from '@/services/message';
@@ -1,9 +1,9 @@
1
+ import { TraceNameMap, TracePayload } from '@lobechat/types';
1
2
  import { produce } from 'immer';
2
3
  import { StateCreator } from 'zustand/vanilla';
3
4
 
4
5
  import { chainLangDetect } from '@/chains/langDetect';
5
6
  import { chainTranslate } from '@/chains/translate';
6
- import { TraceNameMap, TracePayload } from '@/const/trace';
7
7
  import { supportLocales } from '@/locales/resources';
8
8
  import { chatService } from '@/services/chat';
9
9
  import { messageService } from '@/services/message';
@@ -1,4 +1,4 @@
1
- import { ChatErrorType } from '@lobechat/types/fetch';
1
+ import { ChatErrorType } from '@lobechat/types';
2
2
  import { describe, expect, it, vi } from 'vitest';
3
3
 
4
4
  import { AgentRuntimeErrorType } from '@/libs/model-runtime';
@@ -1,4 +1,4 @@
1
- import { ChatErrorType, ErrorResponse, ErrorType } from '@lobechat/types/fetch';
1
+ import { ChatErrorType, ErrorResponse, ErrorType } from '@lobechat/types';
2
2
 
3
3
  import { AgentRuntimeErrorType, ILobeAgentRuntimeErrorType } from '@/libs/model-runtime';
4
4
 
@@ -1,4 +1,4 @@
1
- import { ErrorResponse } from '@lobechat/types/fetch';
1
+ import { ErrorResponse } from '@lobechat/types';
2
2
  import { afterEach, describe, expect, it, vi } from 'vitest';
3
3
 
4
4
  import { getMessageError } from '../parseError';
@@ -1,4 +1,4 @@
1
- import { ChatErrorType } from '@lobechat/types/fetch';
1
+ import { ChatErrorType } from '@lobechat/types';
2
2
 
3
3
  import { MESSAGE_CANCEL_FLAT } from '@/const/message';
4
4
  import { LOBE_CHAT_OBSERVATION_ID, LOBE_CHAT_TRACE_ID } from '@/const/trace';
@@ -1,4 +1,4 @@
1
- import { ErrorResponse, ErrorType } from '@lobechat/types/fetch';
1
+ import { ErrorResponse, ErrorType } from '@lobechat/types';
2
2
  import { t } from 'i18next';
3
3
 
4
4
  import { ChatMessageError } from '@/types/message';
@@ -1,7 +0,0 @@
1
- export interface ShareGPTConversation {
2
- avatarUrl?: string | null;
3
- items: Array<{
4
- from: 'human' | 'gpt';
5
- value: any;
6
- }>;
7
- }
File without changes