pub struct Request {
pub state: Value,
pub model: String,
pub questions: BTreeMap<String, Question>,
}Expand description
State and typed questions sent to the System One evaluation endpoint.
Fields§
§state: ValueState for the model to evaluate.
The top-level value must be a string, object, or array.
model: StringModel identifier. Defaults to jev-latest.
questions: BTreeMap<String, Question>Questions keyed by caller-selected identifiers.
An identifier correlates its question with the returned answer; it is not used for inference.
Implementations§
Source§impl Request
impl Request
Sourcepub fn new(state: impl Into<Value>) -> Self
pub fn new(state: impl Into<Value>) -> Self
Creates a request using jev-latest and no questions.
Sourcepub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Sets the model identifier.
Sourcepub fn with_question(self, id: impl Into<String>, question: Question) -> Self
pub fn with_question(self, id: impl Into<String>, question: Question) -> Self
Adds a question and returns the request.
A later question with the same ID replaces the earlier one.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Request
impl<'de> Deserialize<'de> for Request
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Request
Auto Trait Implementations§
impl Forget for Request
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnsafeUnpin for Request
impl UnwindSafe for Request
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more