LanguageModelTool
A tool that can be invoked by a call to a LanguageModelChat.
Properties
Link copied to clipboard
abstract var prepareInvocation: (options: LanguageModelToolInvocationPrepareOptions<T>, token: CancellationToken) -> ProviderResult<PreparedToolInvocation>?
Called once before a tool is invoked. It's recommended to implement this to customize the progress message that appears while the tool is running, and to provide a more useful message with context from the invocation input. Can also signal that a tool needs user confirmation before running, if appropriate.
Functions
Link copied to clipboard
abstract fun invoke(options: LanguageModelToolInvocationOptions<T>, token: CancellationToken): ProviderResult<LanguageModelToolResult>
Invoke the tool with the given input and return a result.