-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #191 from autonomys/feat/getTimeTool
Add tool for retrieving current time
- Loading branch information
Showing
4 changed files
with
18 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { DynamicStructuredTool } from '@langchain/core/tools'; | ||
import { z } from 'zod'; | ||
export const createGetCurrentTimeTool = () => | ||
new DynamicStructuredTool({ | ||
name: 'get_current_time', | ||
description: | ||
'Returns the current real-world time. Use this whenever you need to know the current time, make scheduling decisions, or calculate time differences. The time is returned in ISO format. This is the only way to get accurate current time information.', | ||
schema: z.object({}), | ||
func: async () => { | ||
return new Date().toISOString(); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters