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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
use derive_builder::Builder;
use serde::{Deserialize, Serialize};
use crate::error::OpenAIError;
/// Sort order for listing messages.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "lowercase")]
pub enum ListMessagesOrder {
/// Ascending order
Asc,
/// Descending order
Desc,
}
/// Query parameters for listing messages.
#[derive(Debug, Serialize, Default, Clone, Builder, PartialEq)]
#[builder(name = "ListMessagesQueryArgs")]
#[builder(pattern = "mutable")]
#[builder(setter(into, strip_option), default)]
#[builder(derive(Debug))]
#[builder(build_fn(error = "OpenAIError"))]
pub struct ListMessagesQuery {
/// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
/// default is 20.
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<u32>,
/// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and
/// `desc` for descending order.
#[serde(skip_serializing_if = "Option::is_none")]
pub order: Option<ListMessagesOrder>,
/// A cursor for use in pagination. `after` is an object ID that defines your place in the
/// list.
#[serde(skip_serializing_if = "Option::is_none")]
pub after: Option<String>,
/// A cursor for use in pagination. `before` is an object ID that defines your place in the
/// list.
#[serde(skip_serializing_if = "Option::is_none")]
pub before: Option<String>,
/// Filter messages by the run ID that generated them.
#[serde(skip_serializing_if = "Option::is_none")]
pub run_id: Option<String>,
}
/// Sort order for listing runs.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "lowercase")]
pub enum ListRunsOrder {
/// Ascending order
Asc,
/// Descending order
Desc,
}
/// Query parameters for listing runs.
#[derive(Debug, Serialize, Default, Clone, Builder, PartialEq)]
#[builder(name = "ListRunsQueryArgs")]
#[builder(pattern = "mutable")]
#[builder(setter(into, strip_option), default)]
#[builder(derive(Debug))]
#[builder(build_fn(error = "OpenAIError"))]
pub struct ListRunsQuery {
/// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
/// default is 20.
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<u32>,
/// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and
/// `desc` for descending order.
#[serde(skip_serializing_if = "Option::is_none")]
pub order: Option<ListRunsOrder>,
/// A cursor for use in pagination. `after` is an object ID that defines your place in the
/// list.
#[serde(skip_serializing_if = "Option::is_none")]
pub after: Option<String>,
/// A cursor for use in pagination. `before` is an object ID that defines your place in the
/// list.
#[serde(skip_serializing_if = "Option::is_none")]
pub before: Option<String>,
}
/// Sort order for listing run steps.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "lowercase")]
pub enum ListRunStepsOrder {
/// Ascending order
Asc,
/// Descending order
Desc,
}
/// Query parameters for listing run steps.
#[derive(Debug, Serialize, Default, Clone, Builder, PartialEq)]
#[builder(name = "ListRunStepsQueryArgs")]
#[builder(pattern = "mutable")]
#[builder(setter(into, strip_option), default)]
#[builder(derive(Debug))]
#[builder(build_fn(error = "OpenAIError"))]
pub struct ListRunStepsQuery {
/// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
/// default is 20.
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<u32>,
/// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and
/// `desc` for descending order.
#[serde(skip_serializing_if = "Option::is_none")]
pub order: Option<ListRunStepsOrder>,
/// A cursor for use in pagination. `after` is an object ID that defines your place in the
/// list.
#[serde(skip_serializing_if = "Option::is_none")]
pub after: Option<String>,
/// A cursor for use in pagination. `before` is an object ID that defines your place in the
/// list.
#[serde(skip_serializing_if = "Option::is_none")]
pub before: Option<String>,
/// A list of additional fields to include in the response. Currently the only supported value
/// is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search
/// result content.
#[serde(skip_serializing_if = "Option::is_none")]
pub include: Option<Vec<String>>,
}
/// Query parameters for retrieving a run step.
#[derive(Debug, Serialize, Default, Clone, Builder, PartialEq)]
#[builder(name = "GetRunStepQueryArgs")]
#[builder(pattern = "mutable")]
#[builder(setter(into, strip_option), default)]
#[builder(derive(Debug))]
#[builder(build_fn(error = "OpenAIError"))]
pub struct GetRunStepQuery {
/// A list of additional fields to include in the response. Currently the only supported value
/// is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search
/// result content.
#[serde(skip_serializing_if = "Option::is_none")]
pub include: Option<Vec<String>>,
}