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

media.mddocs/

Media Types API

Support for images, audio, video, and file inputs/outputs.

Capabilities

Image

from agno.media import Image

class Image:
    def __init__(
        self,
        url: Optional[str] = None,
        content: Optional[Union[str, bytes]] = None,
        filepath: Optional[Union[str, Path]] = None,
        format: Optional[str] = None,
        **kwargs
    ): ...

    @classmethod
    def from_url(cls, url: str) -> Image: ...

    @classmethod
    def from_path(cls, path: Union[str, Path]) -> Image: ...

    def get_content_bytes(self) -> bytes:
        """Get the image content as bytes."""

    def to_base64(self) -> str:
        """Convert image to base64 encoded string."""

    @classmethod
    def from_base64(cls, base64_str: str, format: Optional[str] = None) -> Image:
        """Create Image from base64 encoded string."""

Audio

from agno.media import Audio

class Audio:
    def __init__(
        self,
        url: Optional[str] = None,
        content: Optional[Union[str, bytes]] = None,
        filepath: Optional[Union[str, Path]] = None,
        format: Optional[str] = None,
        **kwargs
    ): ...

    @classmethod
    def from_url(cls, url: str) -> Audio: ...

    @classmethod
    def from_path(cls, path: Union[str, Path]) -> Audio: ...

    def get_content_bytes(self) -> bytes:
        """Get the audio content as bytes."""

    def to_base64(self) -> str:
        """Convert audio to base64 encoded string."""

    @classmethod
    def from_base64(cls, base64_str: str, format: Optional[str] = None) -> Audio:
        """Create Audio from base64 encoded string."""

Video

from agno.media import Video

class Video:
    def __init__(
        self,
        url: Optional[str] = None,
        content: Optional[Union[str, bytes]] = None,
        filepath: Optional[Union[str, Path]] = None,
        format: Optional[str] = None,
        **kwargs
    ): ...

    @classmethod
    def from_url(cls, url: str) -> Video: ...

    @classmethod
    def from_path(cls, path: Union[str, Path]) -> Video: ...

    def get_content_bytes(self) -> bytes:
        """Get the video content as bytes."""

    def to_base64(self) -> str:
        """Convert video to base64 encoded string."""

    @classmethod
    def from_base64(cls, base64_str: str, format: Optional[str] = None) -> Video:
        """Create Video from base64 encoded string."""

File

from agno.media import File

class File:
    def __init__(
        self,
        url: Optional[str] = None,
        content: Optional[Union[str, bytes]] = None,
        filepath: Optional[Union[str, Path]] = None,
        name: Optional[str] = None,
        format: Optional[str] = None,
        **kwargs
    ): ...

    @classmethod
    def from_url(cls, url: str) -> File: ...

    @classmethod
    def from_path(cls, path: Union[str, Path]) -> File: ...

    def get_content_bytes(self) -> bytes:
        """Get the file content as bytes."""

    def to_base64(self) -> str:
        """Convert file to base64 encoded string."""

    @classmethod
    def from_base64(cls, base64_str: str, format: Optional[str] = None) -> File:
        """Create File from base64 encoded string."""

Usage Examples

Sending Images

from agno.agent import Agent
from agno.media import Image

agent = Agent(model=...)

# From URL
response = agent.run(
    "What's in this image?",
    images=[Image.from_url("https://example.com/image.jpg")]
)

# From file
response = agent.run(
    "Describe this image",
    images=[Image.from_path("./photo.jpg")]
)

Sending Audio

from agno.media import Audio

response = agent.run(
    "Transcribe this audio",
    audio=[Audio.from_path("./recording.mp3")]
)