forked from i-am-bee/bee-agent-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
advanced.ts
24 lines (21 loc) · 799 Bytes
/
advanced.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { OpenMeteoTool } from "bee-agent-framework/tools/weather/openMeteo";
import { UnconstrainedCache } from "bee-agent-framework/cache/unconstrainedCache";
const tool = new OpenMeteoTool({
cache: new UnconstrainedCache(),
retryOptions: {
maxRetries: 3,
},
});
console.log(tool.name); // OpenMeteo
console.log(tool.description); // Retrieve current, past, or future weather forecasts for a location.
console.log(tool.inputSchema()); // (zod/json schema)
await tool.cache.clear();
const result = await tool.run({
location: { name: "New York" },
start_date: "2024-10-10",
end_date: "2024-10-10",
temperature_unit: "celsius",
});
console.log(result.isEmpty()); // false
console.log(result.result); // prints raw data
console.log(result.getTextContent()); // prints data as text