Skip to content

VideoURLContent

Base classes

Name Children Inherits
VideoContent
llmling_agent.models.content
Base for video content.

⋔ Inheritance diagram

🛈 DocStrings

Bases: VideoContent

Video from URL.

Source code in src/llmling_agent/models/content.py
301
302
303
304
305
306
307
308
309
310
311
312
313
class VideoURLContent(VideoContent):
    """Video from URL."""

    type: Literal["video_url"] = Field("video_url", init=False)
    """URL-based video."""

    url: str
    """URL to the video."""

    def to_openai_format(self) -> dict[str, Any]:
        """Convert to OpenAI API format for video models."""
        content = {"url": self.url, "format": self.format or "auto"}
        return {"type": "video", "video": content}

type class-attribute instance-attribute

type: Literal['video_url'] = Field('video_url', init=False)

URL-based video.

url instance-attribute

url: str

URL to the video.

to_openai_format

to_openai_format() -> dict[str, Any]

Convert to OpenAI API format for video models.

Source code in src/llmling_agent/models/content.py
310
311
312
313
def to_openai_format(self) -> dict[str, Any]:
    """Convert to OpenAI API format for video models."""
    content = {"url": self.url, "format": self.format or "auto"}
    return {"type": "video", "video": content}

Show source on GitHub