Skip to main content

Class: GetWeatherTool

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

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

Extends

Constructors

Constructor

new GetWeatherTool(): GetWeatherTool

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

Returns

GetWeatherTool

Overrides

Tool.constructor

Properties

description?

optional description: string

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

Inherited from

Tool.description


name

name: string

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

Inherited from

Tool.name


onTriggered()?

optional onTriggered: (args) => unknown

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

Parameters

args

unknown

Returns

unknown

Inherited from

Tool.onTriggered


parameters?

optional parameters: ToolSchema

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

Inherited from

Tool.parameters

Methods

execute()

execute(args): Promise<GetWeatherToolResults>

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

Executes the tool's action.

Parameters

args

GetWeatherArgs

The arguments for the tool.

Returns

Promise<GetWeatherToolResults>

A promise that resolves with the weather information.

Overrides

Tool.execute


toJSON()

toJSON(): FunctionDeclaration

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

Returns a JSON representation of the tool.

Returns

FunctionDeclaration

A valid FunctionDeclaration object.

Inherited from

Tool.toJSON