Tool

interface Tool

该接口表示一个工具,包含了工具的描述信息和执行器。

通过此接口可以对工具的描述信息进行设置和获取,同时可以设置和获取工具的执行器, 用于执行工具的具体操作。

Author

M8Test, [email protected], https://m8test.com

Functions

Link copied to clipboard
abstract fun execute(argumentsBuilder: <Error class: unknown class>.() -> Unit): String

执行工具并获取结果.

Link copied to clipboard

获取工具的描述信息。

Link copied to clipboard
abstract fun setDescriptor(descriptor: ToolDescriptor.() -> Unit)

设置工具的描述信息,使用指定的配置块对描述信息进行配置。

Link copied to clipboard
abstract fun setExecutor(executor: (<Error class: unknown class>) -> String)

设置工具的执行器,该执行器接收一个 JsonObject 作为输入,并返回一个字符串结果。