批注接口的使用
io.agentscope.core.tool.Tool
使用Tool的程序包
程序包
说明
-
io.agentscope.core.memory中Tool的使用
批注类型为Tool的io.agentscope.core.memory中的方法修饰符和类型方法说明reactor.core.publisher.Mono<String> LongTermMemoryTools.recordToMemory(String thinking, List<String> content) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Tool function for agent to record important information to long-term memory.reactor.core.publisher.Mono<String> LongTermMemoryTools.retrieveFromMemory(List<String> keywords) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Tool function for agent to retrieve information from long-term memory. -
io.agentscope.core.rag中Tool的使用
批注类型为Tool的io.agentscope.core.rag中的方法修饰符和类型方法说明KnowledgeRetrievalTools.retrieveKnowledge(String query, Integer limit, Agent agent, RuntimeContext ctx) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Retrieves relevant documents from the knowledge base. -
io.agentscope.core.tool.builtin中Tool的使用
批注类型为Tool的io.agentscope.core.tool.builtin中的方法修饰符和类型方法说明TodoTools.todoWrite(List<TodoTools.TodoItem> todos, AgentState state) Replaces the session task list withtodos. -
io.agentscope.core.tool.file中Tool的使用
批注类型为Tool的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.multimodal中Tool的使用
批注类型为Tool的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.