Skip to main content

InferenceResponse

Struct InferenceResponse 

Source
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: String

Request ID this response is for

§response_id: String

Response ID

§model_id: String

Model that generated the response

§provider: Address

Provider that served the request

§output: Vec<u8>

Output data

§metadata: InferenceMetadata

Response metadata

§price: u64

Actual price charged (in smallest TNZO unit)

§timestamp: Timestamp

Response timestamp

§synthetic_content: bool

EU 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

Source

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.

Source

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

Source§

fn clone(&self) -> InferenceResponse

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InferenceResponse

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for InferenceResponse

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for InferenceResponse

Source§

impl PartialEq for InferenceResponse

Source§

fn eq(&self, other: &InferenceResponse) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for InferenceResponse

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for InferenceResponse

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.