Package-level declarations
Types
Represents a simplified tool base class that processes specific arguments and produces a textual result.
Base class representing a tool that can be invoked by the LLM. Tools are usually used to return results, make changes to the environment, or perform other actions.
Represents a descriptor for a tool that contains information about the tool's name, description, required parameters, and optional parameters.
A base sealed class representing exceptions specific to tools. This class provides a structure for exceptions with a custom message.
Represents a descriptor for a tool parameter. A tool parameter descriptor contains information about a specific tool parameter, such as its name, description, data type, and default value.
Sealed class representing different types of tool parameters.
A registry that manages a collection of tools for use by agents.
Represents a result produced by a tool operation. This is a marker interface implemented by various result types.
Functions
Converts a SerialDescriptor into a ToolDescriptor with metadata about a tool, including its name, description, and parameters.
Provides a custom serializer for tools, wrapping and unwrapping values that do not serialize into JsonObject into a custom JsonObject with value key. This wrapping/unwrapping is needed because for LLM APIs tool arguments must always be JsonObject.
Throws a ToolException.ValidationFailure exception with the specified error message.
Validates a given condition and throws a ToolException.ValidationFailure exception if the condition is not met.
Validates that the provided value is not null. If the value is null, a ToolException.ValidationFailure exception is thrown with the provided error message.