🐛 fix: 修正搜索引擎插件的实现问题

This commit is contained in:
arvinxx
2023-07-23 22:56:28 +08:00
parent 7b8d969b2e
commit d19a8055c4
2 changed files with 7 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ export default async function handler(req: Request) {
if (func) {
const result = await func.runner(args as any);
console.log(`[${name}]`, 'args:', args, `Result:`, JSON.stringify(result, null, 2));
console.log(`[${name}]`, args, `result:`, JSON.stringify(result, null, 2));
const newMessages = createFunctionCallMessages(result) as ChatCompletionRequestMessage[];

View File

@@ -76,9 +76,14 @@ export interface DetectedExtensions {
month_ago: number;
}
const fetchResult = async (keywords: string) => {
const fetchResult = async ({ keywords }: { keywords: string }) => {
const params = {
api_key: API_KEY,
engine: 'google',
gl: 'cn',
google_domain: 'google.com',
hl: 'zh-cn',
location: 'China',
q: keywords,
};