AWS SDK for C++

AWS SDK for C++ Version 1.11.744

Loading...
Searching...
No Matches
ConverseStreamRequest.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/ConverseStreamHandler.h>
10#include <aws/bedrock-runtime/model/GuardrailStreamConfiguration.h>
11#include <aws/bedrock-runtime/model/InferenceConfiguration.h>
12#include <aws/bedrock-runtime/model/Message.h>
13#include <aws/bedrock-runtime/model/OutputConfig.h>
14#include <aws/bedrock-runtime/model/PerformanceConfiguration.h>
15#include <aws/bedrock-runtime/model/PromptVariableValues.h>
16#include <aws/bedrock-runtime/model/ServiceTier.h>
17#include <aws/bedrock-runtime/model/SystemContentBlock.h>
18#include <aws/bedrock-runtime/model/ToolConfiguration.h>
19#include <aws/core/utils/Document.h>
20#include <aws/core/utils/event/EventStreamDecoder.h>
21#include <aws/core/utils/memory/stl/AWSMap.h>
22#include <aws/core/utils/memory/stl/AWSString.h>
23#include <aws/core/utils/memory/stl/AWSVector.h>
24
25#include <utility>
26
27namespace Aws {
28namespace BedrockRuntime {
29namespace Model {
30
34 public:
35 AWS_BEDROCKRUNTIME_API ConverseStreamRequest() = default;
36
37 // Service request name is the Operation name which will send this request out,
38 // each operation should has unique request name, so that we can get operation's name from this request.
39 // Note: this is not true for response, multiple operations may have the same response name,
40 // so we can not get operation's name from response.
41 inline virtual const char* GetServiceRequestName() const override { return "ConverseStream"; }
42
43 inline virtual bool HasEventStreamResponse() const override { return true; }
44 AWS_BEDROCKRUNTIME_API Aws::String SerializePayload() const override;
45
50
54 inline ConverseStreamHandler& GetEventStreamHandler() { return m_handler; }
55
59 inline void SetEventStreamHandler(const ConverseStreamHandler& value) {
60 m_handler = value;
61 m_decoder.ResetEventStreamHandler(&m_handler);
62 }
63
69 return *this;
70 }
71
73
100 inline const Aws::String& GetModelId() const { return m_modelId; }
101 inline bool ModelIdHasBeenSet() const { return m_modelIdHasBeenSet; }
102 template <typename ModelIdT = Aws::String>
103 void SetModelId(ModelIdT&& value) {
104 m_modelIdHasBeenSet = true;
105 m_modelId = std::forward<ModelIdT>(value);
106 }
107 template <typename ModelIdT = Aws::String>
109 SetModelId(std::forward<ModelIdT>(value));
110 return *this;
111 }
113
115
118 inline const Aws::Vector<Message>& GetMessages() const { return m_messages; }
119 inline bool MessagesHasBeenSet() const { return m_messagesHasBeenSet; }
120 template <typename MessagesT = Aws::Vector<Message>>
121 void SetMessages(MessagesT&& value) {
122 m_messagesHasBeenSet = true;
123 m_messages = std::forward<MessagesT>(value);
124 }
125 template <typename MessagesT = Aws::Vector<Message>>
127 SetMessages(std::forward<MessagesT>(value));
128 return *this;
129 }
130 template <typename MessagesT = Message>
132 m_messagesHasBeenSet = true;
133 m_messages.emplace_back(std::forward<MessagesT>(value));
134 return *this;
135 }
137
139
143 inline const Aws::Vector<SystemContentBlock>& GetSystem() const { return m_system; }
144 inline bool SystemHasBeenSet() const { return m_systemHasBeenSet; }
145 template <typename SystemT = Aws::Vector<SystemContentBlock>>
146 void SetSystem(SystemT&& value) {
147 m_systemHasBeenSet = true;
148 m_system = std::forward<SystemT>(value);
149 }
150 template <typename SystemT = Aws::Vector<SystemContentBlock>>
152 SetSystem(std::forward<SystemT>(value));
153 return *this;
154 }
155 template <typename SystemT = SystemContentBlock>
157 m_systemHasBeenSet = true;
158 m_system.emplace_back(std::forward<SystemT>(value));
159 return *this;
160 }
162
164
170 inline const InferenceConfiguration& GetInferenceConfig() const { return m_inferenceConfig; }
171 inline bool InferenceConfigHasBeenSet() const { return m_inferenceConfigHasBeenSet; }
172 template <typename InferenceConfigT = InferenceConfiguration>
174 m_inferenceConfigHasBeenSet = true;
175 m_inferenceConfig = std::forward<InferenceConfigT>(value);
176 }
177 template <typename InferenceConfigT = InferenceConfiguration>
179 SetInferenceConfig(std::forward<InferenceConfigT>(value));
180 return *this;
181 }
183
185
192 inline const ToolConfiguration& GetToolConfig() const { return m_toolConfig; }
193 inline bool ToolConfigHasBeenSet() const { return m_toolConfigHasBeenSet; }
194 template <typename ToolConfigT = ToolConfiguration>
196 m_toolConfigHasBeenSet = true;
197 m_toolConfig = std::forward<ToolConfigT>(value);
198 }
199 template <typename ToolConfigT = ToolConfiguration>
201 SetToolConfig(std::forward<ToolConfigT>(value));
202 return *this;
203 }
205
207
215 inline const GuardrailStreamConfiguration& GetGuardrailConfig() const { return m_guardrailConfig; }
216 inline bool GuardrailConfigHasBeenSet() const { return m_guardrailConfigHasBeenSet; }
217 template <typename GuardrailConfigT = GuardrailStreamConfiguration>
219 m_guardrailConfigHasBeenSet = true;
220 m_guardrailConfig = std::forward<GuardrailConfigT>(value);
221 }
222 template <typename GuardrailConfigT = GuardrailStreamConfiguration>
224 SetGuardrailConfig(std::forward<GuardrailConfigT>(value));
225 return *this;
226 }
228
230
238 inline Aws::Utils::DocumentView GetAdditionalModelRequestFields() const { return m_additionalModelRequestFields; }
239 inline bool AdditionalModelRequestFieldsHasBeenSet() const { return m_additionalModelRequestFieldsHasBeenSet; }
240 template <typename AdditionalModelRequestFieldsT = Aws::Utils::Document>
242 m_additionalModelRequestFieldsHasBeenSet = true;
243 m_additionalModelRequestFields = std::forward<AdditionalModelRequestFieldsT>(value);
244 }
245 template <typename AdditionalModelRequestFieldsT = Aws::Utils::Document>
247 SetAdditionalModelRequestFields(std::forward<AdditionalModelRequestFieldsT>(value));
248 return *this;
249 }
251
253
259 inline const Aws::Map<Aws::String, PromptVariableValues>& GetPromptVariables() const { return m_promptVariables; }
260 inline bool PromptVariablesHasBeenSet() const { return m_promptVariablesHasBeenSet; }
261 template <typename PromptVariablesT = Aws::Map<Aws::String, PromptVariableValues>>
263 m_promptVariablesHasBeenSet = true;
264 m_promptVariables = std::forward<PromptVariablesT>(value);
265 }
266 template <typename PromptVariablesT = Aws::Map<Aws::String, PromptVariableValues>>
268 SetPromptVariables(std::forward<PromptVariablesT>(value));
269 return *this;
270 }
271 template <typename PromptVariablesKeyT = Aws::String, typename PromptVariablesValueT = PromptVariableValues>
273 m_promptVariablesHasBeenSet = true;
274 m_promptVariables.emplace(std::forward<PromptVariablesKeyT>(key), std::forward<PromptVariablesValueT>(value));
275 return *this;
276 }
278
280
294 inline const Aws::Vector<Aws::String>& GetAdditionalModelResponseFieldPaths() const { return m_additionalModelResponseFieldPaths; }
295 inline bool AdditionalModelResponseFieldPathsHasBeenSet() const { return m_additionalModelResponseFieldPathsHasBeenSet; }
296 template <typename AdditionalModelResponseFieldPathsT = Aws::Vector<Aws::String>>
298 m_additionalModelResponseFieldPathsHasBeenSet = true;
299 m_additionalModelResponseFieldPaths = std::forward<AdditionalModelResponseFieldPathsT>(value);
300 }
301 template <typename AdditionalModelResponseFieldPathsT = Aws::Vector<Aws::String>>
303 SetAdditionalModelResponseFieldPaths(std::forward<AdditionalModelResponseFieldPathsT>(value));
304 return *this;
305 }
306 template <typename AdditionalModelResponseFieldPathsT = Aws::String>
308 m_additionalModelResponseFieldPathsHasBeenSet = true;
309 m_additionalModelResponseFieldPaths.emplace_back(std::forward<AdditionalModelResponseFieldPathsT>(value));
310 return *this;
311 }
313
315
318 inline const Aws::Map<Aws::String, Aws::String>& GetRequestMetadata() const { return m_requestMetadata; }
319 inline bool RequestMetadataHasBeenSet() const { return m_requestMetadataHasBeenSet; }
320 template <typename RequestMetadataT = Aws::Map<Aws::String, Aws::String>>
322 m_requestMetadataHasBeenSet = true;
323 m_requestMetadata = std::forward<RequestMetadataT>(value);
324 }
325 template <typename RequestMetadataT = Aws::Map<Aws::String, Aws::String>>
327 SetRequestMetadata(std::forward<RequestMetadataT>(value));
328 return *this;
329 }
330 template <typename RequestMetadataKeyT = Aws::String, typename RequestMetadataValueT = Aws::String>
332 m_requestMetadataHasBeenSet = true;
333 m_requestMetadata.emplace(std::forward<RequestMetadataKeyT>(key), std::forward<RequestMetadataValueT>(value));
334 return *this;
335 }
337
339
342 inline const PerformanceConfiguration& GetPerformanceConfig() const { return m_performanceConfig; }
343 inline bool PerformanceConfigHasBeenSet() const { return m_performanceConfigHasBeenSet; }
344 template <typename PerformanceConfigT = PerformanceConfiguration>
346 m_performanceConfigHasBeenSet = true;
347 m_performanceConfig = std::forward<PerformanceConfigT>(value);
348 }
349 template <typename PerformanceConfigT = PerformanceConfiguration>
351 SetPerformanceConfig(std::forward<PerformanceConfigT>(value));
352 return *this;
353 }
355
357
360 inline const ServiceTier& GetServiceTier() const { return m_serviceTier; }
361 inline bool ServiceTierHasBeenSet() const { return m_serviceTierHasBeenSet; }
362 template <typename ServiceTierT = ServiceTier>
364 m_serviceTierHasBeenSet = true;
365 m_serviceTier = std::forward<ServiceTierT>(value);
366 }
367 template <typename ServiceTierT = ServiceTier>
369 SetServiceTier(std::forward<ServiceTierT>(value));
370 return *this;
371 }
373
375
378 inline const OutputConfig& GetOutputConfig() const { return m_outputConfig; }
379 inline bool OutputConfigHasBeenSet() const { return m_outputConfigHasBeenSet; }
380 template <typename OutputConfigT = OutputConfig>
382 m_outputConfigHasBeenSet = true;
383 m_outputConfig = std::forward<OutputConfigT>(value);
384 }
385 template <typename OutputConfigT = OutputConfig>
387 SetOutputConfig(std::forward<OutputConfigT>(value));
388 return *this;
389 }
391 private:
392 Aws::String m_modelId;
393
394 Aws::Vector<Message> m_messages;
395
397
398 InferenceConfiguration m_inferenceConfig;
399
400 ToolConfiguration m_toolConfig;
401
402 GuardrailStreamConfiguration m_guardrailConfig;
403
404 Aws::Utils::Document m_additionalModelRequestFields;
405
407
408 Aws::Vector<Aws::String> m_additionalModelResponseFieldPaths;
409
410 Aws::Map<Aws::String, Aws::String> m_requestMetadata;
411
412 PerformanceConfiguration m_performanceConfig;
413
414 ServiceTier m_serviceTier;
415
416 OutputConfig m_outputConfig;
417 ConverseStreamHandler m_handler;
419
420 bool m_modelIdHasBeenSet = false;
421 bool m_messagesHasBeenSet = false;
422 bool m_systemHasBeenSet = false;
423 bool m_inferenceConfigHasBeenSet = false;
424 bool m_toolConfigHasBeenSet = false;
425 bool m_guardrailConfigHasBeenSet = false;
426 bool m_additionalModelRequestFieldsHasBeenSet = false;
427 bool m_promptVariablesHasBeenSet = false;
428 bool m_additionalModelResponseFieldPathsHasBeenSet = false;
429 bool m_requestMetadataHasBeenSet = false;
430 bool m_performanceConfigHasBeenSet = false;
431 bool m_serviceTierHasBeenSet = false;
432 bool m_outputConfigHasBeenSet = false;
433};
434
435} // namespace Model
436} // namespace BedrockRuntime
437} // namespace Aws
ConverseStreamRequest & WithEventStreamHandler(const ConverseStreamHandler &value)
ConverseStreamRequest & WithAdditionalModelRequestFields(AdditionalModelRequestFieldsT &&value)
const Aws::Vector< SystemContentBlock > & GetSystem() const
const Aws::Map< Aws::String, Aws::String > & GetRequestMetadata() const
void SetAdditionalModelRequestFields(AdditionalModelRequestFieldsT &&value)
ConverseStreamRequest & WithModelId(ModelIdT &&value)
void SetEventStreamHandler(const ConverseStreamHandler &value)
ConverseStreamRequest & WithToolConfig(ToolConfigT &&value)
AWS_BEDROCKRUNTIME_API ConverseStreamRequest()=default
const Aws::Vector< Aws::String > & GetAdditionalModelResponseFieldPaths() const
ConverseStreamRequest & WithRequestMetadata(RequestMetadataT &&value)
ConverseStreamRequest & WithServiceTier(ServiceTierT &&value)
ConverseStreamRequest & AddMessages(MessagesT &&value)
ConverseStreamRequest & AddPromptVariables(PromptVariablesKeyT &&key, PromptVariablesValueT &&value)
ConverseStreamRequest & AddSystem(SystemT &&value)
Aws::Utils::Event::EventStreamDecoder & GetEventStreamDecoder()
ConverseStreamRequest & WithOutputConfig(OutputConfigT &&value)
ConverseStreamRequest & WithInferenceConfig(InferenceConfigT &&value)
const Aws::Map< Aws::String, PromptVariableValues > & GetPromptVariables() const
ConverseStreamRequest & WithSystem(SystemT &&value)
ConverseStreamRequest & AddAdditionalModelResponseFieldPaths(AdditionalModelResponseFieldPathsT &&value)
ConverseStreamRequest & WithMessages(MessagesT &&value)
const PerformanceConfiguration & GetPerformanceConfig() const
const GuardrailStreamConfiguration & GetGuardrailConfig() const
const Aws::Vector< Message > & GetMessages() const
ConverseStreamRequest & WithPromptVariables(PromptVariablesT &&value)
ConverseStreamRequest & AddRequestMetadata(RequestMetadataKeyT &&key, RequestMetadataValueT &&value)
void SetAdditionalModelResponseFieldPaths(AdditionalModelResponseFieldPathsT &&value)
virtual const char * GetServiceRequestName() const override
ConverseStreamRequest & WithAdditionalModelResponseFieldPaths(AdditionalModelResponseFieldPathsT &&value)
const InferenceConfiguration & GetInferenceConfig() const
ConverseStreamRequest & WithGuardrailConfig(GuardrailConfigT &&value)
AWS_BEDROCKRUNTIME_API Aws::String SerializePayload() const override
Aws::Utils::DocumentView GetAdditionalModelRequestFields() const
ConverseStreamRequest & WithPerformanceConfig(PerformanceConfigT &&value)
void ResetEventStreamHandler(EventStreamHandler *handler)
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