riglr_core/
sentiment.rs

1//! Generic sentiment analysis abstraction
2//!
3//! This module provides a marker type for sentiment analyzers that can be
4//! stored in the ApplicationContext's extension system. The actual trait
5//! definition remains in the implementing crates to avoid circular dependencies.
6
7/// Marker trait for sentiment analyzers
8///
9/// This trait serves as a type marker for sentiment analysis implementations
10/// that can be stored in ApplicationContext's extension system.
11///
12/// The actual sentiment analysis logic is defined in implementing crates
13/// (e.g., riglr-web-tools) to avoid circular dependencies.
14///
15/// # Example
16///
17/// ```rust,no_run
18/// use riglr_core::provider::ApplicationContext;
19/// use std::sync::Arc;
20///
21/// // In application setup:
22/// let context = ApplicationContext::default();
23///
24/// // Store a sentiment analyzer (from riglr-web-tools or custom implementation)
25/// // let analyzer = Arc::new(MyConcreteAnalyzer::new());
26/// // context.set_extension(analyzer);
27///
28/// // Later, retrieve it:
29/// // let analyzer = context.get_extension::<Arc<dyn SentimentAnalyzerMarker>>()
30/// //     .expect("Sentiment analyzer not configured");
31/// ```
32pub trait SentimentAnalyzerMarker: Send + Sync + 'static {}