shitton
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import axios from "axios";
|
||||
import {toolsLogger} from "./tool-logger";
|
||||
|
||||
const logger = toolsLogger.child("brave-search");
|
||||
import {Environment} from "../../common/environment";
|
||||
import {logError} from "../../util/utils";
|
||||
import {AiTool} from "../tool-types";
|
||||
@@ -264,7 +267,8 @@ function normalizeBraveResultFilter(value: unknown): string {
|
||||
}
|
||||
|
||||
export async function webSearch(args?: Record<string, unknown>) {
|
||||
console.log("braveSearch()");
|
||||
const startedAt = Date.now();
|
||||
logger.info("start", {args});
|
||||
|
||||
try {
|
||||
const query = asNonEmptyString(args?.query);
|
||||
@@ -370,7 +374,7 @@ export async function webSearch(args?: Record<string, unknown>) {
|
||||
response: data ?? null,
|
||||
};
|
||||
} finally {
|
||||
console.log("END: braveSearch()");
|
||||
logger.debug("done", {duration: logger.duration(startedAt)});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user