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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct RetrieveAndGenerateInput {
/// <p>The unique identifier of the session. When you first make a <code>RetrieveAndGenerate</code> request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can't explicitly set the <code>sessionId</code> yourself.</p>
pub session_id: ::std::option::Option<::std::string::String>,
/// <p>Contains the query to be made to the knowledge base.</p>
pub input: ::std::option::Option<crate::types::RetrieveAndGenerateInput>,
/// <p>Contains configurations for the knowledge base query and retrieval process. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html">Query configurations</a>.</p>
pub retrieve_and_generate_configuration: ::std::option::Option<crate::types::RetrieveAndGenerateConfiguration>,
/// <p>Contains details about the session with the knowledge base.</p>
pub session_configuration: ::std::option::Option<crate::types::RetrieveAndGenerateSessionConfiguration>,
}
impl RetrieveAndGenerateInput {
/// <p>The unique identifier of the session. When you first make a <code>RetrieveAndGenerate</code> request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can't explicitly set the <code>sessionId</code> yourself.</p>
pub fn session_id(&self) -> ::std::option::Option<&str> {
self.session_id.as_deref()
}
/// <p>Contains the query to be made to the knowledge base.</p>
pub fn input(&self) -> ::std::option::Option<&crate::types::RetrieveAndGenerateInput> {
self.input.as_ref()
}
/// <p>Contains configurations for the knowledge base query and retrieval process. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html">Query configurations</a>.</p>
pub fn retrieve_and_generate_configuration(&self) -> ::std::option::Option<&crate::types::RetrieveAndGenerateConfiguration> {
self.retrieve_and_generate_configuration.as_ref()
}
/// <p>Contains details about the session with the knowledge base.</p>
pub fn session_configuration(&self) -> ::std::option::Option<&crate::types::RetrieveAndGenerateSessionConfiguration> {
self.session_configuration.as_ref()
}
}
impl ::std::fmt::Debug for RetrieveAndGenerateInput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("RetrieveAndGenerateInput");
formatter.field("session_id", &self.session_id);
formatter.field("input", &"*** Sensitive Data Redacted ***");
formatter.field("retrieve_and_generate_configuration", &self.retrieve_and_generate_configuration);
formatter.field("session_configuration", &self.session_configuration);
formatter.finish()
}
}
impl RetrieveAndGenerateInput {
/// Creates a new builder-style object to manufacture [`RetrieveAndGenerateInput`](crate::operation::retrieve_and_generate::RetrieveAndGenerateInput).
pub fn builder() -> crate::operation::retrieve_and_generate::builders::RetrieveAndGenerateInputBuilder {
crate::operation::retrieve_and_generate::builders::RetrieveAndGenerateInputBuilder::default()
}
}
/// A builder for [`RetrieveAndGenerateInput`](crate::operation::retrieve_and_generate::RetrieveAndGenerateInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct RetrieveAndGenerateInputBuilder {
pub(crate) session_id: ::std::option::Option<::std::string::String>,
pub(crate) input: ::std::option::Option<crate::types::RetrieveAndGenerateInput>,
pub(crate) retrieve_and_generate_configuration: ::std::option::Option<crate::types::RetrieveAndGenerateConfiguration>,
pub(crate) session_configuration: ::std::option::Option<crate::types::RetrieveAndGenerateSessionConfiguration>,
}
impl RetrieveAndGenerateInputBuilder {
/// <p>The unique identifier of the session. When you first make a <code>RetrieveAndGenerate</code> request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can't explicitly set the <code>sessionId</code> yourself.</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>The unique identifier of the session. When you first make a <code>RetrieveAndGenerate</code> request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can't explicitly set the <code>sessionId</code> yourself.</p>
pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.session_id = input;
self
}
/// <p>The unique identifier of the session. When you first make a <code>RetrieveAndGenerate</code> request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can't explicitly set the <code>sessionId</code> yourself.</p>
pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
&self.session_id
}
/// <p>Contains the query to be made to the knowledge base.</p>
/// This field is required.
pub fn input(mut self, input: crate::types::RetrieveAndGenerateInput) -> Self {
self.input = ::std::option::Option::Some(input);
self
}
/// <p>Contains the query to be made to the knowledge base.</p>
pub fn set_input(mut self, input: ::std::option::Option<crate::types::RetrieveAndGenerateInput>) -> Self {
self.input = input;
self
}
/// <p>Contains the query to be made to the knowledge base.</p>
pub fn get_input(&self) -> &::std::option::Option<crate::types::RetrieveAndGenerateInput> {
&self.input
}
/// <p>Contains configurations for the knowledge base query and retrieval process. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html">Query configurations</a>.</p>
pub fn retrieve_and_generate_configuration(mut self, input: crate::types::RetrieveAndGenerateConfiguration) -> Self {
self.retrieve_and_generate_configuration = ::std::option::Option::Some(input);
self
}
/// <p>Contains configurations for the knowledge base query and retrieval process. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html">Query configurations</a>.</p>
pub fn set_retrieve_and_generate_configuration(mut self, input: ::std::option::Option<crate::types::RetrieveAndGenerateConfiguration>) -> Self {
self.retrieve_and_generate_configuration = input;
self
}
/// <p>Contains configurations for the knowledge base query and retrieval process. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html">Query configurations</a>.</p>
pub fn get_retrieve_and_generate_configuration(&self) -> &::std::option::Option<crate::types::RetrieveAndGenerateConfiguration> {
&self.retrieve_and_generate_configuration
}
/// <p>Contains details about the session with the knowledge base.</p>
pub fn session_configuration(mut self, input: crate::types::RetrieveAndGenerateSessionConfiguration) -> Self {
self.session_configuration = ::std::option::Option::Some(input);
self
}
/// <p>Contains details about the session with the knowledge base.</p>
pub fn set_session_configuration(mut self, input: ::std::option::Option<crate::types::RetrieveAndGenerateSessionConfiguration>) -> Self {
self.session_configuration = input;
self
}
/// <p>Contains details about the session with the knowledge base.</p>
pub fn get_session_configuration(&self) -> &::std::option::Option<crate::types::RetrieveAndGenerateSessionConfiguration> {
&self.session_configuration
}
/// Consumes the builder and constructs a [`RetrieveAndGenerateInput`](crate::operation::retrieve_and_generate::RetrieveAndGenerateInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::retrieve_and_generate::RetrieveAndGenerateInput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::retrieve_and_generate::RetrieveAndGenerateInput {
session_id: self.session_id,
input: self.input,
retrieve_and_generate_configuration: self.retrieve_and_generate_configuration,
session_configuration: self.session_configuration,
})
}
}
impl ::std::fmt::Debug for RetrieveAndGenerateInputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("RetrieveAndGenerateInputBuilder");
formatter.field("session_id", &self.session_id);
formatter.field("input", &"*** Sensitive Data Redacted ***");
formatter.field("retrieve_and_generate_configuration", &self.retrieve_and_generate_configuration);
formatter.field("session_configuration", &self.session_configuration);
formatter.finish()
}
}