Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

2.8 KB
Raw Blame

WorkerConf

class WorkerConf(BaseModel):

The configuration of a worker.

TaskResult

class TaskResult(BaseModel):

The result of a task.

TaskAssignment

class TaskAssignment(BaseModel):

An individual task assignment within a batch.

_split_and_strip

def _split_and_strip(dep_str: str):

Utility to split a comma separated string and strip whitespace.

validate_dependencies

def validate_dependencies(cls, v):

TaskAssignResult

class TaskAssignResult(BaseModel):

The result of task assignment for both single and batch assignments.

RecoveryStrategy

class RecoveryStrategy(str, Enum):

Strategies for handling failed tasks.

str

def __str__(self):

repr

def __repr__(self):

FailureContext

class FailureContext(BaseModel):

Context information about a task failure.

RecoveryDecision

class RecoveryDecision(BaseModel):

Decision on how to recover from a task failure.

check_if_running

def check_if_running(
    running: bool,
    max_retries: int = 3,
    retry_delay: float = 1.0,
    handle_exceptions: bool = False
):

Check if the workforce is (not) running, specified by the boolean value. Provides fault tolerance through automatic retries and exception handling.

Parameters:

  • running (bool): Expected running state (True or False).
  • max_retries (int, optional): Maximum number of retry attempts if the operation fails. Set to 0 to disable retries. (default: :obj:3)
  • retry_delay (float, optional): Delay in seconds between retry attempts. (default: :obj:1.0)
  • handle_exceptions (bool, optional): If True, catch and log exceptions instead of propagating them. (default: :obj:False)

Raises:

  • RuntimeError: If the workforce is not in the expected status and
  • Exception: Any exception raised by the decorated function if