judgevet.ports.media
Status: draft.
judgevet.ports.media
Structural extension for explicitly supported image judgments.
Source: https://github.com/Alberto-Codes/judgevet/issues/203#issuecomment-5851219798.
Examples:
from judgevet.ports.media import MediaSystemOnePort
from judgevet.domain.media import MediaCapabilities
def formats(port: MediaSystemOnePort) -> MediaCapabilities:
return port.capabilities("selected-model")
AsyncMediaSystemOnePort is the asynchronous form. Only its judgment
methods are coroutines. capabilities stays a synchronous static lookup.
Source: https://github.com/Alberto-Codes/judgevet/issues/252#issuecomment-5924224316.
See Also
- judgevet.ports: Existing text protocol.
- judgevet.media: Validated public dispatch.
AsyncMediaSystemOnePort
Bases: AsyncSystemOnePort, Protocol
Provide awaited text and image judgments without implicit media fallback.
The protocol check is structural. A port whose system_one_media is
synchronous still passes isinstance, and awaiting its result raises
TypeError.
Attributes:
| Name | Type | Description |
|---|---|---|
capabilities |
method
|
Return a static declaration for the selected model. |
system_one_media |
method
|
Judge exact ordered evidence and bindings. |
system_one |
method
|
Preserve the existing async text operation. |
Examples:
async def judge(port: AsyncMediaSystemOnePort, evidence, questions):
return await port.system_one_media(
"state", questions, "selected", evidence=evidence
)
capabilities(model)
Return static capabilities without acquisition, IO or inference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
str
|
Caller-selected model, not an inferred resolved identity. |
required |
Returns:
| Type | Description |
|---|---|
MediaCapabilities
|
Capabilities established by the application during setup. |
system_one_media(state, questions, model, *, evidence)
async
Judge media while preserving bytes, identities, orders and bindings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
str | dict[str, Any] | list[Any]
|
Original caller state. |
required |
questions
|
Mapping[str, Question | Mapping[str, Any]]
|
Original typed or raw question definitions. |
required |
model
|
str
|
Caller-selected model. |
required |
evidence
|
ImageEvidence
|
Immutable ordered attachment snapshot. |
required |
Returns:
| Type | Description |
|---|---|
SystemOneResponse
|
Typed answers with provider-reported model and usage metadata. |
Raises:
| Type | Description |
|---|---|
ProviderError
|
A declared provider failure, never a semantic answer. |
MediaSystemOnePort
Bases: SystemOnePort, Protocol
Provide text and image judgments without implicit media fallback.
Attributes:
| Name | Type | Description |
|---|---|---|
capabilities |
method
|
Return a static declaration for the selected model. |
system_one_media |
method
|
Judge exact ordered evidence and bindings. |
system_one |
method
|
Preserve the existing text operation. |
Examples:
def capabilities(port: MediaSystemOnePort) -> MediaCapabilities:
return port.capabilities("selected")
capabilities(model)
Return static capabilities without acquisition, IO or inference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
str
|
Caller-selected model, not an inferred resolved identity. |
required |
Returns:
| Type | Description |
|---|---|
MediaCapabilities
|
Capabilities established by the application during setup. |
system_one_media(state, questions, model, *, evidence)
Judge media while preserving bytes, identities, orders and bindings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
str | dict[str, Any] | list[Any]
|
Original caller state. |
required |
questions
|
Mapping[str, Question | Mapping[str, Any]]
|
Original typed or raw question definitions. |
required |
model
|
str
|
Caller-selected model. |
required |
evidence
|
ImageEvidence
|
Immutable ordered attachment snapshot. |
required |
Returns:
| Type | Description |
|---|---|
SystemOneResponse
|
Typed answers with provider-reported model and usage metadata. |
Raises:
| Type | Description |
|---|---|
ProviderError
|
A declared provider failure, never a semantic answer. |