Skip to content

VideoURLContent

Base classes

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

⋔ Inheritance diagram

graph TD
  93827291583168["content.VideoURLContent"]
  93827291999840["content.VideoContent"]
  93827291152384["content.BaseContent"]
  93827278265344["schema.Schema"]
  93827258649232["main.BaseModel"]
  139640553287904["builtins.object"]
  93827291999840 --> 93827291583168
  93827291152384 --> 93827291999840
  93827278265344 --> 93827291152384
  93827258649232 --> 93827278265344
  139640553287904 --> 93827258649232

🛈 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