pub trait ProviderAdapter:
Send
+ Sync
+ 'static {
// Required methods
fn name(&self) -> &'static str;
fn matches_path(&self, method: &Method, path: &str) -> bool;
fn upstream_base(&self) -> &Url;
fn request_pii_surfaces<'a>(
&self,
body: &'a mut Value,
) -> Vec<PiiSurface<'a>>;
fn response_pii_surfaces<'a>(
&self,
body: &'a mut Value,
) -> Vec<PiiSurface<'a>>;
fn sse_event_pii_surfaces<'a>(
&self,
event: &'a mut SseEvent,
) -> Vec<PiiSurface<'a>>;
// Provided methods
fn contract(&self) -> AdapterContract<'_> { ... }
fn requests_json_output(&self, _request: &Value) -> bool { ... }
}Required Methods§
fn name(&self) -> &'static str
fn matches_path(&self, method: &Method, path: &str) -> bool
fn upstream_base(&self) -> &Url
fn request_pii_surfaces<'a>(&self, body: &'a mut Value) -> Vec<PiiSurface<'a>>
fn response_pii_surfaces<'a>(&self, body: &'a mut Value) -> Vec<PiiSurface<'a>>
fn sse_event_pii_surfaces<'a>( &self, event: &'a mut SseEvent, ) -> Vec<PiiSurface<'a>>
Provided Methods§
Sourcefn contract(&self) -> AdapterContract<'_>
fn contract(&self) -> AdapterContract<'_>
Declares protocol and safety behavior while preserving old implementations.
Sourcefn requests_json_output(&self, _request: &Value) -> bool
fn requests_json_output(&self, _request: &Value) -> bool
Reports whether request asked the model for JSON output (a JSON mode or a JSON
schema), which makes every SurfaceSyntax::ModelOutput response surface a JSON
document. The default, false, restores model output as free text.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".