@lobehub/chat 0.148.9 → 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.
- package/CHANGELOG.md +25 -0
- package/package.json +1 -1
- package/src/config/modelProviders/ollama.ts +38 -38
- package/src/libs/agent-runtime/zeroone/index.test.ts +16 -16
- package/src/migrations/FromV3ToV4/fixtures/ollama-output-v4.json +0 -1
- package/src/store/global/slices/settings/actions/llm.test.ts +0 -1
- package/src/store/global/slices/settings/selectors/modelProvider.test.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
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
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
### [Version 0.148.9](https://github.com/lobehub/lobe-chat/compare/v0.148.8...v0.148.9)
|
|
6
31
|
|
|
7
32
|
<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.
|
|
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",
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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,
|
|
@@ -50,7 +50,7 @@ describe('LobeZeroOneAI', () => {
|
|
|
50
50
|
// Act
|
|
51
51
|
const result = await instance.chat({
|
|
52
52
|
messages: [{ content: 'Hello', role: 'user' }],
|
|
53
|
-
model: '
|
|
53
|
+
model: 'yi-34b-chat-0205',
|
|
54
54
|
temperature: 0,
|
|
55
55
|
});
|
|
56
56
|
|
|
@@ -69,7 +69,7 @@ describe('LobeZeroOneAI', () => {
|
|
|
69
69
|
const result = await instance.chat({
|
|
70
70
|
max_tokens: 1024,
|
|
71
71
|
messages: [{ content: 'Hello', role: 'user' }],
|
|
72
|
-
model: '
|
|
72
|
+
model: 'yi-34b-chat-0205',
|
|
73
73
|
temperature: 0.7,
|
|
74
74
|
top_p: 1,
|
|
75
75
|
});
|
|
@@ -79,7 +79,7 @@ describe('LobeZeroOneAI', () => {
|
|
|
79
79
|
{
|
|
80
80
|
max_tokens: 1024,
|
|
81
81
|
messages: [{ content: 'Hello', role: 'user' }],
|
|
82
|
-
model: '
|
|
82
|
+
model: 'yi-34b-chat-0205',
|
|
83
83
|
temperature: 0.7,
|
|
84
84
|
top_p: 1,
|
|
85
85
|
},
|
|
@@ -89,7 +89,7 @@ describe('LobeZeroOneAI', () => {
|
|
|
89
89
|
});
|
|
90
90
|
|
|
91
91
|
describe('Error', () => {
|
|
92
|
-
it('should return
|
|
92
|
+
it('should return ZeroOneBizError with an openai error response when OpenAI.APIError is thrown', async () => {
|
|
93
93
|
// Arrange
|
|
94
94
|
const apiError = new OpenAI.APIError(
|
|
95
95
|
400,
|
|
@@ -109,7 +109,7 @@ describe('LobeZeroOneAI', () => {
|
|
|
109
109
|
try {
|
|
110
110
|
await instance.chat({
|
|
111
111
|
messages: [{ content: 'Hello', role: 'user' }],
|
|
112
|
-
model: '
|
|
112
|
+
model: 'yi-34b-chat-0205',
|
|
113
113
|
temperature: 0,
|
|
114
114
|
});
|
|
115
115
|
} catch (e) {
|
|
@@ -125,7 +125,7 @@ describe('LobeZeroOneAI', () => {
|
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
-
it('should throw AgentRuntimeError with
|
|
128
|
+
it('should throw AgentRuntimeError with InvalidZeroOneAPIKey if no apiKey is provided', async () => {
|
|
129
129
|
try {
|
|
130
130
|
new LobeZeroOneAI({});
|
|
131
131
|
} catch (e) {
|
|
@@ -133,7 +133,7 @@ describe('LobeZeroOneAI', () => {
|
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
135
|
|
|
136
|
-
it('should return
|
|
136
|
+
it('should return ZeroOneBizError with the cause when OpenAI.APIError is thrown with cause', async () => {
|
|
137
137
|
// Arrange
|
|
138
138
|
const errorInfo = {
|
|
139
139
|
stack: 'abc',
|
|
@@ -149,7 +149,7 @@ describe('LobeZeroOneAI', () => {
|
|
|
149
149
|
try {
|
|
150
150
|
await instance.chat({
|
|
151
151
|
messages: [{ content: 'Hello', role: 'user' }],
|
|
152
|
-
model: '
|
|
152
|
+
model: 'yi-34b-chat-0205',
|
|
153
153
|
temperature: 0,
|
|
154
154
|
});
|
|
155
155
|
} catch (e) {
|
|
@@ -165,7 +165,7 @@ describe('LobeZeroOneAI', () => {
|
|
|
165
165
|
}
|
|
166
166
|
});
|
|
167
167
|
|
|
168
|
-
it('should return
|
|
168
|
+
it('should return ZeroOneBizError with an cause response with desensitize Url', async () => {
|
|
169
169
|
// Arrange
|
|
170
170
|
const errorInfo = {
|
|
171
171
|
stack: 'abc',
|
|
@@ -185,7 +185,7 @@ describe('LobeZeroOneAI', () => {
|
|
|
185
185
|
try {
|
|
186
186
|
await instance.chat({
|
|
187
187
|
messages: [{ content: 'Hello', role: 'user' }],
|
|
188
|
-
model: '
|
|
188
|
+
model: 'yi-34b-chat-0205',
|
|
189
189
|
temperature: 0,
|
|
190
190
|
});
|
|
191
191
|
} catch (e) {
|
|
@@ -201,7 +201,7 @@ describe('LobeZeroOneAI', () => {
|
|
|
201
201
|
}
|
|
202
202
|
});
|
|
203
203
|
|
|
204
|
-
it('should throw an
|
|
204
|
+
it('should throw an InvalidZeroOneAPIKey error type on 401 status code', async () => {
|
|
205
205
|
// Mock the API call to simulate a 401 error
|
|
206
206
|
const error = new Error('Unauthorized') as any;
|
|
207
207
|
error.status = 401;
|
|
@@ -210,7 +210,7 @@ describe('LobeZeroOneAI', () => {
|
|
|
210
210
|
try {
|
|
211
211
|
await instance.chat({
|
|
212
212
|
messages: [{ content: 'Hello', role: 'user' }],
|
|
213
|
-
model: '
|
|
213
|
+
model: 'yi-34b-chat-0205',
|
|
214
214
|
temperature: 0,
|
|
215
215
|
});
|
|
216
216
|
} catch (e) {
|
|
@@ -234,7 +234,7 @@ describe('LobeZeroOneAI', () => {
|
|
|
234
234
|
try {
|
|
235
235
|
await instance.chat({
|
|
236
236
|
messages: [{ content: 'Hello', role: 'user' }],
|
|
237
|
-
model: '
|
|
237
|
+
model: 'yi-34b-chat-0205',
|
|
238
238
|
temperature: 0,
|
|
239
239
|
});
|
|
240
240
|
} catch (e) {
|
|
@@ -265,7 +265,7 @@ describe('LobeZeroOneAI', () => {
|
|
|
265
265
|
id: 'chatcmpl-8xDx5AETP8mESQN7UB30GxTN2H1SO',
|
|
266
266
|
object: 'chat.completion.chunk',
|
|
267
267
|
created: 1709125675,
|
|
268
|
-
model: '
|
|
268
|
+
model: 'yi-34b-chat-0205',
|
|
269
269
|
system_fingerprint: 'fp_86156a94a0',
|
|
270
270
|
choices: [
|
|
271
271
|
{ index: 0, delta: { content: 'hello' }, logprobs: null, finish_reason: null },
|
|
@@ -287,7 +287,7 @@ describe('LobeZeroOneAI', () => {
|
|
|
287
287
|
const result = await instance.chat(
|
|
288
288
|
{
|
|
289
289
|
messages: [{ content: 'Hello', role: 'user' }],
|
|
290
|
-
model: '
|
|
290
|
+
model: 'yi-34b-chat-0205',
|
|
291
291
|
temperature: 0,
|
|
292
292
|
},
|
|
293
293
|
{ callback: mockCallback, headers: mockHeaders },
|
|
@@ -335,7 +335,7 @@ describe('LobeZeroOneAI', () => {
|
|
|
335
335
|
// 假设的测试函数调用,你可能需要根据实际情况调整
|
|
336
336
|
await instance.chat({
|
|
337
337
|
messages: [{ content: 'Hello', role: 'user' }],
|
|
338
|
-
model: '
|
|
338
|
+
model: 'yi-34b-chat-0205',
|
|
339
339
|
temperature: 0,
|
|
340
340
|
});
|
|
341
341
|
|
|
@@ -110,7 +110,6 @@ describe('LLMSettingsSliceAction', () => {
|
|
|
110
110
|
// Assert that setModelProviderConfig was not called
|
|
111
111
|
expect(ollamaList?.chatModels.find((c) => c.id === 'llava')).toEqual({
|
|
112
112
|
displayName: 'LLaVA 7B',
|
|
113
|
-
functionCall: false,
|
|
114
113
|
enabled: true,
|
|
115
114
|
id: 'llava',
|
|
116
115
|
tokens: 4000,
|
|
@@ -85,7 +85,7 @@ describe('modelProviderSelectors', () => {
|
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
describe('modelEnabledFiles', () => {
|
|
88
|
-
it
|
|
88
|
+
it('should return false if the model does not have file ability', () => {
|
|
89
89
|
const enabledFiles = modelProviderSelectors.isModelEnabledFiles('gpt-4-vision-preview')(
|
|
90
90
|
useGlobalStore.getState(),
|
|
91
91
|
);
|