pub struct ContentEventEmitter;Available on crate features
telemetry and genai-semconv only.Expand description
Emits opt-in content events on the current span.
Only emits when SemconvConfig::capture_content is true.
When content capture is disabled (the default), these methods are no-ops.
§Example
use adk_telemetry::config::SemconvConfig;
use adk_telemetry::events::ContentEventEmitter;
let config = SemconvConfig { capture_content: true };
ContentEventEmitter::emit_prompt(&config, "What is the weather?");
ContentEventEmitter::emit_completion(&config, "The weather is sunny.");Implementations§
Source§impl ContentEventEmitter
impl ContentEventEmitter
Sourcepub fn emit_prompt(config: &SemconvConfig, prompt: &str)
pub fn emit_prompt(config: &SemconvConfig, prompt: &str)
Emit a gen_ai.content.prompt span event with the prompt text.
Only emits when config.capture_content is true.
Sourcepub fn emit_completion(config: &SemconvConfig, completion: &str)
pub fn emit_completion(config: &SemconvConfig, completion: &str)
Emit a gen_ai.content.completion span event with the completion text.
Only emits when config.capture_content is true.
Auto Trait Implementations§
impl Freeze for ContentEventEmitter
impl RefUnwindSafe for ContentEventEmitter
impl Send for ContentEventEmitter
impl Sync for ContentEventEmitter
impl Unpin for ContentEventEmitter
impl UnsafeUnpin for ContentEventEmitter
impl UnwindSafe for ContentEventEmitter
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