批注接口的使用
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) Tool function for agent to record important information to long-term memory.reactor.core.publisher.Mono<String> LongTermMemoryTools.retrieveFromMemory(List<String> keywords) Tool function for agent to retrieve information from long-term memory. -
io.agentscope.core.plan中Tool的使用
批注类型为Tool的io.agentscope.core.plan中的方法修饰符和类型方法说明reactor.core.publisher.Mono<String> PlanNotebook.createPlan(String name, String description, String expectedOutcome, List<Map<String, Object>> subtasks) Create a plan by given name and sub-tasks.reactor.core.publisher.Mono<String> PlanNotebook.finishPlan(String stateStr, String outcome) Finish the current plan by given outcome, or abandon it.reactor.core.publisher.Mono<String> PlanNotebook.finishSubtask(int subtaskIdx, String outcome) Label the subtask as done by given index and outcome.reactor.core.publisher.Mono<String> PlanNotebook.getSubtaskCount()Get the number of subtasks in the current plan.reactor.core.publisher.Mono<String> PlanNotebook.recoverHistoricalPlan(String planId) Recover a historical plan by given plan ID.reactor.core.publisher.Mono<String> PlanNotebook.reviseCurrentPlan(int subtaskIdx, String action, Map<String, Object> subtaskMap) Revise the current plan by adding, revising or deleting a sub-task.reactor.core.publisher.Mono<String> PlanNotebook.updatePlanInfo(String name, String description, String expectedOutcome) Update the current plan's name, description, or expected outcome.reactor.core.publisher.Mono<String> PlanNotebook.updateSubtaskState(int subtaskIdx, String stateStr) Update the state of a subtask by given index and state.reactor.core.publisher.Mono<String> PlanNotebook.viewHistoricalPlans()View the historical plans.reactor.core.publisher.Mono<String> PlanNotebook.viewSubtasks(List<Integer> indexes) View the details of the sub-tasks by given indexes. -
io.agentscope.core.rag中Tool的使用
批注类型为Tool的io.agentscope.core.rag中的方法修饰符和类型方法说明KnowledgeRetrievalTools.retrieveKnowledge(String query, Integer limit, Agent agent) Retrieves relevant documents from the knowledge base. -
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.