import { JSONToolOutput, Tool, BaseToolOptions, BaseToolRunOptions, ToolEmitter, ToolInput } from '../base.js'; import { z } from 'zod'; import { RunContext } from '../../context.js'; import 'ajv'; import '../../errors.js'; import '../../internals/types.js'; import '../../internals/helpers/guards.js'; import '../../internals/serializable.js'; import 'promise-based-task'; import '../../cache/base.js'; import '../../internals/helpers/schema.js'; import 'zod-to-json-schema'; import '../../emitter-l0W9gC1A.js'; import '../../internals/helpers/promise.js'; /** * Copyright 2025 IBM Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ interface ResponseFilter { excludedKeys: (keyof OpenMeteoToolResponse)[]; } interface ToolOptions extends BaseToolOptions { apiKey?: string; responseFilter?: ResponseFilter; } type ToolRunOptions = BaseToolRunOptions; interface LocationSearch { name: string; country?: string; language?: string; } interface OpenMeteoToolResponse { latitude?: number; longitude?: number; generationtime_ms?: number; utc_offset_seconds?: number; timezone?: string; timezone_abbreviation?: string; elevation?: number; current_units?: Record; current?: Record; hourly_units?: Record; hourly?: Record; daily_units?: Record; daily?: Record; } declare class OpenMeteoToolOutput extends JSONToolOutput { } declare class OpenMeteoTool extends Tool { name: string; description: string; inputSchema(): z.ZodObject<{ location: z.ZodUnion<[z.ZodObject<{ name: z.ZodString; country: z.ZodOptional; language: z.ZodDefault; }, "strip", z.ZodTypeAny, { name: string; language: string; country?: string | undefined; }, { name: string; country?: string | undefined; language?: string | undefined; }>, z.ZodObject<{ latitude: z.ZodNumber; longitude: z.ZodNumber; }, "strip", z.ZodTypeAny, { latitude: number; longitude: number; }, { latitude: number; longitude: number; }>]>; start_date: z.ZodString; end_date: z.ZodOptional; temperature_unit: z.ZodDefault>; }, "strip", z.ZodTypeAny, { location: { name: string; language: string; country?: string | undefined; } | { latitude: number; longitude: number; }; start_date: string; temperature_unit: "celsius" | "fahrenheit"; end_date?: string | undefined; }, { location: { name: string; country?: string | undefined; language?: string | undefined; } | { latitude: number; longitude: number; }; start_date: string; end_date?: string | undefined; temperature_unit?: "celsius" | "fahrenheit" | undefined; }>; readonly emitter: ToolEmitter, OpenMeteoToolOutput>; constructor(options?: Partial); protected preprocessInput(rawInput: unknown): void; protected _run({ location, start_date: startDate, end_date: endDate, ...input }: ToolInput, _options: Partial, run: RunContext): Promise; protected _geocode(location: LocationSearch, signal: AbortSignal): Promise; } export { OpenMeteoTool, OpenMeteoToolOutput, type OpenMeteoToolResponse, type ResponseFilter };