pub struct OpenAiWorker { /* private fields */ }Expand description
An API worker backed by an OpenAI-compatible endpoint, with an optional pool
of keys it rotates across when one is rate-limited (CONTEXT.md §13).
Implementations§
Source§impl OpenAiWorker
impl OpenAiWorker
Sourcepub fn new(
name: &str,
base_url: &str,
keys: Vec<String>,
models: Vec<String>,
capabilities: Vec<Capability>,
extra_body: Option<Value>,
) -> Self
pub fn new( name: &str, base_url: &str, keys: Vec<String>, models: Vec<String>, capabilities: Vec<Capability>, extra_body: Option<Value>, ) -> Self
Build an API worker.
name is the Rinne worker name (e.g. openrouter, deepseek).
base_url includes the version (e.g. https://api.openai.com/v1).
keys is the user’s key pool (rotated on rate-limit). models is the
ladder cheap→strong; the first is the default. The per-node model
(conductor’s choice or a cascade escalation) overrides the default.
Trait Implementations§
Source§impl Worker for OpenAiWorker
impl Worker for OpenAiWorker
Source§fn descriptor(&self) -> &WorkerDescriptor
fn descriptor(&self) -> &WorkerDescriptor
The worker’s self-description, used by the scheduler to resolve a node’s
capability
needs to a concrete worker.Source§fn execute<'life0, 'async_trait>(
&'life0 self,
request: ExecuteRequest,
events: EventSink,
cancel: CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<ExecuteResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
request: ExecuteRequest,
events: EventSink,
cancel: CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<ExecuteResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Do one unit of work. Returns the normalized result, or an error if the
worker could not be driven at all (distinct from a worker that ran and
reported
ExecStatus::Failed).Auto Trait Implementations§
impl Freeze for OpenAiWorker
impl RefUnwindSafe for OpenAiWorker
impl Send for OpenAiWorker
impl Sync for OpenAiWorker
impl Unpin for OpenAiWorker
impl UnsafeUnpin for OpenAiWorker
impl UnwindSafe for OpenAiWorker
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