@lobehub/chat 0.133.2 → 0.133.3
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
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.133.3](https://github.com/lobehub/lobe-chat/compare/v0.133.2...v0.133.3)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-03-10**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Fix the max token of claude 3.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Fix the max token of claude 3, closes [#1526](https://github.com/lobehub/lobe-chat/issues/1526) ([222fae3](https://github.com/lobehub/lobe-chat/commit/222fae3))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
### [Version 0.133.2](https://github.com/lobehub/lobe-chat/compare/v0.133.1...v0.133.2)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2024-03-10**</sup>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.133.
|
|
3
|
+
"version": "0.133.3",
|
|
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",
|
|
@@ -31,7 +31,6 @@ describe('LobeAnthropicAI', () => {
|
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
describe('chat', () => {
|
|
34
|
-
|
|
35
34
|
it('should return a StreamingTextResponse on successful API call', async () => {
|
|
36
35
|
const result = await instance.chat({
|
|
37
36
|
messages: [{ content: 'Hello', role: 'user' }],
|
|
@@ -64,7 +63,7 @@ describe('LobeAnthropicAI', () => {
|
|
|
64
63
|
|
|
65
64
|
// Assert
|
|
66
65
|
expect(instance['client'].messages.create).toHaveBeenCalledWith({
|
|
67
|
-
max_tokens:
|
|
66
|
+
max_tokens: 4096,
|
|
68
67
|
messages: [{ content: 'Hello', role: 'user' }],
|
|
69
68
|
model: 'claude-instant-1.2',
|
|
70
69
|
stream: true,
|
|
@@ -97,7 +96,7 @@ describe('LobeAnthropicAI', () => {
|
|
|
97
96
|
|
|
98
97
|
// Assert
|
|
99
98
|
expect(instance['client'].messages.create).toHaveBeenCalledWith({
|
|
100
|
-
max_tokens:
|
|
99
|
+
max_tokens: 4096,
|
|
101
100
|
messages: [{ content: 'Hello', role: 'user' }],
|
|
102
101
|
model: 'claude-instant-1.2',
|
|
103
102
|
stream: true,
|
|
@@ -121,9 +120,7 @@ describe('LobeAnthropicAI', () => {
|
|
|
121
120
|
// Act
|
|
122
121
|
const result = await instance.chat({
|
|
123
122
|
max_tokens: 2048,
|
|
124
|
-
messages: [
|
|
125
|
-
{ content: 'Hello', role: 'user' },
|
|
126
|
-
],
|
|
123
|
+
messages: [{ content: 'Hello', role: 'user' }],
|
|
127
124
|
model: 'claude-instant-1.2',
|
|
128
125
|
temperature: 0.5,
|
|
129
126
|
top_p: 1,
|
|
@@ -132,14 +129,12 @@ describe('LobeAnthropicAI', () => {
|
|
|
132
129
|
// Assert
|
|
133
130
|
expect(instance['client'].messages.create).toHaveBeenCalledWith({
|
|
134
131
|
max_tokens: 2048,
|
|
135
|
-
messages: [
|
|
136
|
-
{ content: 'Hello', role: 'user' },
|
|
137
|
-
],
|
|
132
|
+
messages: [{ content: 'Hello', role: 'user' }],
|
|
138
133
|
model: 'claude-instant-1.2',
|
|
139
134
|
stream: true,
|
|
140
135
|
temperature: 0.5,
|
|
141
136
|
top_p: 1,
|
|
142
|
-
})
|
|
137
|
+
});
|
|
143
138
|
expect(result).toBeInstanceOf(Response);
|
|
144
139
|
});
|
|
145
140
|
|
|
@@ -158,9 +153,7 @@ describe('LobeAnthropicAI', () => {
|
|
|
158
153
|
const result = await instance.chat({
|
|
159
154
|
frequency_penalty: 0.5, // Unsupported option
|
|
160
155
|
max_tokens: 2048,
|
|
161
|
-
messages: [
|
|
162
|
-
{ content: 'Hello', role: 'user' },
|
|
163
|
-
],
|
|
156
|
+
messages: [{ content: 'Hello', role: 'user' }],
|
|
164
157
|
model: 'claude-instant-1.2',
|
|
165
158
|
presence_penalty: 0.5,
|
|
166
159
|
temperature: 0.5,
|
|
@@ -170,14 +163,12 @@ describe('LobeAnthropicAI', () => {
|
|
|
170
163
|
// Assert
|
|
171
164
|
expect(instance['client'].messages.create).toHaveBeenCalledWith({
|
|
172
165
|
max_tokens: 2048,
|
|
173
|
-
messages: [
|
|
174
|
-
{ content: 'Hello', role: 'user' },
|
|
175
|
-
],
|
|
166
|
+
messages: [{ content: 'Hello', role: 'user' }],
|
|
176
167
|
model: 'claude-instant-1.2',
|
|
177
168
|
stream: true,
|
|
178
169
|
temperature: 0.5,
|
|
179
170
|
top_p: 1,
|
|
180
|
-
})
|
|
171
|
+
});
|
|
181
172
|
expect(result).toBeInstanceOf(Response);
|
|
182
173
|
});
|
|
183
174
|
|
|
@@ -49,7 +49,7 @@ export class LobeAnthropicAI implements LobeRuntimeAI {
|
|
|
49
49
|
const user_messages = messages.filter((m) => m.role !== 'system');
|
|
50
50
|
|
|
51
51
|
const requestParams: Anthropic.MessageCreateParams = {
|
|
52
|
-
max_tokens: max_tokens ||
|
|
52
|
+
max_tokens: max_tokens || 4096,
|
|
53
53
|
messages: this.buildAnthropicMessages(user_messages),
|
|
54
54
|
model: model,
|
|
55
55
|
stream: true,
|