swarmauri.core.agent_apis.IAgentCommands module

class swarmauri.core.agent_apis.IAgentCommands.IAgentCommands[source]

Bases: ABC

Interface for the API object that enables a SwarmAgent to host various API routes.

abstract async abatch(requests)[source]

Handles batched invocation requests asynchronously.

Parameters:

requests (List[Any]) – A list of incoming request payloads.

Returns:

A list of responses.

Return type:

List[Any]

abstract async ainvoke(request)[source]

Handles invocation requests asynchronously.

Parameters:

request (Any) – The incoming request payload.

Returns:

The response payload.

Return type:

Any

abstract batch(requests)[source]

Handles batched invocation requests synchronously.

Parameters:

requests (List[Any]) – A list of incoming request payloads.

Returns:

A list of responses.

Return type:

List[Any]

abstract get_schema_config()[source]

Retrieves the schema configuration for the API.

Returns:

The schema configuration.

Return type:

dict

abstract invoke(request)[source]

Handles invocation requests synchronously.

Parameters:

request (Any) – The incoming request payload.

Returns:

The response payload.

Return type:

Any

abstract stream(request)[source]

Handles streaming requests.

Parameters:

request (Any) – The incoming request payload.

Returns:

A streaming response.

Return type:

Any