or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

agent.mdagentos.mdeval.mdexceptions.mdguardrails.mdindex.mdknowledge.mdmedia.mdmemory.mdmodels.mdsessions.mdstorage.mdteam.mdtools.mdworkflow.md
tile.json

exceptions.mddocs/

Exceptions API

Exception handling for agent runs, model errors, and validation.

Exception Types

from agno.exceptions import (
    AgnoError,
    AgentRunException,
    RetryAgentRun,
    StopAgentRun,
    RunCancelledException,
    ModelAuthenticationError,
    ModelProviderError,
    ModelRateLimitError,
    InputCheckError,
    OutputCheckError,
    EvalError,
    CheckTrigger
)

class AgnoError(Exception):
    """Base exception for all Agno errors"""
    def __init__(self, message: Optional[str] = None, **kwargs): ...

class AgentRunException(Exception):
    """Exception during agent run (does not inherit from AgnoError)"""
    def __init__(self, message: Optional[str] = None, **kwargs): ...

class RetryAgentRun(AgnoError):
    """Retry the agent run"""
    def __init__(self, message: Optional[str] = None, **kwargs): ...

class StopAgentRun(AgnoError):
    """Stop the agent run"""
    def __init__(self, message: Optional[str] = None, **kwargs): ...

class RunCancelledException(AgnoError):
    """Run was cancelled"""
    def __init__(self, message: Optional[str] = None, **kwargs): ...

class ModelAuthenticationError(AgnoError):
    """Model authentication failed"""
    def __init__(self, message: Optional[str] = None, **kwargs): ...

class ModelProviderError(AgnoError):
    """Model provider error"""
    def __init__(self, message: Optional[str] = None, **kwargs): ...

class ModelRateLimitError(AgnoError):
    """Model rate limit exceeded"""
    def __init__(self, message: Optional[str] = None, **kwargs): ...

class InputCheckError(AgnoError):
    """Input validation failed"""
    def __init__(
        self,
        message: Optional[str] = None,
        trigger: Optional[CheckTrigger] = None,
        **kwargs
    ): ...

class OutputCheckError(AgnoError):
    """Output validation failed"""
    def __init__(
        self,
        message: Optional[str] = None,
        trigger: Optional[CheckTrigger] = None,
        **kwargs
    ): ...

class EvalError(AgnoError):
    """Evaluation error"""
    def __init__(self, message: Optional[str] = None, **kwargs): ...

class CheckTrigger(str, Enum):
    """Enum for when a check is triggered"""
    input = "input"
    output = "output"

Usage Examples

Retrying Runs

from agno.exceptions import RetryAgentRun

try:
    response = agent.run("Query")
except RetryAgentRun:
    # Retry logic
    response = agent.run("Query")

Cancelling Runs

from agno.agent import Agent

# Start long-running task
response = agent.run("Complex task", stream=True)

# Cancel if needed
Agent.cancel_run(response.run_id)