pub struct JevClient { /* private fields */ }Expand description
HTTP client for the Jev System One REST API.
Implementations§
Source§impl JevClient
impl JevClient
Sourcepub fn new(base_url: &str, api_key: &str) -> Result<Self>
pub fn new(base_url: &str, api_key: &str) -> Result<Self>
Creates a new Jev API client.
base_url should be the full API host, e.g. https://api.typesafe.ai.
For production use, construct via Self::from_config; tests pass a
wiremock URL directly.
Uses the shared REST-client connect/read timeout split
(connect_timeout, read_timeout) rather than the AI backends’
much longer OMNI_DEV_AI_TIMEOUT_SECS budget — Jev is a low-latency
model, not a chat completion.
Sourcepub fn from_config(config: &JevConfig) -> Result<Self>
pub fn from_config(config: &JevConfig) -> Result<Self>
Creates a client from resolved JevConfig.
Sourcepub async fn system_one(
&self,
req: &SystemOneRequest,
) -> Result<SystemOneResponse>
pub async fn system_one( &self, req: &SystemOneRequest, ) -> Result<SystemOneResponse>
Sends a POST /v1/systemone request and returns the parsed response.
.json(req) sets Content-Type: application/json itself.
Retries on 429 (rate limited) and 529 (overloaded); any other
non-2xx status becomes JevError::ApiRequestFailed. A 2xx body
that fails to parse names each answer it could not read and that
answer’s type, since the likeliest cause is a primitive added by a
newer Jev API version.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for JevClient
impl !UnwindSafe for JevClient
impl Freeze for JevClient
impl Send for JevClient
impl Sync for JevClient
impl Unpin for JevClient
impl UnsafeUnpin for JevClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more