> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Condition Protocol • AI Agent SDK

> ConditionProtocol: Minimal Protocol for condition implementations.

# ConditionProtocol

> Defined in the [**protocols**](../modules/protocols) module.

<Badge color="blue">AI Agent</Badge>

Minimal Protocol for condition implementations.

This defines the essential interface that any condition must provide.
It enables unified condition evaluation across AgentFlow (string-based)
and AgentTeam (dict-based) systems.

## Methods

<CardGroup cols={2}>
  <Card title="evaluate()" icon="function" href="../functions/ConditionProtocol-evaluate">
    Evaluate the condition against the given context.
  </Card>
</CardGroup>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Create a custom condition
    class ScoreCondition:
        def __init__(self, threshold: int):
            self.threshold = threshold
        
        def evaluate(self, context: Dict[str, Any]) -> bool:
            return context.get("score", 0) > self.threshold
    
    # Use in workflows
    cond: ConditionProtocol = ScoreCondition(80)
    result = cond.evaluate({"score": 90})  # True
```

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/conditions/protocols.py#L17">
  `praisonaiagents/conditions/protocols.py` at line 17
</Card>
