pub struct RotaryProviderAdapter { /* private fields */ }Expand description
Adapter that wraps an apollo Provider and implements rx4’s Provider
trait. This lets rx4’s Agent loop use apollo’s existing provider
backends (Anthropic, OpenAI-compat, Ollama, Copilot) without modification.
rx4’s Provider trait is streaming-based (stream()), while apollo’s
is request-response (chat()). This adapter bridges the gap by calling
apollo’s chat() and wrapping the result in a single-element stream.
Implementations§
Source§impl RotaryProviderAdapter
impl RotaryProviderAdapter
pub fn new(provider: Arc<dyn UnthinkclawProvider>) -> Self
Trait Implementations§
Source§impl Provider for RotaryProviderAdapter
impl Provider for RotaryProviderAdapter
fn id(&self) -> &str
fn name(&self) -> &str
fn stream<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
system: &'life2 Option<String>,
model: &'life3 str,
tools: &'life4 [Value],
_reasoning_effort: Option<&'life5 str>,
) -> Pin<Box<dyn Future<Output = Result<StreamResult, Rx4ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
Source§fn generate<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
system: &'life2 Option<String>,
model: &'life3 str,
tools: &'life4 [Value],
) -> Pin<Box<dyn Future<Output = Result<String, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
fn generate<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
system: &'life2 Option<String>,
model: &'life3 str,
tools: &'life4 [Value],
) -> Pin<Box<dyn Future<Output = Result<String, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
Non-streaming fallback (used when providers feature is off).
Auto Trait Implementations§
impl !RefUnwindSafe for RotaryProviderAdapter
impl !UnwindSafe for RotaryProviderAdapter
impl Freeze for RotaryProviderAdapter
impl Send for RotaryProviderAdapter
impl Sync for RotaryProviderAdapter
impl Unpin for RotaryProviderAdapter
impl UnsafeUnpin for RotaryProviderAdapter
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more