pub struct DynamicQuestion {Show 14 fields
pub schema: String,
pub request_id: String,
pub scope: Scope,
pub operation: DynamicOperation,
pub task_family: TaskFamily,
pub question: String,
pub labels: Vec<String>,
pub context: Vec<ContextField>,
pub output: DynamicOutputKind,
pub deadline_ms: u64,
pub max_cost_units: u64,
pub artifact: ArtifactId,
pub privacy: Vec<String>,
pub abstention: AbstentionPolicy,
}Expand description
A dynamic question, rustev.dynamic-question/1 (3.2).
Fields§
§schema: String§request_id: StringUnique per request, 1 to 256 bytes. Not part of the canonical request identity.
scope: ScopeThe opaque authorized scope: an isolation key, never a grant.
operation: DynamicOperation§task_family: TaskFamily§question: StringOne UTF-8 question, 1 to 4096 bytes.
labels: Vec<String>The ordered labels (proposition, classify) or levels, low to
high (rubric). Unique by byte-exact comparison.
context: Vec<ContextField>§output: DynamicOutputKind§deadline_ms: u64The end-to-end deadline, from the moment the runtime starts the request; positive.
max_cost_units: u64The hard cost cap of the one attempt; positive.
artifact: ArtifactIdThe artifact the backend must declare.
privacy: Vec<String>The privacy options requested; each must be declared by the capability. A request is evidence of what was asked, never that the options were honored.
abstention: AbstentionPolicyImplementations§
Source§impl DynamicQuestion
impl DynamicQuestion
Sourcepub fn check_bounds(&self) -> Result<(), BoundsError>
pub fn check_bounds(&self) -> Result<(), BoundsError>
The structural bounds of 3.2: sizes, counts, byte-exact uniqueness of labels and context names, the context value budget and the canonical size. Rustev performs no linguistic normalization: two labels are duplicates only when their bytes are equal.
Sourcepub fn context_value_bytes(&self) -> usize
pub fn context_value_bytes(&self) -> usize
The context value bytes, summed over every field.
Trait Implementations§
Source§impl Clone for DynamicQuestion
impl Clone for DynamicQuestion
Source§impl Debug for DynamicQuestion
impl Debug for DynamicQuestion
Source§impl<'de> Deserialize<'de> for DynamicQuestion
impl<'de> Deserialize<'de> for DynamicQuestion
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Document for DynamicQuestion
impl Document for DynamicQuestion
Source§fn parse(bytes: &[u8]) -> Result<Self, DocumentError>
fn parse(bytes: &[u8]) -> Result<Self, DocumentError>
Scan, deserialize, check the schema string and the structural bounds of 3.2.
Source§const SCHEMA: &'static str = schema::DYNAMIC_QUESTION
const SCHEMA: &'static str = schema::DYNAMIC_QUESTION
Source§const LIMITS: ParseLimits = DYNAMIC_QUESTION_V1
const LIMITS: ParseLimits = DYNAMIC_QUESTION_V1
Source§fn record_canonical(&self) -> Result<Vec<u8>, CanonicalError>where
Self: PartialEq,
fn record_canonical(&self) -> Result<Vec<u8>, CanonicalError>where
Self: PartialEq,
Source§fn record_digest(&self) -> Result<ContentDigest, CanonicalError>where
Self: PartialEq,
fn record_digest(&self) -> Result<ContentDigest, CanonicalError>where
Self: PartialEq,
sha256(SCHEMA || 0x00 || record canonical bytes) (spec 004, 3.1.6).
Equal to the identity of an identified document.impl Eq for DynamicQuestion
Source§impl JsonSchema for DynamicQuestion
impl JsonSchema for DynamicQuestion
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more