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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A question to answer against an agent context, and optional settings for how the answer is retrieved.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AgenticRetrieveStreamInput {
/// <p>The agent context to retrieve from, by its ID or ARN.</p>
pub agent_context_id: ::std::option::Option<::std::string::String>,
/// <p>The conversation, as an ordered list of turns. A single-question caller sends one user message. The list carries multi-turn history so a follow-up resolves against earlier turns.</p>
pub messages: ::std::option::Option<::std::vec::Vec<crate::types::Message>>,
/// <p>Optional. A key that you supply to group related calls, for example the turns of one conversation, for trace storage and analysis. Grouping is per account, across agent contexts, so use a value that is unique to each conversation.</p>
pub session_id: ::std::option::Option<::std::string::String>,
/// <p>Optional controls for post-call analysis of the retrieval: whether its trace is stored for analysis. Trace events are streamed either way.</p>
pub analysis_configuration: ::std::option::Option<crate::types::AnalysisConfiguration>,
/// <p>Optional bounds and configuration for the agent loop.</p>
pub retrieval_configuration: ::std::option::Option<crate::types::StreamRetrievalConfiguration>,
}
impl AgenticRetrieveStreamInput {
/// <p>The agent context to retrieve from, by its ID or ARN.</p>
pub fn agent_context_id(&self) -> ::std::option::Option<&str> {
self.agent_context_id.as_deref()
}
/// <p>The conversation, as an ordered list of turns. A single-question caller sends one user message. The list carries multi-turn history so a follow-up resolves against earlier turns.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.messages.is_none()`.
pub fn messages(&self) -> &[crate::types::Message] {
self.messages.as_deref().unwrap_or_default()
}
/// <p>Optional. A key that you supply to group related calls, for example the turns of one conversation, for trace storage and analysis. Grouping is per account, across agent contexts, so use a value that is unique to each conversation.</p>
pub fn session_id(&self) -> ::std::option::Option<&str> {
self.session_id.as_deref()
}
/// <p>Optional controls for post-call analysis of the retrieval: whether its trace is stored for analysis. Trace events are streamed either way.</p>
pub fn analysis_configuration(&self) -> ::std::option::Option<&crate::types::AnalysisConfiguration> {
self.analysis_configuration.as_ref()
}
/// <p>Optional bounds and configuration for the agent loop.</p>
pub fn retrieval_configuration(&self) -> ::std::option::Option<&crate::types::StreamRetrievalConfiguration> {
self.retrieval_configuration.as_ref()
}
}
impl AgenticRetrieveStreamInput {
/// Creates a new builder-style object to manufacture [`AgenticRetrieveStreamInput`](crate::operation::agentic_retrieve_stream::AgenticRetrieveStreamInput).
pub fn builder() -> crate::operation::agentic_retrieve_stream::builders::AgenticRetrieveStreamInputBuilder {
crate::operation::agentic_retrieve_stream::builders::AgenticRetrieveStreamInputBuilder::default()
}
}
/// A builder for [`AgenticRetrieveStreamInput`](crate::operation::agentic_retrieve_stream::AgenticRetrieveStreamInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AgenticRetrieveStreamInputBuilder {
pub(crate) agent_context_id: ::std::option::Option<::std::string::String>,
pub(crate) messages: ::std::option::Option<::std::vec::Vec<crate::types::Message>>,
pub(crate) session_id: ::std::option::Option<::std::string::String>,
pub(crate) analysis_configuration: ::std::option::Option<crate::types::AnalysisConfiguration>,
pub(crate) retrieval_configuration: ::std::option::Option<crate::types::StreamRetrievalConfiguration>,
}
impl AgenticRetrieveStreamInputBuilder {
/// <p>The agent context to retrieve from, by its ID or 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 retrieve from, by its ID or 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 retrieve from, by its ID or ARN.</p>
pub fn get_agent_context_id(&self) -> &::std::option::Option<::std::string::String> {
&self.agent_context_id
}
/// Appends an item to `messages`.
///
/// To override the contents of this collection use [`set_messages`](Self::set_messages).
///
/// <p>The conversation, as an ordered list of turns. A single-question caller sends one user message. The list carries multi-turn history so a follow-up resolves against earlier turns.</p>
pub fn messages(mut self, input: crate::types::Message) -> Self {
let mut v = self.messages.unwrap_or_default();
v.push(input);
self.messages = ::std::option::Option::Some(v);
self
}
/// <p>The conversation, as an ordered list of turns. A single-question caller sends one user message. The list carries multi-turn history so a follow-up resolves against earlier turns.</p>
pub fn set_messages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Message>>) -> Self {
self.messages = input;
self
}
/// <p>The conversation, as an ordered list of turns. A single-question caller sends one user message. The list carries multi-turn history so a follow-up resolves against earlier turns.</p>
pub fn get_messages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Message>> {
&self.messages
}
/// <p>Optional. A key that you supply to group related calls, for example the turns of one conversation, for trace storage and analysis. Grouping is per account, across agent contexts, so use a value that is unique to each conversation.</p>
pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.session_id = ::std::option::Option::Some(input.into());
self
}
/// <p>Optional. A key that you supply to group related calls, for example the turns of one conversation, for trace storage and analysis. Grouping is per account, across agent contexts, so use a value that is unique to each conversation.</p>
pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.session_id = input;
self
}
/// <p>Optional. A key that you supply to group related calls, for example the turns of one conversation, for trace storage and analysis. Grouping is per account, across agent contexts, so use a value that is unique to each conversation.</p>
pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
&self.session_id
}
/// <p>Optional controls for post-call analysis of the retrieval: whether its trace is stored for analysis. Trace events are streamed either way.</p>
pub fn analysis_configuration(mut self, input: crate::types::AnalysisConfiguration) -> Self {
self.analysis_configuration = ::std::option::Option::Some(input);
self
}
/// <p>Optional controls for post-call analysis of the retrieval: whether its trace is stored for analysis. Trace events are streamed either way.</p>
pub fn set_analysis_configuration(mut self, input: ::std::option::Option<crate::types::AnalysisConfiguration>) -> Self {
self.analysis_configuration = input;
self
}
/// <p>Optional controls for post-call analysis of the retrieval: whether its trace is stored for analysis. Trace events are streamed either way.</p>
pub fn get_analysis_configuration(&self) -> &::std::option::Option<crate::types::AnalysisConfiguration> {
&self.analysis_configuration
}
/// <p>Optional bounds and configuration for the agent loop.</p>
pub fn retrieval_configuration(mut self, input: crate::types::StreamRetrievalConfiguration) -> Self {
self.retrieval_configuration = ::std::option::Option::Some(input);
self
}
/// <p>Optional bounds and configuration for the agent loop.</p>
pub fn set_retrieval_configuration(mut self, input: ::std::option::Option<crate::types::StreamRetrievalConfiguration>) -> Self {
self.retrieval_configuration = input;
self
}
/// <p>Optional bounds and configuration for the agent loop.</p>
pub fn get_retrieval_configuration(&self) -> &::std::option::Option<crate::types::StreamRetrievalConfiguration> {
&self.retrieval_configuration
}
/// Consumes the builder and constructs a [`AgenticRetrieveStreamInput`](crate::operation::agentic_retrieve_stream::AgenticRetrieveStreamInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::agentic_retrieve_stream::AgenticRetrieveStreamInput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::agentic_retrieve_stream::AgenticRetrieveStreamInput {
agent_context_id: self.agent_context_id,
messages: self.messages,
session_id: self.session_id,
analysis_configuration: self.analysis_configuration,
retrieval_configuration: self.retrieval_configuration,
})
}
}