@lobehub/chat 0.148.8 → 0.148.10

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 (41) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/package.json +2 -2
  3. package/src/app/chat/features/SessionListContent/CollapseGroup/Actions.tsx +11 -5
  4. package/src/app/chat/features/SessionListContent/DefaultMode.tsx +6 -4
  5. package/src/app/chat/features/SessionListContent/List/AddButton.tsx +4 -9
  6. package/src/app/chat/features/SessionListContent/Modals/ConfigGroupModal/GroupItem.tsx +21 -16
  7. package/src/app/chat/features/SessionListContent/Modals/ConfigGroupModal/index.tsx +8 -2
  8. package/src/app/chat/features/SessionListContent/Modals/CreateGroupModal.tsx +9 -1
  9. package/src/app/chat/features/SessionListContent/Modals/RenameGroupModal.tsx +12 -3
  10. package/src/app/home/Redirect.tsx +2 -2
  11. package/src/app/welcome/(desktop)/features/Footer.tsx +1 -1
  12. package/src/app/welcome/features/Banner/index.tsx +5 -9
  13. package/src/config/modelProviders/ollama.ts +38 -38
  14. package/src/database/client/models/__tests__/session.test.ts +2 -2
  15. package/src/database/client/models/session.ts +4 -14
  16. package/src/libs/agent-runtime/zeroone/index.test.ts +16 -16
  17. package/src/locales/default/chat.ts +6 -2
  18. package/src/locales/default/welcome.ts +1 -0
  19. package/src/migrations/FromV3ToV4/fixtures/ollama-output-v4.json +0 -1
  20. package/src/services/config.ts +5 -21
  21. package/src/services/message/client.ts +10 -0
  22. package/src/services/message/index.ts +1 -13
  23. package/src/services/message/type.ts +3 -0
  24. package/src/services/session/client.ts +3 -0
  25. package/src/services/session/type.ts +8 -2
  26. package/src/services/topic/client.ts +1 -1
  27. package/src/services/topic/type.ts +3 -2
  28. package/src/store/global/slices/settings/actions/llm.test.ts +0 -1
  29. package/src/store/global/slices/settings/selectors/modelProvider.test.ts +1 -1
  30. package/src/store/session/slices/session/action.ts +74 -76
  31. package/src/store/session/slices/session/initialState.ts +8 -1
  32. package/src/store/session/slices/session/reducers.test.ts +79 -0
  33. package/src/store/session/slices/session/reducers.ts +61 -0
  34. package/src/store/session/slices/sessionGroup/action.test.ts +9 -0
  35. package/src/store/session/slices/sessionGroup/action.ts +25 -6
  36. package/src/store/session/slices/sessionGroup/reducer.test.ts +86 -0
  37. package/src/store/session/slices/sessionGroup/reducer.ts +56 -0
  38. package/src/store/session/slices/sessionGroup/selectors.ts +1 -5
  39. package/src/types/service.ts +7 -0
  40. package/src/types/session.ts +5 -7
  41. package/src/utils/uuid.ts +4 -4
