Overview
TheAgentsClient defines methods to call agents, ask questions, list available toolkits, list available agents, and invoke specific tools. It uses an underlying RoomClient to send requests.
-
AgentsClient: The main client class for interacting with agents. It handles:
- Calling agents
- Asking questions to agents
- Listing available toolkits
- Listing available agents
- Invoking specific tools
- AgentDescription: Describes an agent, its input/output schemas, requirements, labels, etc.
- ToolDescription: Describes an individual tool, including metadata and input schemas.
- ToolkitDescription: Groups multiple tools under one toolkit name, allowing retrieval of individual tools by name.
- ToolkitConfiguration: Describes which tools in a toolkit you want to enable or use.
API Methods
1. Call
- Description:
- Allows you to send a request to an agent to perform a specific action or function.
- Parameters:
name: The name of the agent you want to call.url: The URL endpoint or route on the agent side that you want to call.arguments: A record of arguments (payload) that you want to send to the agent.
- Returns:
Responseobject (likely aJsonResponse), containing the output or result from the agent.
2. Ask
- Description:
- Sends a question or prompt to the specified agent. You can optionally provide an array of
RequiredToolkitobjects indicating which toolkits (and which tools within them) are available for this agent to use. - The
askmethod allows you to send a question or prompt to an agent, specifying the agent’s name, any toolkits you want to enable, and the arguments you want to pass. - This is useful for getting responses from agents that can process natural language or perform specific tasks.
- Sends a question or prompt to the specified agent. You can optionally provide an array of
- Parameters:
agent: The name/identifier of the agent you want to ask.requires: An optional array ofRequiredToolkitobjects that specify which toolkits are allowed for this ask.arguments: A record of arguments (payload) that you want to send to the agent.
- Returns:
Responseobject (likely aJsonResponse), containing the output or result from the agent.
3. List Toolkits
- Description:
- Retrieves a list of all available toolkits and parses each one into a
ToolkitDescription. - This is useful for discovering which toolkits are available for use and what tools they contain.
- Retrieves a list of all available toolkits and parses each one into a
- Parameters: None
- Returns An array of
ToolkitDescriptionobjects.
4. List Agents
- Description:
- Lists the agents currently available. Each is converted into an
AgentDescriptionobject. - This is useful for discovering which agents are available for use and what their capabilities are.
- Lists the agents currently available. Each is converted into an
- Parameters: None
- Returns An array of
AgentDescriptionobjects.
5. Invoke Tool
- Description:
- Invokes a specific tool within a toolkit in a given toolkit with the provided arguments.
- This is useful for directly interacting with tools without going through an agent.
- Parameters:
toolkit: The name of the toolkit that contains the tool you want to invoke.tool: The name of the specific tool you want to invoke.arguments: A record of arguments (payload) that you want to send to the tool. ReturnsResponseobject (likely aJsonResponse), containing the output or result from the invoked tool.
Typical Workflow
-
Instantiate
RoomClientNodeJs -
List Available Agents and Toolkits
NodeJs
-
Ask a Question to an Agent
NodeJs
-
Invoke a Specific Tool (If needed)
NodeJs
-
Call an Agent Directly (If the agent supports such calls)
NodeJs
AgentDescription
Represents an agent’s descriptive information, including schemas for input/output data and any special requirements the agent may have (for instance, a required toolkit or schema).- Python
- Dart
- TypeScript
- .NET
name: The agent nametitle: The agent title.description: Detailed description of the agent’s behavior or purpose.input_schema: JSON schema describing the input format the agent expects.output_schema(optional): JSON schema describing the agent’s output format.requires(optional): A list ofRequirementobjects (e.g.,RequiredToolkit,RequiredSchema).supports_toolsIndicates whether the agent can use external tools.labels(optional): Tags associated with the agent.
ToolDescription
Represents metadata and input requirements for an individual tool. Tools can exist independently or be grouped in aToolkitDescription.
- Python
- Dart
- TypeScript
- .NET
nameThe tool’s name.title: The tool’s title.description: The tool’s description.input_schema: JSON Schema describing the payload expected when invoking the tool.thumbnail_url(optional): URL for an icon or thumbnail.defs(optional): Additional JSON Schema definitions referenced byinputSchema.pricing(optional): Pricing metadata, if the tool carries usage costs.supports_context(optional; defaults toFalse): Indicates whether the tool can consume conversational context automatically.
ToolkitDescription
Groups multiple tools under a single toolkit. Allows easy retrieval of tools by name and provides a common structure for describing a set of tools.- Python
- Dart
- TypeScript
- .NET
name: The toolkit’s name.title: Display title for the toolkit.description: The toolkit’s description.tools: A list ofToolDescription.thumbnail_url(optional): Thumbnail image URL when provided.
ToolkitConfiguration
Specifies how a particular toolkit should be used. It can indicate whether to use all tools or only specific ones within the toolkit.Conclusion
TheAgentsClient module provides a flexible, high-level API for managing and interacting with agents and toolkits in a distributed or plugin-based environment. Use AgentsClient for routine operations—listing agents and toolkits, invoking tools, or asking questions—and rely on the description classes (AgentDescription, ToolDescription, and ToolkitDescription) to manage the metadata and validation for those resources.
For more details on the underlying request/response flow, refer to your implementation of RoomClient, Response, and JsonResponse.