AWS SDK for C++

AWS SDK for C++ Version 1.11.743

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/OutputConfig.h>
13#include <aws/bedrock-runtime/model/PerformanceConfiguration.h>
14#include <aws/bedrock-runtime/model/PromptVariableValues.h>
15#include <aws/bedrock-runtime/model/ServiceTier.h>
16#include <aws/bedrock-runtime/model/SystemContentBlock.h>
17#include <aws/bedrock-runtime/model/ToolConfiguration.h>
18#include <aws/core/utils/Document.h>
19#include <aws/core/utils/memory/stl/AWSMap.h>
20#include <aws/core/utils/memory/stl/AWSString.h>
21#include <aws/core/utils/memory/stl/AWSVector.h>
22
23#include <utility>
24
25namespace Aws {
26namespace BedrockRuntime {
27namespace Model {
28
32 public:
33 AWS_BEDROCKRUNTIME_API ConverseRequest() = default;
34
35 // Service request name is the Operation name which will send this request out,
36 // each operation should has unique request name, so that we can get operation's name from this request.
37 // Note: this is not true for response, multiple operations may have the same response name,
38 // so we can not get operation's name from response.
39 inline virtual const char* GetServiceRequestName() const override { return "Converse"; }
40
41 AWS_BEDROCKRUNTIME_API Aws::String SerializePayload() const override;
42
44
71 inline const Aws::String& GetModelId() const { return m_modelId; }
72 inline bool ModelIdHasBeenSet() const { return m_modelIdHasBeenSet; }
73 template <typename ModelIdT = Aws::String>
74 void SetModelId(ModelIdT&& value) {
75 m_modelIdHasBeenSet = true;
76 m_modelId = std::forward<ModelIdT>(value);
77 }
78 template <typename ModelIdT = Aws::String>
80 SetModelId(std::forward<ModelIdT>(value));
81 return *this;
82 }
84
86
89 inline const Aws::Vector<Message>& GetMessages() const { return m_messages; }
90 inline bool MessagesHasBeenSet() const { return m_messagesHasBeenSet; }
91 template <typename MessagesT = Aws::Vector<Message>>
92 void SetMessages(MessagesT&& value) {
93 m_messagesHasBeenSet = true;
94 m_messages = std::forward<MessagesT>(value);
95 }
96 template <typename MessagesT = Aws::Vector<Message>>
98 SetMessages(std::forward<MessagesT>(value));
99 return *this;
100 }
101 template <typename MessagesT = Message>
103 m_messagesHasBeenSet = true;
104 m_messages.emplace_back(std::forward<MessagesT>(value));
105 return *this;
106 }
108
110
114 inline const Aws::Vector<SystemContentBlock>& GetSystem() const { return m_system; }
115 inline bool SystemHasBeenSet() const { return m_systemHasBeenSet; }
116 template <typename SystemT = Aws::Vector<SystemContentBlock>>
117 void SetSystem(SystemT&& value) {
118 m_systemHasBeenSet = true;
119 m_system = std::forward<SystemT>(value);
120 }
121 template <typename SystemT = Aws::Vector<SystemContentBlock>>
123 SetSystem(std::forward<SystemT>(value));
124 return *this;
125 }
126 template <typename SystemT = SystemContentBlock>
128 m_systemHasBeenSet = true;
129 m_system.emplace_back(std::forward<SystemT>(value));
130 return *this;
131 }
133
135
141 inline const InferenceConfiguration& GetInferenceConfig() const { return m_inferenceConfig; }
142 inline bool InferenceConfigHasBeenSet() const { return m_inferenceConfigHasBeenSet; }
143 template <typename InferenceConfigT = InferenceConfiguration>
145 m_inferenceConfigHasBeenSet = true;
146 m_inferenceConfig = std::forward<InferenceConfigT>(value);
147 }
148 template <typename InferenceConfigT = InferenceConfiguration>
150 SetInferenceConfig(std::forward<InferenceConfigT>(value));
151 return *this;
152 }
154
156
163 inline const ToolConfiguration& GetToolConfig() const { return m_toolConfig; }
164 inline bool ToolConfigHasBeenSet() const { return m_toolConfigHasBeenSet; }
165 template <typename ToolConfigT = ToolConfiguration>
167 m_toolConfigHasBeenSet = true;
168 m_toolConfig = std::forward<ToolConfigT>(value);
169 }
170 template <typename ToolConfigT = ToolConfiguration>
172 SetToolConfig(std::forward<ToolConfigT>(value));
173 return *this;
174 }
176
178
186 inline const GuardrailConfiguration& GetGuardrailConfig() const { return m_guardrailConfig; }
187 inline bool GuardrailConfigHasBeenSet() const { return m_guardrailConfigHasBeenSet; }
188 template <typename GuardrailConfigT = GuardrailConfiguration>
190 m_guardrailConfigHasBeenSet = true;
191 m_guardrailConfig = std::forward<GuardrailConfigT>(value);
192 }
193 template <typename GuardrailConfigT = GuardrailConfiguration>
195 SetGuardrailConfig(std::forward<GuardrailConfigT>(value));
196 return *this;
197 }
199
201
209 inline Aws::Utils::DocumentView GetAdditionalModelRequestFields() const { return m_additionalModelRequestFields; }
210 inline bool AdditionalModelRequestFieldsHasBeenSet() const { return m_additionalModelRequestFieldsHasBeenSet; }
211 template <typename AdditionalModelRequestFieldsT = Aws::Utils::Document>
213 m_additionalModelRequestFieldsHasBeenSet = true;
214 m_additionalModelRequestFields = std::forward<AdditionalModelRequestFieldsT>(value);
215 }
216 template <typename AdditionalModelRequestFieldsT = Aws::Utils::Document>
218 SetAdditionalModelRequestFields(std::forward<AdditionalModelRequestFieldsT>(value));
219 return *this;
220 }
222
224
230 inline const Aws::Map<Aws::String, PromptVariableValues>& GetPromptVariables() const { return m_promptVariables; }
231 inline bool PromptVariablesHasBeenSet() const { return m_promptVariablesHasBeenSet; }
232 template <typename PromptVariablesT = Aws::Map<Aws::String, PromptVariableValues>>
234 m_promptVariablesHasBeenSet = true;
235 m_promptVariables = std::forward<PromptVariablesT>(value);
236 }
237 template <typename PromptVariablesT = Aws::Map<Aws::String, PromptVariableValues>>
239 SetPromptVariables(std::forward<PromptVariablesT>(value));
240 return *this;
241 }
242 template <typename PromptVariablesKeyT = Aws::String, typename PromptVariablesValueT = PromptVariableValues>
244 m_promptVariablesHasBeenSet = true;
245 m_promptVariables.emplace(std::forward<PromptVariablesKeyT>(key), std::forward<PromptVariablesValueT>(value));
246 return *this;
247 }
249
251
265 inline const Aws::Vector<Aws::String>& GetAdditionalModelResponseFieldPaths() const { return m_additionalModelResponseFieldPaths; }
266 inline bool AdditionalModelResponseFieldPathsHasBeenSet() const { return m_additionalModelResponseFieldPathsHasBeenSet; }
267 template <typename AdditionalModelResponseFieldPathsT = Aws::Vector<Aws::String>>
269 m_additionalModelResponseFieldPathsHasBeenSet = true;
270 m_additionalModelResponseFieldPaths = std::forward<AdditionalModelResponseFieldPathsT>(value);
271 }
272 template <typename AdditionalModelResponseFieldPathsT = Aws::Vector<Aws::String>>
274 SetAdditionalModelResponseFieldPaths(std::forward<AdditionalModelResponseFieldPathsT>(value));
275 return *this;
276 }
277 template <typename AdditionalModelResponseFieldPathsT = Aws::String>
279 m_additionalModelResponseFieldPathsHasBeenSet = true;
280 m_additionalModelResponseFieldPaths.emplace_back(std::forward<AdditionalModelResponseFieldPathsT>(value));
281 return *this;
282 }
284
286
289 inline const Aws::Map<Aws::String, Aws::String>& GetRequestMetadata() const { return m_requestMetadata; }
290 inline bool RequestMetadataHasBeenSet() const { return m_requestMetadataHasBeenSet; }
291 template <typename RequestMetadataT = Aws::Map<Aws::String, Aws::String>>
293 m_requestMetadataHasBeenSet = true;
294 m_requestMetadata = std::forward<RequestMetadataT>(value);
295 }
296 template <typename RequestMetadataT = Aws::Map<Aws::String, Aws::String>>
298 SetRequestMetadata(std::forward<RequestMetadataT>(value));
299 return *this;
300 }
301 template <typename RequestMetadataKeyT = Aws::String, typename RequestMetadataValueT = Aws::String>
303 m_requestMetadataHasBeenSet = true;
304 m_requestMetadata.emplace(std::forward<RequestMetadataKeyT>(key), std::forward<RequestMetadataValueT>(value));
305 return *this;
306 }
308
310
313 inline const PerformanceConfiguration& GetPerformanceConfig() const { return m_performanceConfig; }
314 inline bool PerformanceConfigHasBeenSet() const { return m_performanceConfigHasBeenSet; }
315 template <typename PerformanceConfigT = PerformanceConfiguration>
317 m_performanceConfigHasBeenSet = true;
318 m_performanceConfig = std::forward<PerformanceConfigT>(value);
319 }
320 template <typename PerformanceConfigT = PerformanceConfiguration>
322 SetPerformanceConfig(std::forward<PerformanceConfigT>(value));
323 return *this;
324 }
326
328
331 inline const ServiceTier& GetServiceTier() const { return m_serviceTier; }
332 inline bool ServiceTierHasBeenSet() const { return m_serviceTierHasBeenSet; }
333 template <typename ServiceTierT = ServiceTier>
335 m_serviceTierHasBeenSet = true;
336 m_serviceTier = std::forward<ServiceTierT>(value);
337 }
338 template <typename ServiceTierT = ServiceTier>
340 SetServiceTier(std::forward<ServiceTierT>(value));
341 return *this;
342 }
344
346
349 inline const OutputConfig& GetOutputConfig() const { return m_outputConfig; }
350 inline bool OutputConfigHasBeenSet() const { return m_outputConfigHasBeenSet; }
351 template <typename OutputConfigT = OutputConfig>
353 m_outputConfigHasBeenSet = true;
354 m_outputConfig = std::forward<OutputConfigT>(value);
355 }
356 template <typename OutputConfigT = OutputConfig>
358 SetOutputConfig(std::forward<OutputConfigT>(value));
359 return *this;
360 }
362 private:
363 Aws::String m_modelId;
364
365 Aws::Vector<Message> m_messages;
366
368
369 InferenceConfiguration m_inferenceConfig;
370
371 ToolConfiguration m_toolConfig;
372
373 GuardrailConfiguration m_guardrailConfig;
374
375 Aws::Utils::Document m_additionalModelRequestFields;
376
378
379 Aws::Vector<Aws::String> m_additionalModelResponseFieldPaths;
380
381 Aws::Map<Aws::String, Aws::String> m_requestMetadata;
382
383 PerformanceConfiguration m_performanceConfig;
384
385 ServiceTier m_serviceTier;
386
387 OutputConfig m_outputConfig;
388 bool m_modelIdHasBeenSet = false;
389 bool m_messagesHasBeenSet = false;
390 bool m_systemHasBeenSet = false;
391 bool m_inferenceConfigHasBeenSet = false;
392 bool m_toolConfigHasBeenSet = false;
393 bool m_guardrailConfigHasBeenSet = false;
394 bool m_additionalModelRequestFieldsHasBeenSet = false;
395 bool m_promptVariablesHasBeenSet = false;
396 bool m_additionalModelResponseFieldPathsHasBeenSet = false;
397 bool m_requestMetadataHasBeenSet = false;
398 bool m_performanceConfigHasBeenSet = false;
399 bool m_serviceTierHasBeenSet = false;
400 bool m_outputConfigHasBeenSet = false;
401};
402
403} // namespace Model
404} // namespace BedrockRuntime
405} // namespace Aws
ConverseRequest & AddPromptVariables(PromptVariablesKeyT &&key, PromptVariablesValueT &&value)
ConverseRequest & WithAdditionalModelResponseFieldPaths(AdditionalModelResponseFieldPathsT &&value)
ConverseRequest & WithGuardrailConfig(GuardrailConfigT &&value)
ConverseRequest & WithAdditionalModelRequestFields(AdditionalModelRequestFieldsT &&value)
ConverseRequest & WithOutputConfig(OutputConfigT &&value)
ConverseRequest & AddRequestMetadata(RequestMetadataKeyT &&key, RequestMetadataValueT &&value)
Aws::Utils::DocumentView GetAdditionalModelRequestFields() const
ConverseRequest & WithServiceTier(ServiceTierT &&value)
virtual const char * GetServiceRequestName() const override
const OutputConfig & GetOutputConfig() const
ConverseRequest & WithMessages(MessagesT &&value)
const InferenceConfiguration & GetInferenceConfig() const
void SetPromptVariables(PromptVariablesT &&value)
const GuardrailConfiguration & GetGuardrailConfig() const
ConverseRequest & WithToolConfig(ToolConfigT &&value)
void SetOutputConfig(OutputConfigT &&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::shared_ptr< T > MakeShared(const char *allocationTag, ArgTypes &&... args)
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