Ready

constructor(result: JsonElement, request: (reason: String) -> ToolPresentation, executing: () -> ToolPresentation, cancelled: () -> ToolPresentation, rejected: (reason: String?) -> ToolPresentation, failed: (e: Throwable) -> ToolPresentation, timeout: (elapsed: Duration) -> ToolPresentation)(source)

Parameters

result

建议反序列化自数据类,数据格式可以自由决定。

request

用于请求用户审批的 i18n 消息,格式应如 '请求读取 README.md($reason)',中文文案应以 '请求' 开头。

executing

用于工具执行过程中为用户显示的状态信息,应类似 '正在读取 README.md',中文文案应以 '正在' 开头。

cancelled

如果工具被取消,为用户显示的消息,例如 '读取 README.md 被取消'。

rejected

如果工具被拒绝,为用户显示的消息,例如 '读取 README.md 被拒绝',或 '读取 README.md 被拒绝:$reason'。

failed

如果工具执行中抛出异常,为用户显示的消息,例如 '读取 README.md 失败:${e.message()}'。

timeout

如果工具执行超时,为用户显示的消息,例如 '读取 README.md 超时:$elapsed'