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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The request for SearchAgentContext.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct SearchAgentContextInput {
/// <p>Maximum number of results to return per page.</p>
pub max_results: ::std::option::Option<i32>,
/// <p>Opaque continuation token from a prior response. Omit on the first page.</p>
pub next_token: ::std::option::Option<::std::string::String>,
/// <p>The agent context to search, by ID or full Amazon Resource Name (ARN).</p>
pub agent_context_id: ::std::option::Option<::std::string::String>,
/// <p>The natural-language query or keywords to search for in the agent context. AWS Context interprets it based on <code>searchType</code>: as literal text for <code>KEYWORD</code>, as a semantic concept for <code>SEMANTIC</code>, or as both for <code>AUTO</code>.</p>
pub query: ::std::option::Option<::std::string::String>,
/// <p>Optional filter on node attributes: a single comparison, or <code>andAll</code> of comparisons that must all match.</p>
pub filter: ::std::option::Option<crate::types::SearchFilter>,
/// <p>The search strategy to use. Valid values:</p>
/// <ul>
/// <li>
/// <p><code>KEYWORD</code> - Full-text keyword matching (BM25).</p></li>
/// <li>
/// <p><code>SEMANTIC</code> - Vector similarity of embeddings.</p></li>
/// <li>
/// <p><code>AUTO</code> - Keyword matches first, then semantic matches for the remaining results.</p></li>
/// </ul>
pub search_type: ::std::option::Option<crate::types::SearchAgentContextType>,
}
impl SearchAgentContextInput {
/// <p>Maximum number of results to return per page.</p>
pub fn max_results(&self) -> ::std::option::Option<i32> {
self.max_results
}
/// <p>Opaque continuation token from a prior response. Omit on the first page.</p>
pub fn next_token(&self) -> ::std::option::Option<&str> {
self.next_token.as_deref()
}
/// <p>The agent context to search, by ID or full Amazon Resource Name (ARN).</p>
pub fn agent_context_id(&self) -> ::std::option::Option<&str> {
self.agent_context_id.as_deref()
}
/// <p>The natural-language query or keywords to search for in the agent context. AWS Context interprets it based on <code>searchType</code>: as literal text for <code>KEYWORD</code>, as a semantic concept for <code>SEMANTIC</code>, or as both for <code>AUTO</code>.</p>
pub fn query(&self) -> ::std::option::Option<&str> {
self.query.as_deref()
}
/// <p>Optional filter on node attributes: a single comparison, or <code>andAll</code> of comparisons that must all match.</p>
pub fn filter(&self) -> ::std::option::Option<&crate::types::SearchFilter> {
self.filter.as_ref()
}
/// <p>The search strategy to use. Valid values:</p>
/// <ul>
/// <li>
/// <p><code>KEYWORD</code> - Full-text keyword matching (BM25).</p></li>
/// <li>
/// <p><code>SEMANTIC</code> - Vector similarity of embeddings.</p></li>
/// <li>
/// <p><code>AUTO</code> - Keyword matches first, then semantic matches for the remaining results.</p></li>
/// </ul>
pub fn search_type(&self) -> ::std::option::Option<&crate::types::SearchAgentContextType> {
self.search_type.as_ref()
}
}
impl ::std::fmt::Debug for SearchAgentContextInput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("SearchAgentContextInput");
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &self.next_token);
formatter.field("agent_context_id", &self.agent_context_id);
formatter.field("query", &"*** Sensitive Data Redacted ***");
formatter.field("filter", &"*** Sensitive Data Redacted ***");
formatter.field("search_type", &self.search_type);
formatter.finish()
}
}
impl SearchAgentContextInput {
/// Creates a new builder-style object to manufacture [`SearchAgentContextInput`](crate::operation::search_agent_context::SearchAgentContextInput).
pub fn builder() -> crate::operation::search_agent_context::builders::SearchAgentContextInputBuilder {
crate::operation::search_agent_context::builders::SearchAgentContextInputBuilder::default()
}
}
/// A builder for [`SearchAgentContextInput`](crate::operation::search_agent_context::SearchAgentContextInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct SearchAgentContextInputBuilder {
pub(crate) max_results: ::std::option::Option<i32>,
pub(crate) next_token: ::std::option::Option<::std::string::String>,
pub(crate) agent_context_id: ::std::option::Option<::std::string::String>,
pub(crate) query: ::std::option::Option<::std::string::String>,
pub(crate) filter: ::std::option::Option<crate::types::SearchFilter>,
pub(crate) search_type: ::std::option::Option<crate::types::SearchAgentContextType>,
}
impl SearchAgentContextInputBuilder {
/// <p>Maximum number of results to return per page.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = ::std::option::Option::Some(input);
self
}
/// <p>Maximum number of results to return per page.</p>
pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
/// <p>Maximum number of results to return per page.</p>
pub fn get_max_results(&self) -> &::std::option::Option<i32> {
&self.max_results
}
/// <p>Opaque continuation token from a prior response. Omit on the first page.</p>
pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.next_token = ::std::option::Option::Some(input.into());
self
}
/// <p>Opaque continuation token from a prior response. Omit on the first page.</p>
pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.next_token = input;
self
}
/// <p>Opaque continuation token from a prior response. Omit on the first page.</p>
pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
&self.next_token
}
/// <p>The agent context to search, by ID or full Amazon Resource Name (ARN).</p>
/// This field is required.
pub fn agent_context_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.agent_context_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The agent context to search, by ID or full Amazon Resource Name (ARN).</p>
pub fn set_agent_context_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.agent_context_id = input;
self
}
/// <p>The agent context to search, by ID or full Amazon Resource Name (ARN).</p>
pub fn get_agent_context_id(&self) -> &::std::option::Option<::std::string::String> {
&self.agent_context_id
}
/// <p>The natural-language query or keywords to search for in the agent context. AWS Context interprets it based on <code>searchType</code>: as literal text for <code>KEYWORD</code>, as a semantic concept for <code>SEMANTIC</code>, or as both for <code>AUTO</code>.</p>
/// This field is required.
pub fn query(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.query = ::std::option::Option::Some(input.into());
self
}
/// <p>The natural-language query or keywords to search for in the agent context. AWS Context interprets it based on <code>searchType</code>: as literal text for <code>KEYWORD</code>, as a semantic concept for <code>SEMANTIC</code>, or as both for <code>AUTO</code>.</p>
pub fn set_query(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.query = input;
self
}
/// <p>The natural-language query or keywords to search for in the agent context. AWS Context interprets it based on <code>searchType</code>: as literal text for <code>KEYWORD</code>, as a semantic concept for <code>SEMANTIC</code>, or as both for <code>AUTO</code>.</p>
pub fn get_query(&self) -> &::std::option::Option<::std::string::String> {
&self.query
}
/// <p>Optional filter on node attributes: a single comparison, or <code>andAll</code> of comparisons that must all match.</p>
pub fn filter(mut self, input: crate::types::SearchFilter) -> Self {
self.filter = ::std::option::Option::Some(input);
self
}
/// <p>Optional filter on node attributes: a single comparison, or <code>andAll</code> of comparisons that must all match.</p>
pub fn set_filter(mut self, input: ::std::option::Option<crate::types::SearchFilter>) -> Self {
self.filter = input;
self
}
/// <p>Optional filter on node attributes: a single comparison, or <code>andAll</code> of comparisons that must all match.</p>
pub fn get_filter(&self) -> &::std::option::Option<crate::types::SearchFilter> {
&self.filter
}
/// <p>The search strategy to use. Valid values:</p>
/// <ul>
/// <li>
/// <p><code>KEYWORD</code> - Full-text keyword matching (BM25).</p></li>
/// <li>
/// <p><code>SEMANTIC</code> - Vector similarity of embeddings.</p></li>
/// <li>
/// <p><code>AUTO</code> - Keyword matches first, then semantic matches for the remaining results.</p></li>
/// </ul>
/// This field is required.
pub fn search_type(mut self, input: crate::types::SearchAgentContextType) -> Self {
self.search_type = ::std::option::Option::Some(input);
self
}
/// <p>The search strategy to use. Valid values:</p>
/// <ul>
/// <li>
/// <p><code>KEYWORD</code> - Full-text keyword matching (BM25).</p></li>
/// <li>
/// <p><code>SEMANTIC</code> - Vector similarity of embeddings.</p></li>
/// <li>
/// <p><code>AUTO</code> - Keyword matches first, then semantic matches for the remaining results.</p></li>
/// </ul>
pub fn set_search_type(mut self, input: ::std::option::Option<crate::types::SearchAgentContextType>) -> Self {
self.search_type = input;
self
}
/// <p>The search strategy to use. Valid values:</p>
/// <ul>
/// <li>
/// <p><code>KEYWORD</code> - Full-text keyword matching (BM25).</p></li>
/// <li>
/// <p><code>SEMANTIC</code> - Vector similarity of embeddings.</p></li>
/// <li>
/// <p><code>AUTO</code> - Keyword matches first, then semantic matches for the remaining results.</p></li>
/// </ul>
pub fn get_search_type(&self) -> &::std::option::Option<crate::types::SearchAgentContextType> {
&self.search_type
}
/// Consumes the builder and constructs a [`SearchAgentContextInput`](crate::operation::search_agent_context::SearchAgentContextInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::search_agent_context::SearchAgentContextInput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::search_agent_context::SearchAgentContextInput {
max_results: self.max_results,
next_token: self.next_token,
agent_context_id: self.agent_context_id,
query: self.query,
filter: self.filter,
search_type: self.search_type,
})
}
}
impl ::std::fmt::Debug for SearchAgentContextInputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("SearchAgentContextInputBuilder");
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &self.next_token);
formatter.field("agent_context_id", &self.agent_context_id);
formatter.field("query", &"*** Sensitive Data Redacted ***");
formatter.field("filter", &"*** Sensitive Data Redacted ***");
formatter.field("search_type", &self.search_type);
formatter.finish()
}
}