Skip to main content

Class: GetWeatherTool

Defined in: src/agent/tools/GetWeatherTool.ts:16

A tool that gets the current weather for a specific location.

Extends​

Constructors​

Constructor​

new GetWeatherTool(): GetWeatherTool

Defined in: src/agent/tools/GetWeatherTool.ts:17

Returns​

GetWeatherTool

Overrides​

Tool.constructor

Properties​

behavior?​

optional behavior: "BLOCKING" | "NON_BLOCKING"

Defined in: src/agent/Tool.ts:54

Inherited from​

Tool.behavior


description?​

optional description: string

Defined in: src/agent/Tool.ts:51

Inherited from​

Tool.description


name​

name: string

Defined in: src/agent/Tool.ts:50

Inherited from​

Tool.name


onTriggered()?​

optional onTriggered: (args) => unknown

Defined in: src/agent/Tool.ts:53

Parameters​

args​

unknown

Returns​

unknown

Inherited from​

Tool.onTriggered


parameters?​

optional parameters: ToolSchema

Defined in: src/agent/Tool.ts:52

Inherited from​

Tool.parameters

Methods​

execute()​

execute(args): Promise<ToolResult<WeatherData>>

Defined in: src/agent/tools/GetWeatherTool.ts:43

Executes the tool's action.

Parameters​

args​

GetWeatherArgs

The arguments for the tool.

Returns​

Promise<ToolResult<WeatherData>>

A promise that resolves with a ToolResult containing weather information.

Overrides​

Tool.execute


toJSON()​

toJSON(): FunctionDeclaration

Defined in: src/agent/Tool.ts:98

Returns a JSON representation of the tool.

Returns​

FunctionDeclaration

A valid FunctionDeclaration object.

Inherited from​

Tool.toJSON