Schema
Schema utilities for gllm-retrieval.
get_image_metadata(chunk)
Retrieve validated image media metadata entries from a chunk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chunk
|
Chunk
|
The chunk to read image metadata from. |
required |
Returns:
| Type | Description |
|---|---|
list[Media]
|
list[Media]: Validated image Media objects; empty list for non-image chunks or chunks with no valid image media entries. |
get_media_metadata(chunk, media_type=None)
Retrieve validated media metadata entries from a chunk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chunk
|
Chunk
|
The chunk to read media metadata from. |
required |
media_type
|
MediaType | None
|
If provided, only entries matching this type are returned. Defaults to None (all types). |
None
|
Returns:
| Type | Description |
|---|---|
list[Media]
|
list[Media]: Validated Media objects; empty list for text chunks, missing "media" key, wrong shape, or all-malformed entries. |