pub struct FeedbackCollector { /* private fields */ }Expand description
Collector for implicit feedback signals.
Thread-safe and designed for concurrent access from multiple queries.
Implementations§
Source§impl FeedbackCollector
impl FeedbackCollector
Sourcepub fn with_config(config: FeedbackConfig) -> Self
pub fn with_config(config: FeedbackConfig) -> Self
Create with custom configuration.
Sourcepub async fn start_session(&self) -> SessionId
pub async fn start_session(&self) -> SessionId
Start a new session.
Sourcepub async fn get_or_create_session(
&self,
session_id: Option<SessionId>,
) -> SessionId
pub async fn get_or_create_session( &self, session_id: Option<SessionId>, ) -> SessionId
Get or create a session (for stateless APIs).
Sourcepub async fn record_query(
&self,
session_id: SessionId,
query_text: &str,
result_ids: Vec<Uuid>,
query_embedding: Option<Vec<f32>>,
) -> QueryId
pub async fn record_query( &self, session_id: SessionId, query_text: &str, result_ids: Vec<Uuid>, query_embedding: Option<Vec<f32>>, ) -> QueryId
Record a query and its results.
Sourcepub async fn record_view(
&self,
session_id: SessionId,
entry_id: Uuid,
position: usize,
)
pub async fn record_view( &self, session_id: SessionId, entry_id: Uuid, position: usize, )
Record that a user viewed a result.
Sourcepub async fn record_select(
&self,
session_id: SessionId,
entry_id: Uuid,
position: usize,
)
pub async fn record_select( &self, session_id: SessionId, entry_id: Uuid, position: usize, )
Record that a user selected/used a result.
Sourcepub async fn record_dismiss(
&self,
session_id: SessionId,
entry_id: Uuid,
position: usize,
)
pub async fn record_dismiss( &self, session_id: SessionId, entry_id: Uuid, position: usize, )
Record that a user dismissed a result.
Sourcepub async fn record_dwell(
&self,
session_id: SessionId,
entry_id: Uuid,
duration_ms: u64,
)
pub async fn record_dwell( &self, session_id: SessionId, entry_id: Uuid, duration_ms: u64, )
Record dwell time on a result.
Sourcepub async fn end_session(&self, session_id: SessionId)
pub async fn end_session(&self, session_id: SessionId)
End a session explicitly.
Sourcepub async fn cleanup_expired_sessions(&self)
pub async fn cleanup_expired_sessions(&self)
Clean up expired sessions.
Sourcepub async fn drain_signals(&self) -> Vec<FeedbackSignal>
pub async fn drain_signals(&self) -> Vec<FeedbackSignal>
Drain all buffered signals for processing.
Sourcepub async fn pending_signals(&self) -> usize
pub async fn pending_signals(&self) -> usize
Get number of buffered signals.
Sourcepub fn total_signals(&self) -> u64
pub fn total_signals(&self) -> u64
Get total signals collected.
Sourcepub fn total_sessions(&self) -> u64
pub fn total_sessions(&self) -> u64
Get total sessions created.
Sourcepub async fn active_sessions(&self) -> usize
pub async fn active_sessions(&self) -> usize
Get number of active sessions.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FeedbackCollector
impl !RefUnwindSafe for FeedbackCollector
impl Send for FeedbackCollector
impl Sync for FeedbackCollector
impl Unpin for FeedbackCollector
impl UnsafeUnpin for FeedbackCollector
impl !UnwindSafe for FeedbackCollector
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> 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> 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