AgentsClient
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.
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.Response
object (likely a JsonResponse
), containing the output or result from the agent.ToolkitConfiguration
objects indicating which toolkits (and which tools within them) are available for this agent to use.ask
method 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.agentName
: The name/identifier of the agent you want to ask.toolkits?
: An optional array of ToolkitConfiguration
objects that specify which toolkits are allowed for this ask.arguments
: A record of arguments (payload) that you want to send to the agent.answer
field from the JSON response.ToolkitDescription
.ToolkitDescription
objects.AgentDescription
object.AgentDescription
objects.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.
Returns Response
object (likely a JsonResponse
), containing the output or result from the invoked tool.RoomClient
ToolkitConfiguration
objects to specify which tools to enable.AgentDescription.fromJson
, if a requirement object cannot be identified as a RequiredToolkit
or RequiredSchema
, it throws an error. Make sure your JSON structure matches the expected shape.
name
in the agent or tool description) are missing, the constructors or static factories might produce incomplete objects. Validate these fields before usage.
ToolkitDescription.getTool
return undefined
if the tool name doesn’t match. Handle this case to avoid runtime errors.
RoomClient.sendRequest
might throw errors on network failures. Ensure you handle rejections from AgentsClient
methods (e.g., using try/catch
).
name
: The agent’s internal name.title
: A short, human-readable title for the agent.description
: Detailed description of the agent’s behavior or purpose.outputSchema?
: Optional JSON schema that describes the output format of the agent.inputSchema?
: Optional JSON schema that describes the input format expected by the agent.requires
: An array of Requirement
objects (e.g., RequiredToolkit
, RequiredSchema
) that define dependencies.labels
: A list of labels/tags associated with the agent.supportsTools
: Boolean indicating whether the agent can use external tools.ToolkitDescription
.
title
: Tool’s display-friendly name.name
: Tool’s unique name.description
: Describes what the tool does and how it might be used.inputSchema
: JSON schema describing the expected input.thumbnailUrl?
: Optional thumbnail image link.defs?
: Optional dictionary of additional definitions or metadata.title
: Toolkit’s title.name
: Toolkit’s internal name.description
: Description of the toolkit.tools
: An array of ToolDescription
items.thumbnailUrl?
: An optional thumbnail image link.AgentsClient
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
.