pub struct SystemOneClient { /* private fields */ }Expand description
System One API client. Register it in graphrt_core::Services as Arc<SystemOneClient>.
Implementations§
Source§impl SystemOneClient
impl SystemOneClient
pub fn new(config: SystemOneConfig) -> Result<Self, LlmError>
Sourcepub fn from_vars(vars: &[(String, String)]) -> Result<Option<Self>, LlmError>
pub fn from_vars(vars: &[(String, String)]) -> Result<Option<Self>, LlmError>
Build from TYPESAFE_API_KEY (required) and TYPESAFE_BASE_URL (optional).
Returns Ok(None) when no key is set.
Sourcepub fn from_env() -> Result<Option<Self>, LlmError>
pub fn from_env() -> Result<Option<Self>, LlmError>
Build from the process environment (see SystemOneClient::from_vars).
pub fn config(&self) -> &SystemOneConfig
Sourcepub async fn ask(
&self,
request: &SystemOneRequest,
) -> Result<SystemOneResponse, LlmError>
pub async fn ask( &self, request: &SystemOneRequest, ) -> Result<SystemOneResponse, LlmError>
Evaluate the request’s questions.
Trait Implementations§
Source§impl Clone for SystemOneClient
impl Clone for SystemOneClient
Auto Trait Implementations§
impl !RefUnwindSafe for SystemOneClient
impl !UnwindSafe for SystemOneClient
impl Forget for SystemOneClient
impl Freeze for SystemOneClient
impl Move 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