-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow matt and mary can use specify skill
- Loading branch information
Showing
4 changed files
with
37 additions
and
0 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
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,30 @@ | ||
import { z } from "zod"; | ||
import { tool } from "ai"; | ||
|
||
import { City } from "@entity/City"; | ||
|
||
export function canEnableProtectMachine(city: City) { | ||
return tool({ | ||
description: | ||
"Can enable the protect machine to reduce damage rate, if the machine is already enabled it will return false", | ||
parameters: z.object({}), | ||
execute: async () => { | ||
const success = city.enableProtectedMachine(); | ||
|
||
return { success }; | ||
}, | ||
}); | ||
} | ||
|
||
export function canCallPeople(city: City) { | ||
return tool({ | ||
description: | ||
"Can call people to reduce damage rate, if the people is already called it will return false", | ||
parameters: z.object({}), | ||
execute: async () => { | ||
const success = city.callPeople(); | ||
|
||
return { success }; | ||
}, | ||
}); | ||
} |
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