shitton
This commit is contained in:
@@ -356,11 +356,12 @@ export async function webSearch(args?: Record<string, unknown>) {
|
||||
|
||||
note: "Use returned URLs as sources. Do not invent facts that are not present in the snippets/results.",
|
||||
};
|
||||
} catch (e: any) {
|
||||
} catch (e: unknown) {
|
||||
logError(e);
|
||||
|
||||
const status = e?.response?.status;
|
||||
const data = e?.response?.data;
|
||||
const axiosLike = e as {response?: {status?: unknown; data?: unknown}};
|
||||
const status = axiosLike.response?.status;
|
||||
const data = axiosLike.response?.data;
|
||||
|
||||
return {
|
||||
ok: false,
|
||||
|
||||
@@ -327,8 +327,8 @@ async function assertNoSymlinkInPath(
|
||||
if (stat.isSymbolicLink()) {
|
||||
throw new Error("Symlinks are not allowed in file tool paths.");
|
||||
}
|
||||
} catch (e: any) {
|
||||
if (e?.code === "ENOENT" && options?.allowMissingTail) {
|
||||
} catch (e: unknown) {
|
||||
if ((e as NodeJS.ErrnoException).code === "ENOENT" && options?.allowMissingTail) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -341,8 +341,8 @@ async function pathExists(absolutePath: string): Promise<boolean> {
|
||||
try {
|
||||
await fs.promises.lstat(absolutePath);
|
||||
return true;
|
||||
} catch (e: any) {
|
||||
if (e?.code === "ENOENT") return false;
|
||||
} catch (e: unknown) {
|
||||
if ((e as NodeJS.ErrnoException).code === "ENOENT") return false;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,11 +58,11 @@ export const marketRatesToolPrompt = [
|
||||
"- When the user asks for all rates, group fiat currencies separately from crypto and gold.",
|
||||
].join("\n");
|
||||
|
||||
export async function getMarketRates(): Promise<any | undefined> {
|
||||
export async function getMarketRates(): Promise<unknown | undefined> {
|
||||
try {
|
||||
const response = await axios.get("https://apid.r00t.top/api/v2/currency/rates");
|
||||
return response.data;
|
||||
} catch (e: any) {
|
||||
} catch (e: unknown) {
|
||||
console.error("GET_MARKET_RATES", e);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -692,7 +692,7 @@ function parsePythonInterpreterArgs(
|
||||
|
||||
return {
|
||||
code,
|
||||
stdin,
|
||||
stdin: typeof stdin === "string" ? stdin : undefined,
|
||||
timeoutMs: timeoutMs === undefined ? undefined : Number(timeoutMs),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ export async function loadOllamaModel(model: string, ollama: Ollama, contextLeng
|
||||
}
|
||||
});
|
||||
return true;
|
||||
} catch (e: any) {
|
||||
} catch (e: unknown) {
|
||||
console.error("Error loading Ollama model:", model);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ export const weatherToolPrompt = [
|
||||
"If the city is missing or unclear, ask the user to specify it.",
|
||||
].join("\n");
|
||||
|
||||
export async function getWeather(args?: Record<string, unknown>): Promise<any | null> {
|
||||
export async function getWeather(args?: Record<string, unknown>): Promise<Record<string, unknown> | null> {
|
||||
console.log("getWeather()");
|
||||
try {
|
||||
const city = asNonEmptyString(args?.city);
|
||||
@@ -137,7 +137,7 @@ export async function getWeather(args?: Record<string, unknown>): Promise<any |
|
||||
windSpeed: wind.speed,
|
||||
},
|
||||
};
|
||||
} catch (e: any) {
|
||||
} catch (e: unknown) {
|
||||
logError(e);
|
||||
return null;
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user