pub struct HttpRunner { /* private fields */ }Expand description
HTTP-backed ModelRunner for OpenAI-compatible and Ollama endpoints.
Implementations§
Source§impl HttpRunner
impl HttpRunner
Sourcepub fn new_provider(config: ProviderConfig) -> Self
pub fn new_provider(config: ProviderConfig) -> Self
Builds a runner from an open provider config without changing the HTTP transport path.
Sourcepub fn new_openai_compatible(
runner: Symbol,
model: impl Into<String>,
endpoint: impl Into<String>,
api_key_env: impl Into<String>,
codec: Symbol,
timeout: Duration,
stream: bool,
tools: bool,
max_response_bytes: usize,
) -> Self
pub fn new_openai_compatible( runner: Symbol, model: impl Into<String>, endpoint: impl Into<String>, api_key_env: impl Into<String>, codec: Symbol, timeout: Duration, stream: bool, tools: bool, max_response_bytes: usize, ) -> Self
Builds a runner targeting an OpenAI-compatible /chat/completions
endpoint, reading its API key from the api_key_env environment
variable.
Trait Implementations§
Source§impl Clone for HttpRunner
impl Clone for HttpRunner
Source§fn clone(&self) -> HttpRunner
fn clone(&self) -> HttpRunner
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 Debug for HttpRunner
impl Debug for HttpRunner
Source§impl ModelRunner for HttpRunner
impl ModelRunner for HttpRunner
Source§fn card(&self) -> ModelCard
fn card(&self) -> ModelCard
Returns metadata describing the runner’s advertised model surface.
Source§fn infer(&self, cx: &mut Cx, request: ModelRequest) -> Result<ModelResponse>
fn infer(&self, cx: &mut Cx, request: ModelRequest) -> Result<ModelResponse>
Executes one non-streaming inference request.
Source§fn infer_stream(
&self,
cx: &mut Cx,
request: ModelRequest,
sink: &mut dyn ModelEventSink,
) -> Result<ModelResponse>
fn infer_stream( &self, cx: &mut Cx, request: ModelRequest, sink: &mut dyn ModelEventSink, ) -> Result<ModelResponse>
Executes one streaming inference request. Read more
Auto Trait Implementations§
impl Freeze for HttpRunner
impl RefUnwindSafe for HttpRunner
impl Send for HttpRunner
impl Sync for HttpRunner
impl Unpin for HttpRunner
impl UnsafeUnpin for HttpRunner
impl UnwindSafe for HttpRunner
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