Home / Class/ ImageURL Class — langchain Architecture

ImageURL Class — langchain Architecture

Architecture documentation for the ImageURL class in prompt_values.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  a7b08822_fd9a_14dc_e4ad_6499f7bb6ca6["ImageURL"]
  94d98b96_b32c_774d_c6fe_549a7fddfb68["prompt_values.py"]
  a7b08822_fd9a_14dc_e4ad_6499f7bb6ca6 -->|defined in| 94d98b96_b32c_774d_c6fe_549a7fddfb68

Relationship Graph

Source Code

libs/core/langchain_core/prompt_values.py lines 107–132

class ImageURL(TypedDict, total=False):
    """Image URL for multimodal model inputs (OpenAI format).

    Represents the inner `image_url` object in OpenAI's Chat Completion API format. This
    is used by `ImagePromptTemplate` and `ChatPromptTemplate`.

    See Also:
        `ImageContentBlock`: LangChain's provider-agnostic image format used in message
        content blocks. Use `ImageContentBlock` when working with the standardized
        message format across different providers.

    Note:
        The `detail` field values are not validated locally. Invalid values
        will be rejected by the downstream API, allowing new valid values to
        be used without requiring a LangChain update.
    """

    detail: Literal["auto", "low", "high"]
    """Specifies the detail level of the image.

    Defaults to ``'auto'`` if not specified. Higher detail levels consume
    more tokens but provide better image understanding.
    """

    url: str
    """URL of the image or base64-encoded image data."""

Frequently Asked Questions

What is the ImageURL class?
ImageURL is a class in the langchain codebase, defined in libs/core/langchain_core/prompt_values.py.
Where is ImageURL defined?
ImageURL is defined in libs/core/langchain_core/prompt_values.py at line 107.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free