xr_ai_tools.image#

Lightweight image references and bounded in-process image storage.

Classes#

ImageReference

A lightweight reference to image bytes, a local path, or an HTTP URL.

TimedImage

An image reference positioned on a microsecond timeline.

ImageRegistry

Bounded in-process storage behind opaque image references.

Module Contents#

class xr_ai_tools.image.ImageReference#

A lightweight reference to image bytes, a local path, or an HTTP URL.

uri: str#

Opaque image URI, local path, file URI, or HTTP(S) URL.

classmethod reject_inline_data(value: str) str#

Reject data URIs so image bytes remain outside request payloads.

class xr_ai_tools.image.TimedImage#

An image reference positioned on a microsecond timeline.

image: ImageReference#

Reference to the image content.

timestamp_us: int#

Position on the image sequence’s microsecond timeline.

class xr_ai_tools.image.ImageRegistry(*, capacity: int = 128, allow_external: bool = False)#

Bounded in-process storage behind opaque image references.

put(image: ImageInput, *, owner: str | None = None) ImageReference#

Store image input without placing its bytes in tool results or telemetry.

put_derived(
image: ImageInput,
*,
source: ImageReference,
) ImageReference#

Store derived image input with the source reference’s owner.

resolve(reference: ImageReference) ImageInput#

Resolve an opaque handle or normalize an external image location.

release_owner(owner: str) None#

Remove opaque images associated with one participant or workflow.

clear() None#

Remove all registered opaque images.