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.
Sourcepub fn with_tool_executor(self, executor: Arc<dyn ToolExecutor>) -> Self
pub fn with_tool_executor(self, executor: Arc<dyn ToolExecutor>) -> Self
Wire an MCP tool executor so nodes that attach tools get the host
agentic loop (MCP_SKILLS.md §6). Without one the worker ignores tools.
Trait Implementations§
Source§impl Worker for OpenAiWorker
impl Worker for OpenAiWorker
Source§fn serves_mcp_tools(&self) -> bool
fn serves_mcp_tools(&self) -> bool
An API worker serves MCP tools when a tool executor is wired (the host
agentic loop, MCP_SKILLS.md §6).
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 !RefUnwindSafe for OpenAiWorker
impl !UnwindSafe for OpenAiWorker
impl Forget for OpenAiWorker
impl Freeze for OpenAiWorker
impl Move for OpenAiWorker
impl Send for OpenAiWorker
impl Sync for OpenAiWorker
impl Unpin for OpenAiWorker
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.