Skip to content

VideoURLContent

Base classes

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

⋔ Inheritance diagram

graph TD
  94890200220448["content.VideoURLContent"]
  94890199943168["content.VideoContent"]
  94890199950896["content.BaseContent"]
  94890183243792["schema.Schema"]
  94890170496944["main.BaseModel"]
  139970493684192["builtins.object"]
  94890199943168 --> 94890200220448
  94890199950896 --> 94890199943168
  94890183243792 --> 94890199950896
  94890170496944 --> 94890183243792
  139970493684192 --> 94890170496944

🛈 DocStrings

Bases: VideoContent

Video from URL.

Source code in src/llmling_agent/models/content.py
306
307
308
309
310
311
312
313
314
315
316
317
318
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
315
316
317
318
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