@lobehub/chat 0.13.0 → 0.13.1
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.13.1](https://github.com/lobehub/lobe-chat/compare/v0.13.0...v0.13.1)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-07-23**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: 修正搜索引擎插件的实现问题.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: 修正搜索引擎插件的实现问题 ([d19a805](https://github.com/lobehub/lobe-chat/commit/d19a805))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
## [Version 0.13.0](https://github.com/lobehub/lobe-chat/compare/v0.12.1...v0.13.0)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2023-07-23**</sup>
|
package/package.json
CHANGED
|
@@ -13,13 +13,15 @@ export default async function handler(req: Request) {
|
|
|
13
13
|
|
|
14
14
|
const stream = await createChatCompletion(payload, (payload) => ({
|
|
15
15
|
experimental_onFunctionCall: async ({ name, arguments: args }, createFunctionCallMessages) => {
|
|
16
|
-
console.log(
|
|
16
|
+
console.log(`检测到 functionCall: ${name}`);
|
|
17
17
|
|
|
18
18
|
const func = pluginList.find((f) => f.name === name);
|
|
19
19
|
|
|
20
20
|
if (func) {
|
|
21
21
|
const result = await func.runner(args as any);
|
|
22
22
|
|
|
23
|
+
console.log(`[${name}]`, args, `result:`, JSON.stringify(result, null, 2));
|
|
24
|
+
|
|
23
25
|
const newMessages = createFunctionCallMessages(result) as ChatCompletionRequestMessage[];
|
|
24
26
|
|
|
25
27
|
return openai.createChatCompletion({
|
|
@@ -76,9 +76,10 @@ export interface DetectedExtensions {
|
|
|
76
76
|
month_ago: number;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
const fetchResult = async (keywords: string) => {
|
|
79
|
+
const fetchResult = async ({ keywords }: { keywords: string }) => {
|
|
80
80
|
const params = {
|
|
81
81
|
api_key: API_KEY,
|
|
82
|
+
engine: 'google',
|
|
82
83
|
gl: 'cn',
|
|
83
84
|
google_domain: 'google.com',
|
|
84
85
|
hl: 'zh-cn',
|