pub struct AiResponseHandler { /* private fields */ }
Expand description
AI response handler that combines intelligent generation and drift simulation
Implementations§
Source§impl AiResponseHandler
impl AiResponseHandler
Sourcepub fn new(
intelligent_config: Option<IntelligentMockConfig>,
drift_config: Option<DataDriftConfig>,
) -> Result<Self>
pub fn new( intelligent_config: Option<IntelligentMockConfig>, drift_config: Option<DataDriftConfig>, ) -> Result<Self>
Create a new AI response handler
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if this handler has any AI features enabled
Sourcepub async fn generate_response(
&mut self,
base_response: Option<Value>,
) -> Result<Value>
pub async fn generate_response( &mut self, base_response: Option<Value>, ) -> Result<Value>
Generate a response using configured AI features
Sourcepub async fn reset_drift(&self)
pub async fn reset_drift(&self)
Reset drift state (useful for testing or specific scenarios)
Sourcepub async fn drift_request_count(&self) -> u64
pub async fn drift_request_count(&self) -> u64
Get drift request count
Auto Trait Implementations§
impl Freeze for AiResponseHandler
impl !RefUnwindSafe for AiResponseHandler
impl Send for AiResponseHandler
impl Sync for AiResponseHandler
impl Unpin for AiResponseHandler
impl !UnwindSafe for AiResponseHandler
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