package/CHANGELOG.md CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.148.10](https://github.com/lobehub/lobe-chat/compare/v0.148.9...v0.148.10)
6
+
7
+ <sup>Released on **2024-04-24**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Update Ollama model 240421.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Update Ollama model 240421, closes [#2130](https://github.com/lobehub/lobe-chat/issues/2130) ([e797af0](https://github.com/lobehub/lobe-chat/commit/e797af0))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
30
+ ### [Version 0.148.9](https://github.com/lobehub/lobe-chat/compare/v0.148.8...v0.148.9)
31
+
32
+ <sup>Released on **2024-04-23**</sup>
33
+
34
+ #### ♻ Code Refactoring
35
+
36
+ - **misc**: Refactor for session server mode.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Code refactoring
44
+
45
+ - **misc**: Refactor for session server mode, closes [#2163](https://github.com/lobehub/lobe-chat/issues/2163) ([e012597](https://github.com/lobehub/lobe-chat/commit/e012597))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ### [Version 0.148.8](https://github.com/lobehub/lobe-chat/compare/v0.148.7...v0.148.8)
6
56
 
7
57
  <sup>Released on **2024-04-23**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.148.8",
3
+ "version": "0.148.10",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot 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",
@@ -173,7 +173,7 @@
173
173
  "@next/eslint-plugin-next": "^14.2.2",
174
174
  "@peculiar/webcrypto": "^1.4.6",
175
175
  "@testing-library/jest-dom": "^6.4.2",
176
- "@testing-library/react": "^15.0.2",
176
+ "@testing-library/react": "^15.0.4",
177
177
  "@types/chroma-js": "^2.4.4",
178
178
  "@types/debug": "^4.1.12",
179
179
  "@types/diff": "^5.2.0",
@@ -27,7 +27,7 @@ const Actions = memo<ActionsProps>(
27
27
  ({ id, openRenameModal, openConfigModal, onOpenChange, isCustomGroup, isPinned }) => {
28
28
  const { t } = useTranslation('chat');
29
29
  const { styles } = useStyles();
30
- const { modal } = App.useApp();
30
+ const { modal, message } = App.useApp();
31
31
 
32
32
  const [createSession, removeSessionGroup] = useSessionStore((s) => [
33
33
  s.createSession,
@@ -48,9 +48,15 @@ const Actions = memo<ActionsProps>(
48
48
  icon: <Icon icon={Plus} />,
49
49
  key: 'newAgent',
50
50
  label: t('newAgent'),
51
- onClick: ({ domEvent }) => {
51
+ onClick: async ({ domEvent }) => {
52
52
  domEvent.stopPropagation();
53
- createSession({ group: id, pinned: isPinned });
53
+ const key = 'createNewAgentInGroup';
54
+ message.loading({ content: t('sessionGroup.creatingAgent'), duration: 0, key });
55
+
56
+ await createSession({ group: id, pinned: isPinned });
57
+
58
+ message.destroy(key);
59
+ message.success({ content: t('sessionGroup.createAgentSuccess') });
54
60
  },
55
61
  };
56
62
 
@@ -83,9 +89,9 @@ const Actions = memo<ActionsProps>(
83
89
  modal.confirm({
84
90
  centered: true,
85
91
  okButtonProps: { danger: true },
86
- onOk: () => {
92
+ onOk: async () => {
87
93
  if (!id) return;
88
- removeSessionGroup(id);
94
+ await removeSessionGroup(id);
89
95
  },
90
96
  rootClassName: styles.modalRoot,
91
97
  title: t('sessionGroup.confirmRemoveGroupAlert'),
@@ -1,10 +1,12 @@
1
1
  import { CollapseProps } from 'antd';
2
+ import isEqual from 'fast-deep-equal';
2
3
  import { memo, useMemo, useState } from 'react';
3
4
  import { useTranslation } from 'react-i18next';
4
5
 
5
6
  import { useGlobalStore } from '@/store/global';
6
7
  import { preferenceSelectors } from '@/store/global/selectors';
7
8
  import { useSessionStore } from '@/store/session';
9
+ import { sessionSelectors } from '@/store/session/selectors';
8
10
  import { SessionDefaultGroup } from '@/types/session';
9
11
 
10
12
  import Actions from '../SessionListContent/CollapseGroup/Actions';
@@ -22,11 +24,11 @@ const SessionListContent = memo(() => {
22
24
  const [configGroupModalOpen, setConfigGroupModalOpen] = useState(false);
23
25
 
24
26
  const [useFetchSessions] = useSessionStore((s) => [s.useFetchSessions]);
25
- const { data } = useFetchSessions();
27
+ useFetchSessions();
26
28
 
27
- const pinnedSessions = data?.pinned;
28
- const defaultSessions = data?.default;
29
- const customSessionGroups = data?.customGroup;
29
+ const defaultSessions = useSessionStore(sessionSelectors.defaultSessions, isEqual);
30
+ const customSessionGroups = useSessionStore(sessionSelectors.customSessionGroups, isEqual);
31
+ const pinnedSessions = useSessionStore(sessionSelectors.pinnedSessions, isEqual);
30
32
 
31
33
  const [sessionGroupKeys, updatePreference] = useGlobalStore((s) => [
32
34
  preferenceSelectors.sessionGroupKeys(s),
@@ -12,18 +12,13 @@ const AddButton = memo<{ groupId?: string }>(({ groupId }) => {
12
12
  const { t } = useTranslation('chat');
13
13
  const createSession = useSessionStore((s) => s.createSession);
14
14
 
15
- const { mutate, isValidating } = useActionSWR('session.createSession', (groupId) =>
16
- createSession({ group: groupId }),
17
- );
15
+ const { mutate, isValidating } = useActionSWR(['session.createSession', groupId], () => {
16
+ return createSession({ group: groupId });
17
+ });
18
18
 
19
19
  return (
20
20
  <Flexbox style={{ margin: '12px 16px' }}>
21
- <Button
22
- block
23
- icon={<Icon icon={Plus} />}
24
- loading={isValidating}
25
- onClick={() => mutate(groupId)}
26
- >
21
+ <Button block icon={<Icon icon={Plus} />} loading={isValidating} onClick={() => mutate()}>
27
22
  {t('newAgent')}
28
23
  </Button>
29
24
  </Flexbox>
@@ -1,5 +1,5 @@
1
1
  import { ActionIcon, EditableText, SortableList } from '@lobehub/ui';
2
- import { App, Popconfirm } from 'antd';
2
+ import { App } from 'antd';
3
3
  import { createStyles } from 'antd-style';
4
4
  import { PencilLine, Trash } from 'lucide-react';
5
5
  import { memo, useState } from 'react';
@@ -25,7 +25,7 @@ const useStyles = createStyles(({ css }) => ({
25
25
  const GroupItem = memo<SessionGroupItem>(({ id, name }) => {
26
26
  const { t } = useTranslation('chat');
27
27
  const { styles } = useStyles();
28
- const { message } = App.useApp();
28
+ const { message, modal } = App.useApp();
29
29
 
30
30
  const [editing, setEditing] = useState(false);
31
31
  const [updateSessionGroupName, removeSessionGroup] = useSessionStore((s) => [
@@ -40,29 +40,34 @@ const GroupItem = memo<SessionGroupItem>(({ id, name }) => {
40
40
  <>
41
41
  <span className={styles.title}>{name}</span>
42
42
  <ActionIcon icon={PencilLine} onClick={() => setEditing(true)} size={'small'} />
43
- <Popconfirm
44
- arrow={false}
45
- okButtonProps={{
46
- danger: true,
47
- type: 'primary',
43
+ <ActionIcon
44
+ icon={Trash}
45
+ onClick={() => {
46
+ modal.confirm({
47
+ centered: true,
48
+ okButtonProps: {
49
+ danger: true,
50
+ type: 'primary',
51
+ },
52
+ onOk: async () => {
53
+ await removeSessionGroup(id);
54
+ },
55
+ title: t('sessionGroup.confirmRemoveGroupAlert'),
56
+ });
48
57
  }}
49
- onConfirm={() => {
50
- removeSessionGroup(id);
51
- }}
52
- title={t('sessionGroup.confirmRemoveGroupAlert')}
53
- >
54
- <ActionIcon icon={Trash} size={'small'} />
55
- </Popconfirm>
58
+ size={'small'}
59
+ />
56
60
  </>
57
61
  ) : (
58
62
  <EditableText
59
63
  editing={editing}
60
- onChangeEnd={(input) => {
64
+ onChangeEnd={async (input) => {
61
65
  if (name !== input) {
62
66
  if (!input) return;
63
67
  if (input.length === 0 || input.length > 20)
64
68
  return message.warning(t('sessionGroup.tooLong'));
65
- updateSessionGroupName(id, input);
69
+
70
+ await updateSessionGroupName(id, input);
66
71
  message.success(t('sessionGroup.renameSuccess'));
67
72
  }
68
73
  setEditing(false);
@@ -3,7 +3,7 @@ import { Button } from 'antd';
3
3
  import { createStyles } from 'antd-style';
4
4
  import isEqual from 'fast-deep-equal';
5
5
  import { Plus } from 'lucide-react';
6
- import { memo } from 'react';
6
+ import { memo, useState } from 'react';
7
7
  import { useTranslation } from 'react-i18next';
8
8
  import { Flexbox } from 'react-layout-kit';
9
9
 
@@ -35,6 +35,7 @@ const ConfigGroupModal = memo<ModalProps>(({ open, onCancel }) => {
35
35
  s.addSessionGroup,
36
36
  s.updateSessionGroupSort,
37
37
  ]);
38
+ const [loading, setLoading] = useState(false);
38
39
 
39
40
  return (
40
41
  <Modal
@@ -67,7 +68,12 @@ const ConfigGroupModal = memo<ModalProps>(({ open, onCancel }) => {
67
68
  <Button
68
69
  block
69
70
  icon={<Icon icon={Plus} />}
70
- onClick={() => addSessionGroup(t('sessionGroup.newGroup'))}
71
+ loading={loading}
72
+ onClick={async () => {
73
+ setLoading(true);
74
+ await addSessionGroup(t('sessionGroup.newGroup'));
75
+ setLoading(false);
76
+ }}
71
77
  >
72
78
  {t('sessionGroup.createGroup')}
73
79
  </Button>
@@ -22,21 +22,29 @@ const CreateGroupModal = memo<CreateGroupModalProps>(
22
22
  s.addSessionGroup,
23
23
  ]);
24
24
  const [input, setInput] = useState('');
25
+ const [loading, setLoading] = useState(false);
25
26
 
26
27
  return (
27
28
  <div onClick={(e) => e.stopPropagation()}>
28
29
  <Modal
29
30
  allowFullscreen
30
- onCancel={onCancel}
31
+ destroyOnClose
32
+ okButtonProps={{ loading }}
33
+ onCancel={(e) => {
34
+ setInput('');
35
+ onCancel?.(e);
36
+ }}
31
37
  onOk={async (e: MouseEvent<HTMLButtonElement>) => {
32
38
  if (!input) return;
33
39
 
34
40
  if (input.length === 0 || input.length > 20)
35
41
  return message.warning(t('sessionGroup.tooLong'));
36
42
 
43
+ setLoading(true);
37
44
  const groupId = await addCustomGroup(input);
38
45
  await updateSessionGroup(id, groupId);
39
46
  toggleExpandSessionGroup(groupId, true);
47
+ setLoading(false);
40
48
 
41
49
  message.success(t('sessionGroup.createSuccess'));
42
50
  onCancel?.(e);
@@ -18,18 +18,27 @@ const RenameGroupModal = memo<RenameGroupModalProps>(({ id, open, onCancel }) =>
18
18
  const group = useSessionStore((s) => sessionGroupSelectors.getGroupById(id)(s), isEqual);
19
19
 
20
20
  const [input, setInput] = useState<string>();
21
+ const [loading, setLoading] = useState(false);
21
22
 
22
23
  const { message } = App.useApp();
23
24
  return (
24
25
  <Modal
25
26
  allowFullscreen
26
- onCancel={onCancel}
27
- onOk={(e) => {
27
+ destroyOnClose
28
+ okButtonProps={{ loading }}
29
+ onCancel={(e) => {
30
+ setInput(group?.name);
31
+ onCancel?.(e);
32
+ }}
33
+ onOk={async (e) => {
28
34
  if (!input) return;
29
35
  if (input.length === 0 || input.length > 20)
30
36
  return message.warning(t('sessionGroup.tooLong'));
31
- updateSessionGroupName(id, input);
37
+ setLoading(true);
38
+ await updateSessionGroupName(id, input);
32
39
  message.success(t('sessionGroup.renameSuccess'));
40
+ setLoading(false);
41
+
33
42
  onCancel?.(e);
34
43
  }}
35
44
  open={open}
@@ -8,8 +8,8 @@ import { sessionService } from '@/services/session';
8
8
 
9
9
  const checkHasConversation = async () => {
10
10
  const hasMessages = await messageService.hasMessages();
11
- const hasAgents = await sessionService.countSessions();
12
- return hasMessages || hasAgents === 0;
11
+ const hasAgents = await sessionService.hasSessions();
12
+ return hasMessages || hasAgents;
13
13
  };
14
14
 
15
15
  const Redirect = memo(() => {
@@ -16,7 +16,7 @@ const Footer = memo(() => {
16
16
  return (
17
17
  <Flexbox align={'center'} horizontal justify={'space-between'} style={{ padding: 16 }}>
18
18
  <span style={{ color: theme.colorTextDescription }}>
19
- ©{new Date().getFullYear()} LobeHub
19
+ © 2023 - {new Date().getFullYear()} LobeHub, LLC
20
20
  </span>
21
21
  <Flexbox horizontal>
22
22
  <ActionIcon
@@ -3,12 +3,12 @@
3
3
  import { Icon } from '@lobehub/ui';
4
4
  import { Button } from 'antd';
5
5
  import { SendHorizonal } from 'lucide-react';
6
+ import Link from 'next/link';
6
7
  import { useRouter } from 'next/navigation';
7
8
  import { memo } from 'react';
8
9
  import { useTranslation } from 'react-i18next';
9
10
  import { Flexbox } from 'react-layout-kit';
10
11
 
11
- import DataImporter from '@/features/DataImporter';
12
12
  import { useGlobalStore } from '@/store/global';
13
13
 
14
14
  import Hero from './Hero';
@@ -32,15 +32,11 @@ const Banner = memo<{ mobile?: boolean }>(({ mobile }) => {
32
32
  justify={'center'}
33
33
  width={'100%'}
34
34
  >
35
- <DataImporter
36
- onFinishImport={() => {
37
- router.push('/chat');
38
- }}
39
- >
40
- <Button block={mobile} size={'large'}>
41
- {t('button.import')}
35
+ <Link href={'/market'}>
36
+ <Button block={mobile} size={'large'} type={'default'}>
37
+ {t('button.market')}
42
38
  </Button>
43
- </DataImporter>
39
+ </Link>
44
40
  <Button
45
41
  block={mobile}
46
42
  onClick={() => (isMobile ? router.push('/chat') : switchBackToChat())}
@@ -2,148 +2,148 @@ import { ModelProviderCard } from '@/types/llm';
2
2
 
3
3
  const Ollama: ModelProviderCard = {
4
4
  chatModels: [
5
+ {
6
+ displayName: 'Command R 35B',
7
+ enabled: true,
8
+ id: 'command-r',
9
+ tokens: 128_000,
10
+ },
11
+ {
12
+ displayName: 'Command R+ 104B (Q2_K)',
13
+ id: 'command-r-plus:104b-q2_K',
14
+ tokens: 128_000,
15
+ },
5
16
  {
6
17
  displayName: 'Gemma 7B',
7
18
  enabled: true,
8
- functionCall: false,
9
19
  id: 'gemma',
10
20
  tokens: 4000,
11
- vision: false,
12
21
  },
13
22
  {
14
23
  displayName: 'Gemma 2B',
15
24
  enabled: true,
16
- functionCall: false,
17
25
  id: 'gemma:2b',
18
26
  tokens: 4000,
19
- vision: false,
20
27
  },
21
28
  {
22
29
  displayName: 'Llama2 Chat 13B',
23
- functionCall: false,
24
30
  id: 'llama2:13b',
25
31
  tokens: 4000,
26
- vision: false,
27
32
  },
28
33
  {
29
34
  displayName: 'Llama2 Chat 7B',
30
- enabled: true,
31
- functionCall: false,
32
35
  id: 'llama2',
33
36
  tokens: 4000,
34
- vision: false,
35
37
  },
36
38
  {
37
39
  displayName: 'Llama2 Chat 70B',
38
- functionCall: false,
39
40
  id: 'llama2:70b',
40
41
  tokens: 4000,
41
- vision: false,
42
42
  },
43
43
  {
44
44
  displayName: 'Llama2 CN 13B',
45
- functionCall: false,
46
45
  id: 'llama2-chinese:13b',
47
46
  tokens: 4000,
48
- vision: false,
49
47
  },
50
48
  {
51
49
  displayName: 'Llama2 CN 7B',
52
- functionCall: false,
53
50
  id: 'llama2-chinese',
54
51
  tokens: 4000,
55
- vision: false,
52
+ },
53
+ {
54
+ displayName: 'Llama3 8B',
55
+ enabled: true,
56
+ id: 'llama3',
57
+ tokens: 8000,
58
+ },
59
+ {
60
+ displayName: 'Llama3 70B',
61
+ id: 'llama3:70b',
62
+ tokens: 8000,
63
+ },
64
+ {
65
+ displayName: 'WizardLM 2 7B',
66
+ enabled: true,
67
+ id: 'wizardlm2',
68
+ tokens: 65_536,
69
+ },
70
+ {
71
+ displayName: 'WizardLM 2 8x22B',
72
+ id: 'wizardlm2:8x22b',
73
+ tokens: 65_536,
56
74
  },
57
75
  {
58
76
  displayName: 'Code Llama 7B',
59
- functionCall: false,
60
77
  id: 'codellama',
61
78
  tokens: 16_000,
62
- vision: false,
63
79
  },
64
80
  {
65
81
  displayName: 'Code Llama 34B',
66
- functionCall: false,
67
82
  id: 'codellama:34b',
68
83
  tokens: 16_000,
69
- vision: false,
70
84
  },
71
85
  {
72
86
  displayName: 'Code Llama 70B',
73
- functionCall: false,
74
87
  id: 'codellama:70b',
75
88
  tokens: 16_000,
76
- vision: false,
77
89
  },
78
90
  {
79
91
  displayName: 'Code Llama 7B (Python)',
80
- functionCall: false,
81
92
  id: 'codellama:python',
82
93
  tokens: 16_000,
83
- vision: false,
84
94
  },
85
95
  {
86
96
  displayName: 'Mistral',
87
97
  enabled: true,
88
- functionCall: false,
89
98
  id: 'mistral',
90
99
  tokens: 4800,
91
- vision: false,
92
100
  },
93
101
  {
94
102
  displayName: 'Mixtral 8x7B',
95
103
  enabled: true,
96
- functionCall: false,
97
104
  id: 'mixtral',
98
105
  tokens: 32_000,
99
- vision: false,
106
+ },
107
+ {
108
+ displayName: 'Mixtral 8x22B',
109
+ id: 'mixtral:8x22b',
110
+ tokens: 64_000,
100
111
  },
101
112
  {
102
113
  displayName: 'Qwen Chat 4B',
103
- functionCall: false,
104
114
  id: 'qwen',
105
115
  tokens: 32_768,
106
- vision: false,
107
116
  },
108
117
  {
109
118
  displayName: 'Qwen Chat 7B',
110
119
  enabled: true,
111
- functionCall: false,
112
120
  id: 'qwen:7b',
113
121
  tokens: 32_768,
114
- vision: false,
115
122
  },
116
123
  {
117
124
  displayName: 'Qwen Chat 14B',
118
- functionCall: false,
119
125
  id: 'qwen:14b',
120
126
  tokens: 32_768,
121
- vision: false,
122
127
  },
123
128
  {
124
129
  displayName: 'Qwen Chat 72B',
125
- functionCall: false,
126
130
  id: 'qwen:72b',
127
131
  tokens: 32_768,
128
- vision: false,
129
132
  },
130
133
  {
131
134
  displayName: 'LLaVA 7B',
132
- functionCall: false,
133
135
  id: 'llava',
134
136
  tokens: 4000,
135
137
  vision: true,
136
138
  },
137
139
  {
138
140
  displayName: 'LLaVA 13B',
139
- functionCall: false,
140
141
  id: 'llava:13b',
141
142
  tokens: 4000,
142
143
  vision: true,
143
144
  },
144
145
  {
145
146
  displayName: 'LLaVA 34B',
146
- functionCall: false,
147
147
  id: 'llava:34b',
148
148
  tokens: 4000,
149
149
  vision: true,
@@ -179,8 +179,8 @@ describe('SessionModel', () => {
179
179
  await SessionModel.create('agent', sessionData);
180
180
 
181
181
  const sessionsWithGroups = await SessionModel.queryWithGroups();
182
- expect(sessionsWithGroups.all).toHaveLength(1);
183
- expect(sessionsWithGroups.all[0]).toEqual(expect.objectContaining(sessionData));
182
+ expect(sessionsWithGroups.sessions).toHaveLength(1);
183
+ expect(sessionsWithGroups.sessions[0]).toEqual(expect.objectContaining(sessionData));
184
184
  });
185
185
  });
186
186
 
@@ -43,21 +43,11 @@ class _SessionModel extends BaseModel {
43
43
  }
44
44
 
45
45
  async queryWithGroups(): Promise<ChatSessionList> {
46
- const groups = await SessionGroupModel.query();
47
- const customGroups = await this.queryByGroupIds(groups.map((item) => item.id));
48
- const defaultItems = await this.querySessionsByGroupId(SessionDefaultGroup.Default);
49
- const pinnedItems = await this.getPinnedSessions();
46
+ const sessionGroups = await SessionGroupModel.query();
50
47
 
51
- const all = await this.query();
52
- return {
53
- all,
54
- customGroup: groups.map((group) => ({
55
- ...group,
56
- children: customGroups[group.id],
57
- })),
58
- default: defaultItems,
59
- pinned: pinnedItems,
60
- };
48
+ const sessions = await this.query();
49
+
50
+ return { sessionGroups, sessions };
61
51
  }
62
52
 
63
53
  /**