Skip to content

VideoURLContent

Base classes

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

⋔ Inheritance diagram

graph TD
  94461878055216["content.VideoURLContent"]
  94461877893840["content.VideoContent"]
  94461877390128["content.BaseContent"]
  94461844082608["main.BaseModel"]
  139711135027392["builtins.object"]
  94461877893840 --> 94461878055216
  94461877390128 --> 94461877893840
  94461844082608 --> 94461877390128
  139711135027392 --> 94461844082608

🛈 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