Skip to content

VideoURLContent

Base classes

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

⋔ Inheritance diagram

graph TD
  94229448406960["content.VideoURLContent"]
  94229448531136["content.VideoContent"]
  94229448349568["content.BaseContent"]
  94229438169392["schema.Schema"]
  94229417688032["main.BaseModel"]
  140359194849504["builtins.object"]
  94229448531136 --> 94229448406960
  94229448349568 --> 94229448531136
  94229438169392 --> 94229448349568
  94229417688032 --> 94229438169392
  140359194849504 --> 94229417688032

🛈 DocStrings

Bases: VideoContent

Video from URL.

Source code in src/llmling_agent/models/content.py
302
303
304
305
306
307
308
309
310
311
312
313
314
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
311
312
313
314
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