AWS SDK for C++

AWS SDK for C++ Version 1.11.695

Loading...
Searching...
No Matches
ConverseRequest.h
1
6#pragma once
7#include <aws/bedrock-runtime/BedrockRuntimeRequest.h>
8#include <aws/bedrock-runtime/BedrockRuntime_EXPORTS.h>
9#include <aws/bedrock-runtime/model/GuardrailConfiguration.h>
10#include <aws/bedrock-runtime/model/InferenceConfiguration.h>
11#include <aws/bedrock-runtime/model/Message.h>
12#include <aws/bedrock-runtime/model/PerformanceConfiguration.h>
13#include <aws/bedrock-runtime/model/PromptVariableValues.h>
14#include <aws/bedrock-runtime/model/ServiceTier.h>
15#include <aws/bedrock-runtime/model/SystemContentBlock.h>
16#include <aws/bedrock-runtime/model/ToolConfiguration.h>
17#include <aws/core/utils/Document.h>
18#include <aws/core/utils/memory/stl/AWSMap.h>
19#include <aws/core/utils/memory/stl/AWSString.h>
20#include <aws/core/utils/memory/stl/AWSVector.h>
21
22#include <utility>
23
24namespace Aws {
25namespace BedrockRuntime {
26namespace Model {
27
31 public:
32 AWS_BEDROCKRUNTIME_API ConverseRequest() = default;
33
34 // Service request name is the Operation name which will send this request out,
35 // each operation should has unique request name, so that we can get operation's name from this request.
36 // Note: this is not true for response, multiple operations may have the same response name,
37 // so we can not get operation's name from response.
38 inline virtual const char* GetServiceRequestName() const override { return "Converse"; }
39
40 AWS_BEDROCKRUNTIME_API Aws::String SerializePayload() const override;
41
43
70 inline const Aws::String& GetModelId() const { return m_modelId; }
71 inline bool ModelIdHasBeenSet() const { return m_modelIdHasBeenSet; }
72 template <typename ModelIdT = Aws::String>
73 void SetModelId(ModelIdT&& value) {
74 m_modelIdHasBeenSet = true;
75 m_modelId = std::forward<ModelIdT>(value);
76 }
77 template <typename ModelIdT = Aws::String>
78 ConverseRequest& WithModelId(ModelIdT&& value) {
79 SetModelId(std::forward<ModelIdT>(value));
80 return *this;
81 }
83
85
88 inline const Aws::Vector<Message>& GetMessages() const { return m_messages; }
89 inline bool MessagesHasBeenSet() const { return m_messagesHasBeenSet; }
90 template <typename MessagesT = Aws::Vector<Message>>
91 void SetMessages(MessagesT&& value) {
92 m_messagesHasBeenSet = true;
93 m_messages = std::forward<MessagesT>(value);
94 }
95 template <typename MessagesT = Aws::Vector<Message>>
96 ConverseRequest& WithMessages(MessagesT&& value) {
97 SetMessages(std::forward<MessagesT>(value));
98 return *this;
99 }
100 template <typename MessagesT = Message>
101 ConverseRequest& AddMessages(MessagesT&& value) {
102 m_messagesHasBeenSet = true;
103 m_messages.emplace_back(std::forward<MessagesT>(value));
104 return *this;
105 }
107
109
113 inline const Aws::Vector<SystemContentBlock>& GetSystem() const { return m_system; }
114 inline bool SystemHasBeenSet() const { return m_systemHasBeenSet; }
115 template <typename SystemT = Aws::Vector<SystemContentBlock>>
116 void SetSystem(SystemT&& value) {
117 m_systemHasBeenSet = true;
118 m_system = std::forward<SystemT>(value);
119 }
120 template <typename SystemT = Aws::Vector<SystemContentBlock>>
121 ConverseRequest& WithSystem(SystemT&& value) {
122 SetSystem(std::forward<SystemT>(value));
123 return *this;
124 }
125 template <typename SystemT = SystemContentBlock>
126 ConverseRequest& AddSystem(SystemT&& value) {
127 m_systemHasBeenSet = true;
128 m_system.emplace_back(std::forward<SystemT>(value));
129 return *this;
130 }
132
134
140 inline const InferenceConfiguration& GetInferenceConfig() const { return m_inferenceConfig; }
141 inline bool InferenceConfigHasBeenSet() const { return m_inferenceConfigHasBeenSet; }
142 template <typename InferenceConfigT = InferenceConfiguration>
143 void SetInferenceConfig(InferenceConfigT&& value) {
144 m_inferenceConfigHasBeenSet = true;
145 m_inferenceConfig = std::forward<InferenceConfigT>(value);
146 }
147 template <typename InferenceConfigT = InferenceConfiguration>
148 ConverseRequest& WithInferenceConfig(InferenceConfigT&& value) {
149 SetInferenceConfig(std::forward<InferenceConfigT>(value));
150 return *this;
151 }
153
155
162 inline const ToolConfiguration& GetToolConfig() const { return m_toolConfig; }
163 inline bool ToolConfigHasBeenSet() const { return m_toolConfigHasBeenSet; }
164 template <typename ToolConfigT = ToolConfiguration>
165 void SetToolConfig(ToolConfigT&& value) {
166 m_toolConfigHasBeenSet = true;
167 m_toolConfig = std::forward<ToolConfigT>(value);
168 }
169 template <typename ToolConfigT = ToolConfiguration>
170 ConverseRequest& WithToolConfig(ToolConfigT&& value) {
171 SetToolConfig(std::forward<ToolConfigT>(value));
172 return *this;
173 }
175
177
185 inline const GuardrailConfiguration& GetGuardrailConfig() const { return m_guardrailConfig; }
186 inline bool GuardrailConfigHasBeenSet() const { return m_guardrailConfigHasBeenSet; }
187 template <typename GuardrailConfigT = GuardrailConfiguration>
188 void SetGuardrailConfig(GuardrailConfigT&& value) {
189 m_guardrailConfigHasBeenSet = true;
190 m_guardrailConfig = std::forward<GuardrailConfigT>(value);
191 }
192 template <typename GuardrailConfigT = GuardrailConfiguration>
193 ConverseRequest& WithGuardrailConfig(GuardrailConfigT&& value) {
194 SetGuardrailConfig(std::forward<GuardrailConfigT>(value));
195 return *this;
196 }
198
200
208 inline Aws::Utils::DocumentView GetAdditionalModelRequestFields() const { return m_additionalModelRequestFields; }
209 inline bool AdditionalModelRequestFieldsHasBeenSet() const { return m_additionalModelRequestFieldsHasBeenSet; }
210 template <typename AdditionalModelRequestFieldsT = Aws::Utils::Document>
211 void SetAdditionalModelRequestFields(AdditionalModelRequestFieldsT&& value) {
212 m_additionalModelRequestFieldsHasBeenSet = true;
213 m_additionalModelRequestFields = std::forward<AdditionalModelRequestFieldsT>(value);
214 }
215 template <typename AdditionalModelRequestFieldsT = Aws::Utils::Document>
216 ConverseRequest& WithAdditionalModelRequestFields(AdditionalModelRequestFieldsT&& value) {
217 SetAdditionalModelRequestFields(std::forward<AdditionalModelRequestFieldsT>(value));
218 return *this;
219 }
221
223
229 inline const Aws::Map<Aws::String, PromptVariableValues>& GetPromptVariables() const { return m_promptVariables; }
230 inline bool PromptVariablesHasBeenSet() const { return m_promptVariablesHasBeenSet; }
231 template <typename PromptVariablesT = Aws::Map<Aws::String, PromptVariableValues>>
232 void SetPromptVariables(PromptVariablesT&& value) {
233 m_promptVariablesHasBeenSet = true;
234 m_promptVariables = std::forward<PromptVariablesT>(value);
235 }
236 template <typename PromptVariablesT = Aws::Map<Aws::String, PromptVariableValues>>
237 ConverseRequest& WithPromptVariables(PromptVariablesT&& value) {
238 SetPromptVariables(std::forward<PromptVariablesT>(value));
239 return *this;
240 }
241 template <typename PromptVariablesKeyT = Aws::String, typename PromptVariablesValueT = PromptVariableValues>
242 ConverseRequest& AddPromptVariables(PromptVariablesKeyT&& key, PromptVariablesValueT&& value) {
243 m_promptVariablesHasBeenSet = true;
244 m_promptVariables.emplace(std::forward<PromptVariablesKeyT>(key), std::forward<PromptVariablesValueT>(value));
245 return *this;
246 }
248
250
264 inline const Aws::Vector<Aws::String>& GetAdditionalModelResponseFieldPaths() const { return m_additionalModelResponseFieldPaths; }
265 inline bool AdditionalModelResponseFieldPathsHasBeenSet() const { return m_additionalModelResponseFieldPathsHasBeenSet; }
266 template <typename AdditionalModelResponseFieldPathsT = Aws::Vector<Aws::String>>
267 void SetAdditionalModelResponseFieldPaths(AdditionalModelResponseFieldPathsT&& value) {
268 m_additionalModelResponseFieldPathsHasBeenSet = true;
269 m_additionalModelResponseFieldPaths = std::forward<AdditionalModelResponseFieldPathsT>(value);
270 }
271 template <typename AdditionalModelResponseFieldPathsT = Aws::Vector<Aws::String>>
272 ConverseRequest& WithAdditionalModelResponseFieldPaths(AdditionalModelResponseFieldPathsT&& value) {
273 SetAdditionalModelResponseFieldPaths(std::forward<AdditionalModelResponseFieldPathsT>(value));
274 return *this;
275 }
276 template <typename AdditionalModelResponseFieldPathsT = Aws::String>
277 ConverseRequest& AddAdditionalModelResponseFieldPaths(AdditionalModelResponseFieldPathsT&& value) {
278 m_additionalModelResponseFieldPathsHasBeenSet = true;
279 m_additionalModelResponseFieldPaths.emplace_back(std::forward<AdditionalModelResponseFieldPathsT>(value));
280 return *this;
281 }
283
285
288 inline const Aws::Map<Aws::String, Aws::String>& GetRequestMetadata() const { return m_requestMetadata; }
289 inline bool RequestMetadataHasBeenSet() const { return m_requestMetadataHasBeenSet; }
290 template <typename RequestMetadataT = Aws::Map<Aws::String, Aws::String>>
291 void SetRequestMetadata(RequestMetadataT&& value) {
292 m_requestMetadataHasBeenSet = true;
293 m_requestMetadata = std::forward<RequestMetadataT>(value);
294 }
295 template <typename RequestMetadataT = Aws::Map<Aws::String, Aws::String>>
296 ConverseRequest& WithRequestMetadata(RequestMetadataT&& value) {
297 SetRequestMetadata(std::forward<RequestMetadataT>(value));
298 return *this;
299 }
300 template <typename RequestMetadataKeyT = Aws::String, typename RequestMetadataValueT = Aws::String>
301 ConverseRequest& AddRequestMetadata(RequestMetadataKeyT&& key, RequestMetadataValueT&& value) {
302 m_requestMetadataHasBeenSet = true;
303 m_requestMetadata.emplace(std::forward<RequestMetadataKeyT>(key), std::forward<RequestMetadataValueT>(value));
304 return *this;
305 }
307
309
312 inline const PerformanceConfiguration& GetPerformanceConfig() const { return m_performanceConfig; }
313 inline bool PerformanceConfigHasBeenSet() const { return m_performanceConfigHasBeenSet; }
314 template <typename PerformanceConfigT = PerformanceConfiguration>
315 void SetPerformanceConfig(PerformanceConfigT&& value) {
316 m_performanceConfigHasBeenSet = true;
317 m_performanceConfig = std::forward<PerformanceConfigT>(value);
318 }
319 template <typename PerformanceConfigT = PerformanceConfiguration>
320 ConverseRequest& WithPerformanceConfig(PerformanceConfigT&& value) {
321 SetPerformanceConfig(std::forward<PerformanceConfigT>(value));
322 return *this;
323 }
325
327
330 inline const ServiceTier& GetServiceTier() const { return m_serviceTier; }
331 inline bool ServiceTierHasBeenSet() const { return m_serviceTierHasBeenSet; }
332 template <typename ServiceTierT = ServiceTier>
333 void SetServiceTier(ServiceTierT&& value) {
334 m_serviceTierHasBeenSet = true;
335 m_serviceTier = std::forward<ServiceTierT>(value);
336 }
337 template <typename ServiceTierT = ServiceTier>
338 ConverseRequest& WithServiceTier(ServiceTierT&& value) {
339 SetServiceTier(std::forward<ServiceTierT>(value));
340 return *this;
341 }
343 private:
344 Aws::String m_modelId;
345 bool m_modelIdHasBeenSet = false;
346
347 Aws::Vector<Message> m_messages;
348 bool m_messagesHasBeenSet = false;
349
351 bool m_systemHasBeenSet = false;
352
353 InferenceConfiguration m_inferenceConfig;
354 bool m_inferenceConfigHasBeenSet = false;
355
356 ToolConfiguration m_toolConfig;
357 bool m_toolConfigHasBeenSet = false;
358
359 GuardrailConfiguration m_guardrailConfig;
360 bool m_guardrailConfigHasBeenSet = false;
361
362 Aws::Utils::Document m_additionalModelRequestFields;
363 bool m_additionalModelRequestFieldsHasBeenSet = false;
364
366 bool m_promptVariablesHasBeenSet = false;
367
368 Aws::Vector<Aws::String> m_additionalModelResponseFieldPaths;
369 bool m_additionalModelResponseFieldPathsHasBeenSet = false;
370
371 Aws::Map<Aws::String, Aws::String> m_requestMetadata;
372 bool m_requestMetadataHasBeenSet = false;
373
374 PerformanceConfiguration m_performanceConfig;
375 bool m_performanceConfigHasBeenSet = false;
376
377 ServiceTier m_serviceTier;
378 bool m_serviceTierHasBeenSet = false;
379};
380
381} // namespace Model
382} // namespace BedrockRuntime
383} // namespace Aws
ConverseRequest & AddPromptVariables(PromptVariablesKeyT &&key, PromptVariablesValueT &&value)
ConverseRequest & WithAdditionalModelResponseFieldPaths(AdditionalModelResponseFieldPathsT &&value)
ConverseRequest & WithGuardrailConfig(GuardrailConfigT &&value)
ConverseRequest & WithAdditionalModelRequestFields(AdditionalModelRequestFieldsT &&value)
ConverseRequest & AddRequestMetadata(RequestMetadataKeyT &&key, RequestMetadataValueT &&value)
Aws::Utils::DocumentView GetAdditionalModelRequestFields() const
ConverseRequest & WithServiceTier(ServiceTierT &&value)
virtual const char * GetServiceRequestName() const override
ConverseRequest & WithMessages(MessagesT &&value)
const InferenceConfiguration & GetInferenceConfig() const
void SetPromptVariables(PromptVariablesT &&value)
const GuardrailConfiguration & GetGuardrailConfig() const
ConverseRequest & WithToolConfig(ToolConfigT &&value)
ConverseRequest & WithModelId(ModelIdT &&value)
ConverseRequest & WithSystem(SystemT &&value)
const Aws::Vector< SystemContentBlock > & GetSystem() const
const PerformanceConfiguration & GetPerformanceConfig() const
ConverseRequest & AddSystem(SystemT &&value)
ConverseRequest & AddMessages(MessagesT &&value)
const Aws::Map< Aws::String, PromptVariableValues > & GetPromptVariables() const
ConverseRequest & AddAdditionalModelResponseFieldPaths(AdditionalModelResponseFieldPathsT &&value)
const Aws::Map< Aws::String, Aws::String > & GetRequestMetadata() const
ConverseRequest & WithInferenceConfig(InferenceConfigT &&value)
void SetRequestMetadata(RequestMetadataT &&value)
ConverseRequest & WithRequestMetadata(RequestMetadataT &&value)
ConverseRequest & WithPromptVariables(PromptVariablesT &&value)
const ToolConfiguration & GetToolConfig() const
void SetPerformanceConfig(PerformanceConfigT &&value)
AWS_BEDROCKRUNTIME_API ConverseRequest()=default
AWS_BEDROCKRUNTIME_API Aws::String SerializePayload() const override
void SetAdditionalModelRequestFields(AdditionalModelRequestFieldsT &&value)
const Aws::Vector< Message > & GetMessages() const
void SetAdditionalModelResponseFieldPaths(AdditionalModelResponseFieldPathsT &&value)
void SetGuardrailConfig(GuardrailConfigT &&value)
ConverseRequest & WithPerformanceConfig(PerformanceConfigT &&value)
void SetInferenceConfig(InferenceConfigT &&value)
const Aws::Vector< Aws::String > & GetAdditionalModelResponseFieldPaths() const
std::map< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > > Map
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector