pub struct InferenceResponse {
pub request_id: String,
pub response_id: String,
pub model_id: String,
pub provider: Address,
pub output: Vec<u8>,
pub metadata: InferenceMetadata,
pub price: u64,
pub timestamp: Timestamp,
pub synthetic_content: bool,
pub provenance: Option<ProvenanceManifest>,
}Expand description
Response from model inference
EU AI Act Article 50 (effective 2026-08-02) requires generative-AI outputs
to carry both (a) a machine-readable disclosure that the content is
AI-generated and (b) a verifiable provenance manifest. Both fields here
are always populated by tenzro-model::routing for real inferences:
synthetic_content is unconditionally true (every inference response is
AI-generated by definition) and provenance carries a signed
ProvenanceManifest when a ProvenanceSigner is wired into the router.
Fields§
§request_id: StringRequest ID this response is for
response_id: StringResponse ID
model_id: StringModel that generated the response
provider: AddressProvider that served the request
output: Vec<u8>Output data
metadata: InferenceMetadataResponse metadata
price: u64Actual price charged (in smallest TNZO unit)
timestamp: TimestampResponse timestamp
synthetic_content: boolEU AI Act Article 50(2) — content is machine-generated. Always true
for genuine inference responses; deserialized as true by default so
integrations that build responses by hand cannot accidentally drop the
disclosure.
provenance: Option<ProvenanceManifest>EU AI Act Article 50(2) — content provenance. None only for in-memory
transient responses that haven’t been signed yet (e.g. mid-router). All
responses returned to RPC/MCP/A2A clients have this populated.
Implementations§
Source§impl InferenceResponse
impl InferenceResponse
Sourcepub fn new(
request_id: String,
model_id: String,
provider: Address,
output: Vec<u8>,
price: u64,
) -> Self
pub fn new( request_id: String, model_id: String, provider: Address, output: Vec<u8>, price: u64, ) -> Self
Creates a new inference response. The result is marked as
synthetic_content = true automatically per EU AI Act Article 50.
Callers should attach a ProvenanceManifest via with_provenance
before publishing the response off the node.
Sourcepub fn with_provenance(self, manifest: ProvenanceManifest) -> Self
pub fn with_provenance(self, manifest: ProvenanceManifest) -> Self
Builder helper to attach a signed provenance manifest before the response leaves the inference router.
Trait Implementations§
Source§impl Clone for InferenceResponse
impl Clone for InferenceResponse
Source§fn clone(&self) -> InferenceResponse
fn clone(&self) -> InferenceResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InferenceResponse
impl Debug for InferenceResponse
Source§impl<'de> Deserialize<'de> for InferenceResponse
impl<'de> Deserialize<'de> for InferenceResponse
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>,
impl Eq for InferenceResponse
Source§impl PartialEq for InferenceResponse
impl PartialEq for InferenceResponse
Source§fn eq(&self, other: &InferenceResponse) -> bool
fn eq(&self, other: &InferenceResponse) -> bool
self and other values to be equal, and is used by ==.