1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
* OpenAI API
*
* The OpenAI REST API. Please see pub https:///platform.openai.com/docs/api-reference for more details.
*
* OpenAPI spec pub version: 2.3.0
*
* Generated pub by: https:///github.com/swagger-api/swagger-codegen.git
*/
/// pub ChatCompletionStreamResponseDelta : A chat completion delta generated by streamed model responses.
#[allow(unused_imports)]
use serde_json::Value;
/// # on openapi.yaml
///
/// ```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
/// ```
#[derive(Debug, Serialize, Deserialize)]
pub struct ChatCompletionStreamResponseDelta {
/// The contents of the chunk message.
#[serde(rename = "content")]
pub content: Option<String>,
#[serde(rename = "function_call")]
pub function_call: Option<crate::models::ChatCompletionStreamResponseDeltaFunctionCall>,
/// The refusal message generated by the model.
#[serde(rename = "refusal")]
pub refusal: Option<String>,
/// The role of the author of this message.
#[serde(rename = "role")]
pub role: Option<String>,
#[serde(rename = "tool_calls")]
pub tool_calls: Option<Vec<crate::models::ChatCompletionMessageToolCallChunk>>,
}
impl Default for ChatCompletionStreamResponseDelta {
fn default() -> Self {
Self {
content: None,
function_call: None,
refusal: None,
role: None,
tool_calls: None,
}
}
}