Skip to content

Class swarmauri_core.agents.IAgent.IAgent

swarmauri_core.agents.IAgent.IAgent

Bases: ABC

exec abstractmethod

exec(input_data, llm_kwargs)

Executive method that triggers the agent's action based on the input data.

Source code in swarmauri_core/agents/IAgent.py
 7
 8
 9
10
11
12
@abstractmethod
def exec(self, input_data: Optional[Any], llm_kwargs: Optional[Dict]) -> Any:
    """
    Executive method that triggers the agent's action based on the input data.
    """
    pass

aexec abstractmethod async

aexec(input_str='', llm_kwargs=None)

Async executive method that triggers the agent's action based on the input data.

Source code in swarmauri_core/agents/IAgent.py
14
15
16
17
18
19
20
21
22
23
@abstractmethod
async def aexec(
    self,
    input_str: Optional[Union[str, IMessage]] = "",
    llm_kwargs: Optional[Dict] = None,
) -> Any:
    """
    Async executive method that triggers the agent's action based on the input data.
    """
    pass

batch abstractmethod

batch(inputs, llm_kwargs=None)

Default batch implementation: calls exec on each input in inputs. Subclasses can override for optimized bulk behavior.

Source code in swarmauri_core/agents/IAgent.py
25
26
27
28
29
30
31
32
33
34
35
@abstractmethod
def batch(
    self,
    inputs: List[Union[str, IMessage]],
    llm_kwargs: Optional[Dict] = None,
) -> List[Any]:
    """
    Default batch implementation: calls `exec` on each input in `inputs`.
    Subclasses can override for optimized bulk behavior.
    """
    pass

abatch abstractmethod async

abatch(inputs, llm_kwargs=None)

Default async batch implementation: concurrently calls aexec on all inputs. Subclasses can override for more efficient implementations.

Source code in swarmauri_core/agents/IAgent.py
37
38
39
40
41
42
43
44
45
46
47
@abstractmethod
async def abatch(
    self,
    inputs: List[Union[str, IMessage]],
    llm_kwargs: Optional[Dict] = None,
) -> List[Any]:
    """
    Default async batch implementation: concurrently calls `aexec` on all inputs.
    Subclasses can override for more efficient implementations.
    """
    pass