pub struct ChatCompletionStreamResponseWrapper { /* private fields */ }Expand description
Wrapper for streaming chat completion responses.
Implementations§
Source§impl ChatCompletionStreamResponseWrapper
impl ChatCompletionStreamResponseWrapper
Sourcepub fn new(response: CreateChatCompletionStreamResponse) -> Self
pub fn new(response: CreateChatCompletionStreamResponse) -> Self
Create a new stream response wrapper.
Sourcepub fn delta_content(&self) -> Option<&str>
pub fn delta_content(&self) -> Option<&str>
Get the delta content from this chunk.
Sourcepub fn delta_tool_calls(&self) -> Vec<&ChatCompletionMessageToolCallChunk>
pub fn delta_tool_calls(&self) -> Vec<&ChatCompletionMessageToolCallChunk>
Get tool call deltas from this chunk.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Check if this is the final chunk.
Sourcepub fn inner(&self) -> &CreateChatCompletionStreamResponse
pub fn inner(&self) -> &CreateChatCompletionStreamResponse
Get the inner stream response object.
Trait Implementations§
Source§impl Clone for ChatCompletionStreamResponseWrapper
impl Clone for ChatCompletionStreamResponseWrapper
Source§fn clone(&self) -> ChatCompletionStreamResponseWrapper
fn clone(&self) -> ChatCompletionStreamResponseWrapper
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ChatCompletionStreamResponseWrapper
impl RefUnwindSafe for ChatCompletionStreamResponseWrapper
impl Send for ChatCompletionStreamResponseWrapper
impl Sync for ChatCompletionStreamResponseWrapper
impl Unpin for ChatCompletionStreamResponseWrapper
impl UnsafeUnpin for ChatCompletionStreamResponseWrapper
impl UnwindSafe for ChatCompletionStreamResponseWrapper
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