Prompt metadata
Tag
dataclass
#
A structured tag attached to a benchmark prompt.
Tags are metadata used to filter and organize benchmark results; they are
never shown to the annotators. category optionally groups related tags
(e.g. Tag("landscape", category="scene")); leave it None for a bare
tag.
Origin
dataclass
#
Where a benchmark prompt originated from (e.g. a source dataset).
BenchmarkPromptInfo
dataclass
#
BenchmarkPromptInfo(
identifier: str,
prompt: str | None,
english_prompt: str | None,
prompt_asset: str | None,
tags: list[Tag],
origin: Origin | None,
)
A single prompt returned by a filtered/sorted benchmark prompt query.
is_tag_list #
Whether value is usable as one prompt's tag list.
A bare str is itself a Sequence of characters, so it has to be
rejected explicitly or tags=["a", "b"] would silently be read as two
prompts' worth of tags instead of one.
Source code in src/rapidata/rapidata_client/benchmark/prompt_metadata.py
coerce_tags #
Normalize user-supplied tags into Tag objects.
Bare strings become uncategorized tags, so callers can keep passing the
plain list[str] they used before categories existed.
Source code in src/rapidata/rapidata_client/benchmark/prompt_metadata.py
coerce_origin #
Normalize a user-supplied origin into an Origin.