fabricatio_agent.capabilities.agent

Agent capability implementation.

Classes

Agent

Main agent class that integrates multiple capabilities to fulfill requests.

Module Contents

class fabricatio_agent.capabilities.agent.Agent(/, **data: Any)

Bases: fabricatio_checkpoint.capabilities.checkpoint.Checkpoint, fabricatio_capable.capabilities.capable.Capable, fabricatio_team.capabilities.digest.CooperativeDigest, fabricatio_memory.capabilities.remember.Remember, fabricatio_rule.capabilities.censor.Censor, fabricatio_judge.capabilities.advanced_judge.EvidentlyJudge, fabricatio_capabilities.capabilities.task.DispatchTask, fabricatio_diff.capabilities.diff_edit.DiffEdit, fabricatio_question.capabilities.questioning.Questioning, fabricatio_thinking.capabilities.thinking.Thinking, fabricatio_tool.capabilities.handle.Handle, abc.ABC

Main agent class that integrates multiple capabilities to fulfill requests.

This class combines various capabilities like memory, thinking, task dispatching, and team cooperation to process and fulfill user requests.

async fulfill(request: str, sequential_thinking: bool | None = None, check_capable: bool = False, memory: bool = False, top_k: int = 100, boost_recent: bool = True, **kwargs: Unpack[fabricatio_core.models.kwargs_types.LLMKwargs]) None | List[Any]

Process and fulfill a request using various agent capabilities.

Parameters:
  • request (str) – The request to be fulfilled.

  • sequential_thinking (Optional[bool], optional) – Whether to use sequential thinking. Defaults to None.

  • check_capable (bool, optional) – Whether to check agent capabilities before processing. Defaults to False.

  • memory (bool, optional) – Whether to use memory in processing. Defaults to False.

  • top_k (int, optional) – Number of top memories to recall. Defaults to 100.

  • boost_recent (bool, optional) – Whether to boost recent memories. Defaults to True.

  • **kwargs (Unpack[LLMKwargs]) – Additional keyword arguments for generation.

Returns:

None if not capable, otherwise a list of execution results.

Return type:

None | List[Any]

Note

The method integrates multiple capabilities:

  • Checks capabilities if required

  • Recalls memories if enabled

  • Performs sequential thinking if enabled

  • Digests the request into tasks

  • Executes the generated task list