Class AguiToolConverter

java.lang.Object
io.agentscope.core.agui.converter.AguiToolConverter

public class AguiToolConverter extends Object
Converter between AG-UI tools and AgentScope tool schemas.

This class handles the bidirectional conversion between the AG-UI protocol's tool format and AgentScope's internal ToolSchema format.

  • Constructor Details

    • AguiToolConverter

      public AguiToolConverter()
  • Method Details

    • toToolSchema

      public io.agentscope.core.model.ToolSchema toToolSchema(AguiTool aguiTool)
      Convert an AG-UI tool to an AgentScope ToolSchema.
      Parameters:
      aguiTool - The AG-UI tool to convert
      Returns:
      The converted ToolSchema
    • toAguiTool

      public AguiTool toAguiTool(io.agentscope.core.model.ToolSchema schema)
      Convert an AgentScope ToolSchema to an AG-UI tool.
      Parameters:
      schema - The AgentScope ToolSchema to convert
      Returns:
      The converted AG-UI tool
    • toToolSchemaList

      public List<io.agentscope.core.model.ToolSchema> toToolSchemaList(List<AguiTool> aguiTools)
      Convert a list of AG-UI tools to AgentScope ToolSchemas.
      Parameters:
      aguiTools - The AG-UI tools to convert
      Returns:
      The converted ToolSchemas
    • toAguiToolList

      public List<AguiTool> toAguiToolList(List<io.agentscope.core.model.ToolSchema> schemas)
      Convert a list of AgentScope ToolSchemas to AG-UI tools.
      Parameters:
      schemas - The AgentScope ToolSchemas to convert
      Returns:
      The converted AG-UI tools