copy

fun copy(name: String = this.name, description: String = this.description, requiredParameters: List<ToolParameterDescriptor> = this.requiredParameters.toList(), optionalParameters: List<ToolParameterDescriptor> = this.optionalParameters.toList()): ToolDescriptor(source)

Creates a copy of the current ToolDescriptor with the option to modify specific attributes.

Return

A new instance of ToolDescriptor with the updated attributes.

Parameters

name

The name of the tool. Defaults to the current tool's name if not provided.

description

The description of the tool. Defaults to the current tool's description if not provided.

requiredParameters

A list of ToolParameterDescriptor representing the required parameters for the tool. Defaults to the current required parameters if not provided.

optionalParameters

A list of ToolParameterDescriptor representing the optional parameters for the tool. Defaults to the current optional parameters if not provided.