- 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
export class ExploreStep extends Step {
getPrompt() {
return `${HotelPrompt.Role}
Collect dates, then call capture_choices.`;
}
defineTool(): ToolType[] {
return [{
name: "capture_choices",
description: "Capture hotel search criteria",
schema: z.object({ json: z.string() }),
}];
}
@Tool
protected async capture_choices(
args: { json: string },
): Promise<ToolResponseType> {
const hotels = await Pricing.search(args.json);
if (!hotels.length) {
return stay("No match. Ask for wider criteria.");
}
return go(PresentStep).withState({ hotels });
}
}