Skip to content

Commit e223601

Browse files
committed
- - -
1 parent 24807a2 commit e223601

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/tools/RemoteTool.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
* });
5050
* ```
5151
*/
52+
import Agent from "~/static/agent";
5253
import Tool, { ToolOptions } from "~/static/tool";
5354

5455
/**
@@ -215,7 +216,7 @@ export default class RemoteTool extends Tool {
215216
constructor(name: string, options: RemoteToolOptions) {
216217
super(name, {
217218
...options,
218-
func: async (args: Record<string, any>) => {
219+
func: async (ctx: Agent, args: Record<string, any>) => {
219220
return await fetch(options.http.url, {
220221
method: options.http.method,
221222
headers: options.http.headers,

src/tools/Time.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* // Respuesta: "12/27/2024, 10:30:45 AM"
2828
* ```
2929
*/
30+
import Agent from "~/static/agent";
3031
import Tool from "~/static/tool";
3132

3233
/**
@@ -93,7 +94,7 @@ export default class TimeTool extends Tool {
9394
time_zone:
9495
"Opcional - Zona horaria IANA para obtener la hora (ej: Europe/Madrid). Si no se proporciona, usa la zona horaria del sistema",
9596
},
96-
func: (args: { time_zone: string }) => {
97+
func: (ctx: Agent, args: { time_zone: string }) => {
9798
args.time_zone ||=
9899
options.time_zone || Intl.DateTimeFormat().resolvedOptions().timeZone;
99100
return new Date().toLocaleString("en-US", { timeZone: args.time_zone });

0 commit comments

Comments
 (0)