pub struct ChatCompletionStreamResponseDelta {
pub content: Option<String>,
pub function_call: Option<ChatCompletionStreamResponseDeltaFunctionCall>,
pub tool_calls: Option<Vec<ChatCompletionMessageToolCallChunk>>,
pub role: Option<ChatCompletionStreamResponseDeltaRole>,
pub refusal: Option<String>,
}
Expand description
A chat completion delta generated by streamed model responses.
Fields§
§content: Option<String>
The contents of the chunk message.
function_call: Option<ChatCompletionStreamResponseDeltaFunctionCall>
Deprecated and replaced by tool_calls
. The name and arguments of a function that should be called, as generated by the model.
tool_calls: Option<Vec<ChatCompletionMessageToolCallChunk>>
§role: Option<ChatCompletionStreamResponseDeltaRole>
The role of the author of this message.
refusal: Option<String>
The refusal message generated by the model.
Implementations§
Source§impl ChatCompletionStreamResponseDelta
impl ChatCompletionStreamResponseDelta
Sourcepub fn builder() -> ChatCompletionStreamResponseDeltaBuilder<((), (), (), (), ())>
pub fn builder() -> ChatCompletionStreamResponseDeltaBuilder<((), (), (), (), ())>
Create a builder for building ChatCompletionStreamResponseDelta
.
On the builder, call .content(...)
(optional), .function_call(...)
(optional), .tool_calls(...)
(optional), .role(...)
(optional), .refusal(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of ChatCompletionStreamResponseDelta
.
Trait Implementations§
Source§impl Clone for ChatCompletionStreamResponseDelta
impl Clone for ChatCompletionStreamResponseDelta
Source§fn clone(&self) -> ChatCompletionStreamResponseDelta
fn clone(&self) -> ChatCompletionStreamResponseDelta
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 moreSource§impl Default for ChatCompletionStreamResponseDelta
impl Default for ChatCompletionStreamResponseDelta
Source§fn default() -> ChatCompletionStreamResponseDelta
fn default() -> ChatCompletionStreamResponseDelta
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ChatCompletionStreamResponseDelta
impl<'de> Deserialize<'de> for ChatCompletionStreamResponseDelta
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ChatCompletionStreamResponseDelta
impl PartialEq for ChatCompletionStreamResponseDelta
Source§fn eq(&self, other: &ChatCompletionStreamResponseDelta) -> bool
fn eq(&self, other: &ChatCompletionStreamResponseDelta) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for ChatCompletionStreamResponseDelta
Auto Trait Implementations§
impl Freeze for ChatCompletionStreamResponseDelta
impl RefUnwindSafe for ChatCompletionStreamResponseDelta
impl Send for ChatCompletionStreamResponseDelta
impl Sync for ChatCompletionStreamResponseDelta
impl Unpin for ChatCompletionStreamResponseDelta
impl UnwindSafe for ChatCompletionStreamResponseDelta
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