pub struct SystemOneClient {
http: Client,
endpoint: String,
api_key: Option<String>,
model: String,
timeout: Duration,
}Expand description
Calls one System One endpoint with one configured model.
Fields§
§http: Client§endpoint: String§api_key: Option<String>§model: String§timeout: DurationImplementations§
Source§impl SystemOneClient
impl SystemOneClient
Sourcepub fn new(config: &SystemOneConfig, http: Client) -> Self
pub fn new(config: &SystemOneConfig, http: Client) -> Self
The caller builds the reqwest::Client, so a boot site can pass
the NODE_EXTRA_CA_CERTS trust client every outbound call uses;
the config’s timeout is applied per request so a client shared
with another leg cannot widen it.
Sourcepub async fn ask(
&self,
state: &Value,
question: &Question,
) -> Result<AskOutcome, SystemOneError>
pub async fn ask( &self, state: &Value, question: &Question, ) -> Result<AskOutcome, SystemOneError>
Ask one question about one state; the answer must validate against the question it answers.
Auto Trait Implementations§
impl !RefUnwindSafe for SystemOneClient
impl !UnwindSafe for SystemOneClient
impl Freeze for SystemOneClient
impl Send for SystemOneClient
impl Sync for SystemOneClient
impl Unpin for SystemOneClient
impl UnsafeUnpin for SystemOneClient
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