pub struct OpenAiFederation { /* private fields */ }Expand description
Registry of remote gateways reachable for federated inference, keyed by address.
Implementations§
Source§impl OpenAiFederation
impl OpenAiFederation
Sourcepub fn insert_gateway(
&self,
address: impl AsRef<str>,
default_model: impl Into<String>,
fabric: EvalFabricRef,
) -> Result<()>
pub fn insert_gateway( &self, address: impl AsRef<str>, default_model: impl Into<String>, fabric: EvalFabricRef, ) -> Result<()>
Registers a remote gateway under its normalized address.
Sourcepub fn infer(
&self,
cx: &mut Cx,
address: &str,
request: &ModelRequest,
policy: &OpenAiFederationPolicy,
) -> Result<ModelResponse>
pub fn infer( &self, cx: &mut Cx, address: &str, request: &ModelRequest, policy: &OpenAiFederationPolicy, ) -> Result<ModelResponse>
Runs request against the federated gateway at address and returns its response.
Requires the federation capability, encodes the request (with policy)
as a /v1/responses body, realizes it through the gateway’s eval fabric,
and decodes the reply; errors if the gateway is unknown, denies the
capability, or returns a non-200 / non-response value.
Trait Implementations§
Source§impl Clone for OpenAiFederation
impl Clone for OpenAiFederation
Source§fn clone(&self) -> OpenAiFederation
fn clone(&self) -> OpenAiFederation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for OpenAiFederation
impl Default for OpenAiFederation
Source§fn default() -> OpenAiFederation
fn default() -> OpenAiFederation
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OpenAiFederation
impl RefUnwindSafe for OpenAiFederation
impl Send for OpenAiFederation
impl Sync for OpenAiFederation
impl Unpin for OpenAiFederation
impl UnsafeUnpin for OpenAiFederation
impl UnwindSafe for OpenAiFederation
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