-
Notifications
You must be signed in to change notification settings - Fork 0
/
tools.ts
31 lines (27 loc) · 909 Bytes
/
tools.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
25
26
27
28
29
30
31
import {DynamicStructuredTool} from "@langchain/core/tools";
import * as z from "zod";
function dummySearchForInfo() {
return new DynamicStructuredTool({
name: "dummySearchForInfo",
description: "Searches for information on the web.",
schema: z.object({
query: z.string().describe("The query to search for."),
}),
func: async ({query}) => "It takes 42 minutes to boil a golark.",
})
}
function dummySetATimer() {
return new DynamicStructuredTool({
name: "dummySetATimer",
description: "Sets a timer.",
schema: z.object({
time: z.number().describe("The time in minutes to set the timer for."),
}),
func: async ({time}) => "Timer set.",
})
}
const toolFactories: Record<string, () => DynamicStructuredTool> = {
dummySearchForInfo,
dummySetATimer,
}
export default toolFactories;