类的使用
io.agentscope.core.message.ToolResultBlock
使用ToolResultBlock的程序包
程序包
说明
-
io.agentscope.core.hook中ToolResultBlock的使用
修饰符和类型方法说明ActingChunkEvent.getChunk()Get the streaming chunk from ToolEmitter.PostActingEvent.getToolResult()Get the tool execution result.参数类型为ToolResultBlock的io.agentscope.core.hook中的方法修饰符和类型方法说明voidPostActingEvent.setToolResult(ToolResultBlock toolResult) Modify the tool execution result.参数类型为ToolResultBlock的io.agentscope.core.hook中的构造器限定符构造器说明ActingChunkEvent(Agent agent, Toolkit toolkit, ToolUseBlock toolUse, ToolResultBlock chunk) Constructor for ActingChunkEvent.PostActingEvent(Agent agent, Toolkit toolkit, ToolUseBlock toolUse, ToolResultBlock toolResult) Constructor for PostActingEvent. -
io.agentscope.core.message中ToolResultBlock的使用
修饰符和类型方法说明ToolResultBlock.Builder.build()Builds a new ToolResultBlock with the configured properties.static ToolResultBlockCreate an error result (for tool method return values).static ToolResultBlockToolResultBlock.of(ContentBlock output) Create a result with output only (for tool method return values).static ToolResultBlockToolResultBlock.of(ContentBlock output, Map<String, Object> metadata) Create a result with output and metadata (for tool method return values).static ToolResultBlockToolResultBlock.of(String id, String name, ContentBlock output) Create a result with id, name, and output (for message ContentBlock).static ToolResultBlockCreate a result with all fields (for message ContentBlock with metadata).static ToolResultBlockToolResultBlock.of(String id, String name, List<ContentBlock> output) Create a result with id, name, and output list (for message ContentBlock).static ToolResultBlockCreate a result with all fields including output list (for message ContentBlock with metadata).static ToolResultBlockToolResultBlock.of(List<ContentBlock> output) Create a result with output list only (for tool method return values).static ToolResultBlockCreate a result with output list and metadata (for tool method return values).static ToolResultBlockToolResultBlock.suspended(ToolUseBlock toolUse) Creates a suspended tool result with default message.static ToolResultBlockToolResultBlock.suspended(ToolUseBlock toolUse, ToolSuspendException exception) Creates a suspended tool result from a ToolSuspendException.static ToolResultBlockCreate a simple text result (for tool method return values).ToolResultBlock.withIdAndName(String id, String name) Create a ToolResultBlock for use in messages by setting id and name. -
io.agentscope.core.tool中ToolResultBlock的使用
修饰符和类型方法说明Convert tool call result to ToolResultBlock.protected ToolResultBlockDefaultToolResultConverter.handleNull()Handle null result.protected ToolResultBlockDefaultToolResultConverter.handleVoid()Handle void return type.protected ToolResultBlockSerialize result to JSON string with schema.返回变量类型为ToolResultBlock的类型的io.agentscope.core.tool中的方法修饰符和类型方法说明reactor.core.publisher.Mono<ToolResultBlock> AgentTool.callAsync(ToolCallParam param) Execute the tool with the given parameters (asynchronous).reactor.core.publisher.Mono<ToolResultBlock> SchemaOnlyTool.callAsync(ToolCallParam param) Throws a ToolSuspendException to signal that this tool requires external execution.reactor.core.publisher.Mono<ToolResultBlock> Toolkit.callTool(ToolCallParam param) Execute a tool with the given parameters.reactor.core.publisher.Mono<List<ToolResultBlock>> Toolkit.callTools(List<ToolUseBlock> toolCalls, ExecutionConfig agentExecutionConfig, Agent agent, ToolExecutionContext agentContext) Execute multiple tools asynchronously with agent-level context (internal use by ReActAgent).参数类型为ToolResultBlock的io.agentscope.core.tool中的方法修饰符和类型方法说明static MsgToolResultMessageBuilder.buildToolResultMsg(ToolResultBlock result, ToolUseBlock originalCall, String agentName) Build a tool result message from a ToolResultBlock and the original tool call.voidNoOpToolEmitter.emit(ToolResultBlock chunk) Silently discards the emitted chunk without performing any action.voidToolEmitter.emit(ToolResultBlock chunk) Emit a streaming response chunk during tool execution.类型变量类型为ToolResultBlock的io.agentscope.core.tool中的方法参数修饰符和类型方法说明voidToolkit.setChunkCallback(BiConsumer<ToolUseBlock, ToolResultBlock> callback) Set the chunk callback for streaming tool responses.voidToolkit.setInternalChunkCallback(BiConsumer<ToolUseBlock, ToolResultBlock> callback) Set the framework-internal chunk callback for streaming tool responses. -
io.agentscope.core.tool.coding中ToolResultBlock的使用
返回变量类型为ToolResultBlock的类型的io.agentscope.core.tool.coding中的方法修饰符和类型方法说明reactor.core.publisher.Mono<ToolResultBlock> ShellCommandTool.callAsync(ToolCallParam param) reactor.core.publisher.Mono<ToolResultBlock> ShellCommandTool.executeShellCommand(String command, Integer timeout) Execute a shell command and return the return code, standard output, and standard error within tags.reactor.core.publisher.Mono<ToolResultBlock> ShellCommandTool.executeShellCommand(String command, Integer timeout, Charset overrideCharset) Execute a shell command and return the return code, standard output, and standard error within tags. -
io.agentscope.core.tool.file中ToolResultBlock的使用
返回变量类型为ToolResultBlock的类型的io.agentscope.core.tool.file中的方法修饰符和类型方法说明reactor.core.publisher.Mono<ToolResultBlock> WriteFileTool.insertTextFile(String filePath, String content, Integer lineNumber) Insert content at the specified line number in a text file.reactor.core.publisher.Mono<ToolResultBlock> ReadFileTool.listDirectory(String dirPath) List files and directories in the specified directory.reactor.core.publisher.Mono<ToolResultBlock> ReadFileTool.viewTextFile(String filePath, String ranges) View the file content in the specified range with line numbers.reactor.core.publisher.Mono<ToolResultBlock> WriteFileTool.writeTextFile(String filePath, String content, String ranges) Create/Replace/Overwrite content in a text file. -
io.agentscope.core.tool.mcp中ToolResultBlock的使用
修饰符和类型方法说明static ToolResultBlockMcpContentConverter.convertCallToolResult(io.modelcontextprotocol.spec.McpSchema.CallToolResult mcpResult) Converts an MCP CallToolResult to an AgentScope ToolResultBlock.返回变量类型为ToolResultBlock的类型的io.agentscope.core.tool.mcp中的方法修饰符和类型方法说明reactor.core.publisher.Mono<ToolResultBlock> McpTool.callAsync(ToolCallParam param) Executes this MCP tool asynchronously with the given parameters. -
io.agentscope.core.tool.multimodal中ToolResultBlock的使用
返回变量类型为ToolResultBlock的类型的io.agentscope.core.tool.multimodal中的方法修饰符和类型方法说明reactor.core.publisher.Mono<ToolResultBlock> DashScopeMultiModalTool.dashscopeAudioToText(String audioUrl, String model, Integer sampleRate) Convert the given audio to text.reactor.core.publisher.Mono<ToolResultBlock> DashScopeMultiModalTool.dashscopeFirstAndLastFrameImageToVideo(String prompt, String model, String firstFrameUrl, String lastFrameUrl, String negativePrompt, String template, String resolution, Boolean promptExtend, Boolean watermark, Integer seed) Generate video transitioning from a first frame to a last frame and an optional text prompt.reactor.core.publisher.Mono<ToolResultBlock> DashScopeMultiModalTool.dashscopeImageToText(List<String> imageUrls, String prompt, String model) Generate text based on the given images.reactor.core.publisher.Mono<ToolResultBlock> DashScopeMultiModalTool.dashscopeImageToVideo(String prompt, String model, String imageUrl, String audioUrl, String negativePrompt, String template, String resolution, Integer duration, String shotType, Boolean audio, Boolean promptExtend, Boolean watermark, Integer seed) Generate a video based on a single input image (first frame) and an optional text prompt.reactor.core.publisher.Mono<ToolResultBlock> DashScopeMultiModalTool.dashscopeTextToAudio(String text, String model, String voice, String language, Integer sampleRate) Convert the given text to audio.reactor.core.publisher.Mono<ToolResultBlock> DashScopeMultiModalTool.dashscopeTextToImage(String prompt, String model, Integer n, String size, Boolean useBase64) Generate image(s) based on the given prompt, and return image url(s) or base64 data.reactor.core.publisher.Mono<ToolResultBlock> DashScopeMultiModalTool.dashscopeTextToVideo(String prompt, String model, String negativePrompt, String audioUrl, String size, Integer duration, String shotType, Boolean promptExtend, Boolean watermark, Integer seed) Generate video based on the given prompt.reactor.core.publisher.Mono<ToolResultBlock> DashScopeMultiModalTool.dashscopeVideoToText(String videoUrl, String prompt, String model, Double fps) Analyze video and generate a text description or answer questions based on the video content.reactor.core.publisher.Mono<ToolResultBlock> OpenAIMultiModalTool.openaiAudioToText(String audioUrl, String model, String language, String prompt, String responseFormat, Double temperature) Convert audio to text (transcription) using OpenAI Whisper models.reactor.core.publisher.Mono<ToolResultBlock> OpenAIMultiModalTool.openaiImageToText(String imageUrls, String prompt, String model, Integer maxTokens) Convert image(s) to text using vision models.reactor.core.publisher.Mono<ToolResultBlock> OpenAIMultiModalTool.openaiTextToAudio(String text, String model, String voice, String responseFormat, Double speed) Convert text to audio (speech) using OpenAI TTS models.reactor.core.publisher.Mono<ToolResultBlock> OpenAIMultiModalTool.openaiTextToImage(String prompt, String model, Integer n, String size, String quality, String responseFormat) Generate image(s) based on the given prompt. -
io.agentscope.core.tool.subagent中ToolResultBlock的使用
返回变量类型为ToolResultBlock的类型的io.agentscope.core.tool.subagent中的方法修饰符和类型方法说明reactor.core.publisher.Mono<ToolResultBlock> SubAgentTool.callAsync(ToolCallParam param) -
io.agentscope.core.tracing中ToolResultBlock的使用
返回变量类型为ToolResultBlock的类型的io.agentscope.core.tracing中的方法修饰符和类型方法说明default reactor.core.publisher.Mono<ToolResultBlock> Tracer.callTool(Toolkit toolkit, ToolCallParam toolCallParam, Supplier<reactor.core.publisher.Mono<ToolResultBlock>> toolKitCall) 类型变量类型为ToolResultBlock的io.agentscope.core.tracing中的方法参数修饰符和类型方法说明default reactor.core.publisher.Mono<ToolResultBlock> Tracer.callTool(Toolkit toolkit, ToolCallParam toolCallParam, Supplier<reactor.core.publisher.Mono<ToolResultBlock>> toolKitCall)