pub struct ContentEventBuilder { /* private fields */ }Expand description
Reusable context for content-scoped server events.
Holds response_id, item_id, output_index, and content_index.
Terminal methods take event_id per call, enabling reuse in streaming loops.
Implementations§
Source§impl ContentEventBuilder
impl ContentEventBuilder
Sourcepub fn new(
response_id: impl Into<String>,
item_id: impl Into<String>,
output_index: u32,
content_index: u32,
) -> Self
pub fn new( response_id: impl Into<String>, item_id: impl Into<String>, output_index: u32, content_index: u32, ) -> Self
Create a new content-scoped context directly.
Sourcepub fn content_part_added(
&self,
event_id: impl Into<String>,
part: ResponseContentPart,
) -> ServerEvent
pub fn content_part_added( &self, event_id: impl Into<String>, part: ResponseContentPart, ) -> ServerEvent
Build a response.content_part.added event.
Sourcepub fn content_part_done(
&self,
event_id: impl Into<String>,
part: ResponseContentPart,
) -> ServerEvent
pub fn content_part_done( &self, event_id: impl Into<String>, part: ResponseContentPart, ) -> ServerEvent
Build a response.content_part.done event.
Sourcepub fn output_text_delta(
&self,
event_id: impl Into<String>,
delta: impl Into<String>,
) -> ServerEvent
pub fn output_text_delta( &self, event_id: impl Into<String>, delta: impl Into<String>, ) -> ServerEvent
Build a response.output_text.delta event.
Sourcepub fn output_text_done(
&self,
event_id: impl Into<String>,
text: impl Into<String>,
) -> ServerEvent
pub fn output_text_done( &self, event_id: impl Into<String>, text: impl Into<String>, ) -> ServerEvent
Build a response.output_text.done event.
Sourcepub fn output_audio_delta(
&self,
event_id: impl Into<String>,
delta: impl Into<String>,
) -> ServerEvent
pub fn output_audio_delta( &self, event_id: impl Into<String>, delta: impl Into<String>, ) -> ServerEvent
Build a response.output_audio.delta event.
Sourcepub fn output_audio_done(&self, event_id: impl Into<String>) -> ServerEvent
pub fn output_audio_done(&self, event_id: impl Into<String>) -> ServerEvent
Build a response.output_audio.done event.
Sourcepub fn output_audio_transcript_delta(
&self,
event_id: impl Into<String>,
delta: impl Into<String>,
) -> ServerEvent
pub fn output_audio_transcript_delta( &self, event_id: impl Into<String>, delta: impl Into<String>, ) -> ServerEvent
Build a response.output_audio_transcript.delta event.
Sourcepub fn output_audio_transcript_done(
&self,
event_id: impl Into<String>,
transcript: impl Into<String>,
) -> ServerEvent
pub fn output_audio_transcript_done( &self, event_id: impl Into<String>, transcript: impl Into<String>, ) -> ServerEvent
Build a response.output_audio_transcript.done event.
Trait Implementations§
Source§impl Clone for ContentEventBuilder
impl Clone for ContentEventBuilder
Source§fn clone(&self) -> ContentEventBuilder
fn clone(&self) -> ContentEventBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ContentEventBuilder
impl RefUnwindSafe for ContentEventBuilder
impl Send for ContentEventBuilder
impl Sync for ContentEventBuilder
impl Unpin for ContentEventBuilder
impl UnsafeUnpin for ContentEventBuilder
impl UnwindSafe for ContentEventBuilder
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