Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions js/testapps/anthropic/src/stable/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@ const getWeather = ai.defineTool(
name: 'getWeather',
description: 'Gets the current weather in a given location',
inputSchema: z.object({
location: z.string().describe('The location to get the current weather for'),
location: z
.string()
.describe('The location to get the current weather for'),
}),
outputSchema: z.string(),
},
async (input: any) => {
// Here, we would typically make an API call or database query. For this
// example, we just return a fixed value.
return `The current weather in ${input.location} is 63°F and sunny.`;
},
}
);

ai.defineFlow('anthropic-stable-tools', async ({ place }) => {
Expand Down