Agent Factory Request Context (factory/utils.py)

agno · libs/agno/agno/factory/utils.py · python · Apache-2.0
ai, lang:python, tag:factory, tag:exceptions, tag:context

Provides context data structures and custom exceptions for managing dynamic agent factories. Reuse for authorization and input validation in AI systems.

# Source: https://github.com/CopilotKit/agno | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""Request context and exceptions for factory invocations."""

from dataclasses import dataclass, field
from typing import Any, Dict, Mapping, Optional, Union

from pydantic import BaseModel

# ---------------------------------------------------------------------------
# Exceptions
# ---------------------------------------------------------------------------


class FactoryError(Exception):
    """Base exception for factory errors. Maps to HTTP 500."""

    pass


class FactoryValidationError(FactoryError):
    """factory_input failed validation against input_schema. Maps to HTTP 400."""

 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key