Skip to content

boxmot.attributes.backends.http

Shared asynchronous HTTP transport and validation for attribute backends.

HttpAttributeBackend

HttpAttributeBackend(config: AttributeConfig)

Bases: ABC

Send a same-track storyboard and validate schema-constrained responses.

name instance-attribute

name: str

aclose async

aclose() -> None

Close the asynchronous HTTP transport.

extract async

extract(
    track_id: int,
    samples: Sequence[AttributeSample],
    images: Sequence[bytes],
) -> dict[str, Any]

Request and validate one analysis; ownership stays with the caller.

request_payload abstractmethod

request_payload(
    prompt: str, image_base64: str
) -> dict[str, Any]

Build the provider payload for the prompt and encoded storyboard.

request_url abstractmethod

request_url() -> str

Return the provider's generation endpoint.

response_text abstractmethod

response_text(envelope: Any) -> str | None

Extract the generated JSON text from the provider response envelope.