pub struct ChatCompletionStreamResponseDelta {
pub content: Option<String>,
pub function_call: Option<ChatCompletionStreamResponseDeltaFunctionCall>,
pub refusal: Option<String>,
pub role: Option<String>,
pub tool_calls: Option<Vec<ChatCompletionMessageToolCallChunk>>,
}
Expand description
§on openapi.yaml
ChatCompletionStreamResponseDelta:
type: object
description: A chat completion delta generated by streamed model responses.
properties:
content:
type: string
description: The contents of the chunk message.
nullable: true
function_call:
deprecated: true
type: object
description:
Deprecated and replaced by `tool_calls`. The name and arguments of
a function that should be called, as generated by the model.
properties:
arguments:
type: string
description:
The arguments to call the function with, as generated by the model
in JSON format. Note that the model does not always generate
valid JSON, and may hallucinate parameters not defined by your
function schema. Validate the arguments in your code before
calling your function.
name:
type: string
description: The name of the function to call.
tool_calls:
type: array
items:
$ref: "#/components/schemas/ChatCompletionMessageToolCallChunk"
role:
type: string
enum:
- developer
- system
- user
- assistant
- tool
description: The role of the author of this message.
refusal:
type: string
description: The refusal message generated by the model.
nullable: true
Fields§
§content: Option<String>
The contents of the chunk message.
function_call: Option<ChatCompletionStreamResponseDeltaFunctionCall>
§refusal: Option<String>
The refusal message generated by the model.
role: Option<String>
The role of the author of this message.
tool_calls: Option<Vec<ChatCompletionMessageToolCallChunk>>
Trait Implementations§
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
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