Skip to content

Models

Pydantic models used across the REST, A2A, ACP, and MCP surfaces.

AgentCard

AgentCard

Bases: BaseModel

A2A Agent Card for discovery at /.well-known/agent.json.

The Agent Card describes an agent's capabilities, skills, and how to interact with it. It's served at a well-known URL for discovery.

Example
card = AgentCard(
    name="My Agent",
    description="A helpful assistant",
    url="https://agent.example.com",
    skills=[
        Skill(id="chat", name="Chat", description="General conversation"),
    ],
    capabilities={"streaming": True},
)

AgentManifest

AgentManifest

Bases: BaseModel

ACP Agent Manifest for discovery at /agents.

Describes essential properties of an agent including identity, capabilities, metadata, and runtime status.

Example
manifest = AgentManifest(
    name="my-agent",
    description="A helpful assistant",
    input_content_types=["text/plain", "application/json"],
    output_content_types=["text/plain"],
)

validate_dns_label classmethod

validate_dns_label(v: str) -> str

Validate name follows RFC 1123 DNS label format.

Source code in redis_agent_kit/models.py
@field_validator("name")
@classmethod
def validate_dns_label(cls, v: str) -> str:
    """Validate name follows RFC 1123 DNS label format."""
    if not _DNS_LABEL_PATTERN.match(v):
        raise ValueError(
            f"Name '{v}' must be a valid RFC 1123 DNS label: "
            "lowercase alphanumeric, may contain hyphens (not at start/end), "
            "max 63 characters"
        )
    return v

Skill

Skill

Bases: BaseModel

A capability/skill the agent can perform (A2A).

Skills describe what an agent can do and are advertised in the Agent Card.

Example
skill = Skill(
    id="code-review",
    name="Code Review",
    description="Reviews code for bugs and style issues",
    tags=["development", "review"],
    examples=["Review this Python code", "Check for security issues"],
)

Message

Message

Bases: BaseModel

A message in a conversation session.

TaskStatus

TaskStatus

Bases: StrEnum

Status of a task in its lifecycle.

TaskState

TaskState

Bases: BaseModel

State of a task (a single unit of agent work).

TaskUpdate

TaskUpdate

Bases: BaseModel

A progress update emitted during task execution.

InputRequest

InputRequest

Bases: BaseModel

A request for user input during task execution.

Uses standard JSON Schema for defining expected input structure. Clients can use this schema with form generators, validators, etc.

Example
request = InputRequest(
    prompt="Which database should I configure?",
    json_schema={
        "type": "object",
        "properties": {
            "database": {
                "type": "string",
                "title": "Database",
                "enum": ["PostgreSQL", "MySQL", "Redis"],
            },
            "port": {
                "type": "integer",
                "title": "Port",
                "minimum": 1,
                "maximum": 65535,
                "default": 6379,
            },
        },
        "required": ["database"],
    },
)

Attachment

Attachment

Bases: BaseModel

An attachment (image, audio, video, file) for multi-modal input.

Attachments can be stored inline (base64) for small files or referenced by URL/key for larger files stored externally (Redis, S3, filesystem).

Example
# Inline image (small, base64)
attachment = Attachment(
    type=AttachmentType.IMAGE,
    mime_type="image/png",
    data="iVBORw0KGgo...",  # base64 encoded
    filename="screenshot.png",
)

# External reference (large file)
attachment = Attachment(
    type=AttachmentType.AUDIO,
    mime_type="audio/wav",
    url="redis://attachments:task123:audio1",  # or s3://, file://
    filename="recording.wav",
    size_bytes=1024000,
)