Skip to main content

InferenceModule

Struct InferenceModule 

Source
pub struct InferenceModule { /* private fields */ }

Implementations§

Source§

impl InferenceModule

Source

pub fn new() -> Self

Source

pub fn submit_prompt( &mut self, model_id: Hash32, version: u32, sender: Address, prompt_data: Vec<u8>, fee: u64, current_height: u64, ) -> Result<Hash32, RuntimeError>

Source

pub fn lock_prompt( &mut self, prompt_id: &Hash32, escrow_amount: u128, ) -> Result<(), RuntimeError>

Source

pub fn execute_prompt(&mut self, prompt_id: &Hash32) -> Result<(), RuntimeError>

Source

pub fn submit_receipt( &mut self, prompt_id: &Hash32, operator: Address, inference_output: Vec<u8>, execution_proof: Vec<u8>, current_height: u64, ) -> Result<Hash32, RuntimeError>

Source

pub fn verify_receipt( &mut self, receipt_id: &Hash32, ) -> Result<(), RuntimeError>

Source

pub fn create_settlement( &mut self, receipt_id: &Hash32, model_id: &Hash32, revenue_split: &RevenueSplit, ) -> Result<InferenceSettlement, RuntimeError>

Source

pub fn mark_settled(&mut self, receipt_id: &Hash32) -> Result<(), RuntimeError>

Source

pub fn get_prompt(&self, prompt_id: &Hash32) -> Option<&Prompt>

Source

pub fn get_receipt(&self, receipt_id: &Hash32) -> Option<&Receipt>

Source

pub fn get_settlement( &self, receipt_id: &Hash32, ) -> Option<&InferenceSettlement>

Trait Implementations§

Source§

impl Default for InferenceModule

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> 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, 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.