pub struct Proxy { /* private fields */ }
Expand description
The Chronicle proxy object
Implementations§
Source§impl Proxy
impl Proxy
Sourcepub fn builder() -> ProxyBuilder
pub fn builder() -> ProxyBuilder
Create a builder for the proxy
Sourcepub async fn record_event(&self, body: EventPayload) -> Uuid
pub async fn record_event(&self, body: EventPayload) -> Uuid
Record an event to the database. This lets you have your LLM request events and other events in the same database table.
Sourcepub async fn record_workflow_event(&self, event: WorkflowEvent)
pub async fn record_workflow_event(&self, event: WorkflowEvent)
Record a step event to the database
Sourcepub async fn record_event_batch(
&self,
events: impl Into<SmallVec<[WorkflowEvent; 1]>>,
)
pub async fn record_event_batch( &self, events: impl Into<SmallVec<[WorkflowEvent; 1]>>, )
Record multiple events, steps, and run updates
pub async fn send( &self, options: ProxyRequestOptions, body: ChatRequest, ) -> Result<StreamingResponseReceiver, Report<Error>>
Sourcepub fn set_provider(&self, provider: Arc<dyn ChatModelProvider>)
pub fn set_provider(&self, provider: Arc<dyn ChatModelProvider>)
Add a provider to the system. This will replace any existing provider with the same name
.
Sourcepub fn remove_provider(&self, name: &str)
pub fn remove_provider(&self, name: &str)
Remove a provider. Any aliases that reference this provider’s name will stop working.
Sourcepub fn set_alias(&self, alias: AliasConfig)
pub fn set_alias(&self, alias: AliasConfig)
Add an alias to the system. This will replace any existing alias with the same name
.
Sourcepub fn remove_alias(&self, name: &str)
pub fn remove_alias(&self, name: &str)
Remove an alias
Sourcepub fn set_api_key(&self, api_key: ApiKeyConfig)
pub fn set_api_key(&self, api_key: ApiKeyConfig)
Add an API key to the system. This will replace any existing API key with the same name
.
Sourcepub fn remove_api_key(&self, name: &str)
pub fn remove_api_key(&self, name: &str)
Remove an API key. Any aliases that reference this API key’s name will stop working.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Proxy
impl RefUnwindSafe for Proxy
impl Send for Proxy
impl Sync for Proxy
impl Unpin for Proxy
impl UnwindSafe for Proxy
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
Creates a shared type from an unshared type.