ToolDescriptor

open class ToolDescriptor(val name: String, val description: String, val requiredParameters: List<ToolParameterDescriptor> = emptyList(), val optionalParameters: List<ToolParameterDescriptor> = emptyList(), val cacheControl: CacheControl? = null)(source)

Represents a descriptor for a tool that contains information about the tool's name, description, required parameters, and optional parameters.

This class is annotated with @Serializable to support serialization/deserialization using kotlinx.serialization.

Constructors

Link copied to clipboard
constructor(name: String, description: String, requiredParameters: List<ToolParameterDescriptor> = emptyList(), optionalParameters: List<ToolParameterDescriptor> = emptyList(), cacheControl: CacheControl? = null)

Properties

Link copied to clipboard

Optional cache control to apply after this tool definition.

Link copied to clipboard

The description of the tool.

Link copied to clipboard

The name of the tool.

Link copied to clipboard

A list of ToolParameterDescriptor representing the optional parameters for the tool.

Link copied to clipboard

A list of ToolParameterDescriptor representing the required parameters for the tool.

Functions

Link copied to clipboard
fun copy(name: String = this.name, description: String = this.description, requiredParameters: List<ToolParameterDescriptor> = this.requiredParameters.toList(), optionalParameters: List<ToolParameterDescriptor> = this.optionalParameters.toList(), cacheControl: CacheControl? = this.cacheControl): ToolDescriptor

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

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Returns a copy of this tool descriptor with cache control enabled.