Skip to content

Commit

Permalink
feat(tool): update open meteo schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas2D committed Sep 16, 2024
1 parent 8ea5136 commit 8736e21
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions src/tools/weather/openMeteo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,25 @@ export class OpenMeteoTool extends Tool<
inputSchema() {
return z
.object({
location: z
.object({
latitude: z.number(),
longitude: z.number(),
})
.strip()
.or(
z
.object({
name: z.string().min(1),
language: z.string().default("English"),
})
.strip(),
),
location: z.union([
z
.object({
name: z.string().min(1),
language: z.string().default("English"),
})
.strip(),
z
.object({
latitude: z.number(),
longitude: z.number(),
})
.strip(),
]),
start_date: z
.string()
.date()
.union([z.string().date(), z.string().datetime()])
.describe("Start date for the weather forecast in the format YYYY-MM-DD (UTC)"),
end_date: z
.string()
.date()
.union([z.string().date(), z.string().datetime()])
.describe("End date for the weather forecast in the format YYYY-MM-DD (UTC)")
.optional(),
elevation: z.number().nullish(),
Expand Down

0 comments on commit 8736e21

Please sign in to comment.