Skip to content

Commit d59b018

Browse files
This release supports Pagination traits on Cost Anomaly Detection APIs.
This release adds resource type "MemoryDbReservedInstances" and resource type "DynamoDbReservedCapacity" to the GetRecommendation, ListRecommendations, and ListRecommendationSummaries APIs to support new MemoryDB and DynamoDB RI recommendations. Added new ActiveDirectoryStatus value, ListCacheReports paginator, and support for longer pagination tokens. This release adds the option to update the strategy of state templates already associated to a vehicle, without the need to remove and re-add them. This release introduces our latest bedrock runtime API, InvokeModelWithBidirectionalStream. The API supports both input and output streams and is supported by only HTTP2.0. Uzbekistan Launch on TaxSettings Page Documentation updates for AWS Security Hub.
1 parent 33a9318 commit d59b018

File tree

77 files changed

+4331
-1515
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+4331
-1515
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.11.542
1+
1.11.543

generated/src/aws-cpp-sdk-bedrock-runtime/include/aws/bedrock-runtime/BedrockRuntimeClient.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,27 @@ namespace BedrockRuntime
315315
return SubmitAsync(&BedrockRuntimeClient::InvokeModel, request, handler, context);
316316
}
317317

318+
/**
319+
* <p>Invoke the specified Amazon Bedrock model to run inference using the
320+
* bidirectional stream. The response is returned in a stream that remains open for
321+
* 8 minutes. A single session can contain multiple prompts and responses from the
322+
* model. The prompts to the model are provided as audio files and the model's
323+
* responses are spoken back to the user and transcribed.</p> <p>It is possible for
324+
* users to interrupt the model's response with a new prompt, which will halt the
325+
* response speech. The model will retain contextual awareness of the conversation
326+
* while pivoting to respond to the new prompt.</p><p><h3>See Also:</h3> <a
327+
* href="http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelWithBidirectionalStream">AWS
328+
* API Reference</a></p>
329+
*
330+
* Queues the request into a thread executor.
331+
* The streamReadyHandler is triggered when the stream is ready to be written to.
332+
* The handler is triggered when the request is finished.
333+
*/
334+
virtual void InvokeModelWithBidirectionalStreamAsync(Model::InvokeModelWithBidirectionalStreamRequest& request,
335+
const InvokeModelWithBidirectionalStreamStreamReadyHandler& streamReadyHandler,
336+
const InvokeModelWithBidirectionalStreamResponseReceivedHandler& handler,
337+
const std::shared_ptr<const Aws::Client::AsyncCallerContext>& handlerContext = nullptr) const;
338+
318339
/**
319340
* <p>Invoke the specified Amazon Bedrock model to run inference using the prompt
320341
* and inference parameters provided in the request body. The response is returned

generated/src/aws-cpp-sdk-bedrock-runtime/include/aws/bedrock-runtime/BedrockRuntimeServiceClientModel.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ namespace Aws
4040
{
4141
template< typename R, typename E> class Outcome;
4242

43+
namespace Event
44+
{
45+
class EventEncoderStream;
46+
} // namespace Event
47+
4348
namespace Threading
4449
{
4550
class Executor;
@@ -71,6 +76,8 @@ namespace Aws
7176
class ConverseStreamRequest;
7277
class GetAsyncInvokeRequest;
7378
class InvokeModelRequest;
79+
class InvokeModelWithBidirectionalStreamRequest;
80+
class InvokeModelWithBidirectionalStreamInput;
7481
class InvokeModelWithResponseStreamRequest;
7582
class ListAsyncInvokesRequest;
7683
class StartAsyncInvokeRequest;
@@ -82,6 +89,7 @@ namespace Aws
8289
typedef Aws::Utils::Outcome<Aws::NoResult, BedrockRuntimeError> ConverseStreamOutcome;
8390
typedef Aws::Utils::Outcome<GetAsyncInvokeResult, BedrockRuntimeError> GetAsyncInvokeOutcome;
8491
typedef Aws::Utils::Outcome<InvokeModelResult, BedrockRuntimeError> InvokeModelOutcome;
92+
typedef Aws::Utils::Outcome<Aws::NoResult, BedrockRuntimeError> InvokeModelWithBidirectionalStreamOutcome;
8593
typedef Aws::Utils::Outcome<Aws::NoResult, BedrockRuntimeError> InvokeModelWithResponseStreamOutcome;
8694
typedef Aws::Utils::Outcome<ListAsyncInvokesResult, BedrockRuntimeError> ListAsyncInvokesOutcome;
8795
typedef Aws::Utils::Outcome<StartAsyncInvokeResult, BedrockRuntimeError> StartAsyncInvokeOutcome;
@@ -93,6 +101,7 @@ namespace Aws
93101
typedef std::future<ConverseStreamOutcome> ConverseStreamOutcomeCallable;
94102
typedef std::future<GetAsyncInvokeOutcome> GetAsyncInvokeOutcomeCallable;
95103
typedef std::future<InvokeModelOutcome> InvokeModelOutcomeCallable;
104+
typedef std::future<InvokeModelWithBidirectionalStreamOutcome> InvokeModelWithBidirectionalStreamOutcomeCallable;
96105
typedef std::future<InvokeModelWithResponseStreamOutcome> InvokeModelWithResponseStreamOutcomeCallable;
97106
typedef std::future<ListAsyncInvokesOutcome> ListAsyncInvokesOutcomeCallable;
98107
typedef std::future<StartAsyncInvokeOutcome> StartAsyncInvokeOutcomeCallable;
@@ -107,6 +116,8 @@ namespace Aws
107116
typedef std::function<void(const BedrockRuntimeClient*, const Model::ConverseStreamRequest&, const Model::ConverseStreamOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ConverseStreamResponseReceivedHandler;
108117
typedef std::function<void(const BedrockRuntimeClient*, const Model::GetAsyncInvokeRequest&, const Model::GetAsyncInvokeOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetAsyncInvokeResponseReceivedHandler;
109118
typedef std::function<void(const BedrockRuntimeClient*, const Model::InvokeModelRequest&, Model::InvokeModelOutcome, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > InvokeModelResponseReceivedHandler;
119+
typedef std::function<void(Model::InvokeModelWithBidirectionalStreamInput&)> InvokeModelWithBidirectionalStreamStreamReadyHandler;
120+
typedef std::function<void(const BedrockRuntimeClient*, const Model::InvokeModelWithBidirectionalStreamRequest&, const Model::InvokeModelWithBidirectionalStreamOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > InvokeModelWithBidirectionalStreamResponseReceivedHandler;
110121
typedef std::function<void(const BedrockRuntimeClient*, const Model::InvokeModelWithResponseStreamRequest&, const Model::InvokeModelWithResponseStreamOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > InvokeModelWithResponseStreamResponseReceivedHandler;
111122
typedef std::function<void(const BedrockRuntimeClient*, const Model::ListAsyncInvokesRequest&, const Model::ListAsyncInvokesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListAsyncInvokesResponseReceivedHandler;
112123
typedef std::function<void(const BedrockRuntimeClient*, const Model::StartAsyncInvokeRequest&, const Model::StartAsyncInvokeOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > StartAsyncInvokeResponseReceivedHandler;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/**
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0.
4+
*/
5+
6+
#pragma once
7+
#include <aws/bedrock-runtime/BedrockRuntime_EXPORTS.h>
8+
#include <aws/core/utils/Array.h>
9+
#include <utility>
10+
11+
namespace Aws
12+
{
13+
namespace Utils
14+
{
15+
namespace Json
16+
{
17+
class JsonValue;
18+
class JsonView;
19+
} // namespace Json
20+
} // namespace Utils
21+
namespace BedrockRuntime
22+
{
23+
namespace Model
24+
{
25+
26+
/**
27+
* <p>Payload content for the bidirectional input. The input is an audio
28+
* stream.</p><p><h3>See Also:</h3> <a
29+
* href="http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/BidirectionalInputPayloadPart">AWS
30+
* API Reference</a></p>
31+
*/
32+
class BidirectionalInputPayloadPart
33+
{
34+
public:
35+
AWS_BEDROCKRUNTIME_API BidirectionalInputPayloadPart() = default;
36+
AWS_BEDROCKRUNTIME_API BidirectionalInputPayloadPart(Aws::Utils::Json::JsonView jsonValue);
37+
AWS_BEDROCKRUNTIME_API BidirectionalInputPayloadPart& operator=(Aws::Utils::Json::JsonView jsonValue);
38+
AWS_BEDROCKRUNTIME_API Aws::Utils::Json::JsonValue Jsonize() const;
39+
40+
41+
///@{
42+
/**
43+
* <p>The audio content for the bidirectional input.</p>
44+
*/
45+
inline const Aws::Utils::CryptoBuffer& GetBytes() const { return m_bytes; }
46+
inline bool BytesHasBeenSet() const { return m_bytesHasBeenSet; }
47+
template<typename BytesT = Aws::Utils::CryptoBuffer>
48+
void SetBytes(BytesT&& value) { m_bytesHasBeenSet = true; m_bytes = std::forward<BytesT>(value); }
49+
template<typename BytesT = Aws::Utils::CryptoBuffer>
50+
BidirectionalInputPayloadPart& WithBytes(BytesT&& value) { SetBytes(std::forward<BytesT>(value)); return *this;}
51+
///@}
52+
private:
53+
54+
Aws::Utils::CryptoBuffer m_bytes{};
55+
bool m_bytesHasBeenSet = false;
56+
};
57+
58+
} // namespace Model
59+
} // namespace BedrockRuntime
60+
} // namespace Aws
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/**
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0.
4+
*/
5+
6+
#pragma once
7+
#include <aws/bedrock-runtime/BedrockRuntime_EXPORTS.h>
8+
#include <aws/core/utils/Array.h>
9+
#include <utility>
10+
11+
namespace Aws
12+
{
13+
namespace Utils
14+
{
15+
namespace Json
16+
{
17+
class JsonValue;
18+
class JsonView;
19+
} // namespace Json
20+
} // namespace Utils
21+
namespace BedrockRuntime
22+
{
23+
namespace Model
24+
{
25+
26+
/**
27+
* <p>Output from the bidirectional stream. The output is speech and a text
28+
* transcription.</p><p><h3>See Also:</h3> <a
29+
* href="http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/BidirectionalOutputPayloadPart">AWS
30+
* API Reference</a></p>
31+
*/
32+
class BidirectionalOutputPayloadPart
33+
{
34+
public:
35+
AWS_BEDROCKRUNTIME_API BidirectionalOutputPayloadPart() = default;
36+
AWS_BEDROCKRUNTIME_API BidirectionalOutputPayloadPart(Aws::Utils::Json::JsonView jsonValue);
37+
AWS_BEDROCKRUNTIME_API BidirectionalOutputPayloadPart& operator=(Aws::Utils::Json::JsonView jsonValue);
38+
AWS_BEDROCKRUNTIME_API Aws::Utils::Json::JsonValue Jsonize() const;
39+
40+
41+
///@{
42+
/**
43+
* <p>The speech output of the bidirectional stream.</p>
44+
*/
45+
inline const Aws::Utils::CryptoBuffer& GetBytes() const { return m_bytes; }
46+
inline bool BytesHasBeenSet() const { return m_bytesHasBeenSet; }
47+
template<typename BytesT = Aws::Utils::CryptoBuffer>
48+
void SetBytes(BytesT&& value) { m_bytesHasBeenSet = true; m_bytes = std::forward<BytesT>(value); }
49+
template<typename BytesT = Aws::Utils::CryptoBuffer>
50+
BidirectionalOutputPayloadPart& WithBytes(BytesT&& value) { SetBytes(std::forward<BytesT>(value)); return *this;}
51+
///@}
52+
private:
53+
54+
Aws::Utils::CryptoBuffer m_bytes{};
55+
bool m_bytesHasBeenSet = false;
56+
};
57+
58+
} // namespace Model
59+
} // namespace BedrockRuntime
60+
} // namespace Aws
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/**
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0.
4+
*/
5+
6+
#pragma once
7+
#include <aws/core/utils/HashingUtils.h>
8+
#include <aws/core/utils/event/EventStreamHandler.h>
9+
#include <aws/core/client/AWSError.h>
10+
#include <aws/bedrock-runtime/BedrockRuntime_EXPORTS.h>
11+
#include <aws/bedrock-runtime/BedrockRuntimeErrors.h>
12+
13+
#include <aws/bedrock-runtime/model/InvokeModelWithBidirectionalStreamInitialResponse.h>
14+
#include <aws/bedrock-runtime/model/BidirectionalOutputPayloadPart.h>
15+
16+
namespace Aws
17+
{
18+
namespace BedrockRuntime
19+
{
20+
namespace Model
21+
{
22+
enum class InvokeModelWithBidirectionalStreamEventType
23+
{
24+
INITIAL_RESPONSE,
25+
CHUNK,
26+
UNKNOWN
27+
};
28+
29+
class InvokeModelWithBidirectionalStreamHandler : public Aws::Utils::Event::EventStreamHandler
30+
{
31+
typedef std::function<void(const InvokeModelWithBidirectionalStreamInitialResponse&)> InvokeModelWithBidirectionalStreamInitialResponseCallback;
32+
typedef std::function<void(const InvokeModelWithBidirectionalStreamInitialResponse&, const Utils::Event::InitialResponseType)> InvokeModelWithBidirectionalStreamInitialResponseCallbackEx;
33+
typedef std::function<void(const BidirectionalOutputPayloadPart&)> BidirectionalOutputPayloadPartCallback;
34+
typedef std::function<void(const Aws::Client::AWSError<BedrockRuntimeErrors>& error)> ErrorCallback;
35+
36+
public:
37+
AWS_BEDROCKRUNTIME_API InvokeModelWithBidirectionalStreamHandler();
38+
AWS_BEDROCKRUNTIME_API InvokeModelWithBidirectionalStreamHandler& operator=(const InvokeModelWithBidirectionalStreamHandler&) = default;
39+
AWS_BEDROCKRUNTIME_API InvokeModelWithBidirectionalStreamHandler(const InvokeModelWithBidirectionalStreamHandler&) = default;
40+
41+
AWS_BEDROCKRUNTIME_API virtual void OnEvent() override;
42+
43+
///@{
44+
/**
45+
* Sets an initial response callback. This callback gets called on the initial InvokeModelWithBidirectionalStream Operation response.
46+
* This can be either "initial-response" decoded event frame or decoded HTTP headers received on connection.
47+
* This callback may get called more than once (i.e. on connection headers received and then on the initial-response event received).
48+
* @param callback
49+
*/
50+
inline void SetInitialResponseCallbackEx(const InvokeModelWithBidirectionalStreamInitialResponseCallbackEx& callback) { m_onInitialResponse = callback; }
51+
/**
52+
* Sets an initial response callback (a legacy one that does not distinguish whether response originates from headers or from the event).
53+
*/
54+
inline void SetInitialResponseCallback(const InvokeModelWithBidirectionalStreamInitialResponseCallback& noArgCallback)
55+
{
56+
m_onInitialResponse = [noArgCallback](const InvokeModelWithBidirectionalStreamInitialResponse& rs, const Utils::Event::InitialResponseType) { return noArgCallback(rs); };
57+
}
58+
///@}
59+
inline void SetBidirectionalOutputPayloadPartCallback(const BidirectionalOutputPayloadPartCallback& callback) { m_onBidirectionalOutputPayloadPart = callback; }
60+
inline void SetOnErrorCallback(const ErrorCallback& callback) { m_onError = callback; }
61+
62+
inline InvokeModelWithBidirectionalStreamInitialResponseCallbackEx& GetInitialResponseCallbackEx() { return m_onInitialResponse; }
63+
64+
private:
65+
AWS_BEDROCKRUNTIME_API void HandleEventInMessage();
66+
AWS_BEDROCKRUNTIME_API void HandleErrorInMessage();
67+
AWS_BEDROCKRUNTIME_API void MarshallError(const Aws::String& errorCode, const Aws::String& errorMessage);
68+
69+
InvokeModelWithBidirectionalStreamInitialResponseCallbackEx m_onInitialResponse;
70+
BidirectionalOutputPayloadPartCallback m_onBidirectionalOutputPayloadPart;
71+
ErrorCallback m_onError;
72+
};
73+
74+
namespace InvokeModelWithBidirectionalStreamEventMapper
75+
{
76+
AWS_BEDROCKRUNTIME_API InvokeModelWithBidirectionalStreamEventType GetInvokeModelWithBidirectionalStreamEventTypeForName(const Aws::String& name);
77+
78+
AWS_BEDROCKRUNTIME_API Aws::String GetNameForInvokeModelWithBidirectionalStreamEventType(InvokeModelWithBidirectionalStreamEventType value);
79+
} // namespace InvokeModelWithBidirectionalStreamEventMapper
80+
} // namespace Model
81+
} // namespace BedrockRuntime
82+
} // namespace Aws
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0.
4+
*/
5+
6+
#pragma once
7+
#include <aws/bedrock-runtime/BedrockRuntime_EXPORTS.h>
8+
#include <aws/core/http/HttpTypes.h>
9+
10+
namespace Aws
11+
{
12+
namespace Utils
13+
{
14+
namespace Json
15+
{
16+
class JsonValue;
17+
class JsonView;
18+
} // namespace Json
19+
} // namespace Utils
20+
namespace BedrockRuntime
21+
{
22+
namespace Model
23+
{
24+
25+
class InvokeModelWithBidirectionalStreamInitialResponse
26+
{
27+
public:
28+
AWS_BEDROCKRUNTIME_API InvokeModelWithBidirectionalStreamInitialResponse() = default;
29+
AWS_BEDROCKRUNTIME_API InvokeModelWithBidirectionalStreamInitialResponse(Aws::Utils::Json::JsonView jsonValue);
30+
AWS_BEDROCKRUNTIME_API InvokeModelWithBidirectionalStreamInitialResponse& operator=(Aws::Utils::Json::JsonView jsonValue);
31+
AWS_BEDROCKRUNTIME_API InvokeModelWithBidirectionalStreamInitialResponse(const Http::HeaderValueCollection& responseHeaders);
32+
AWS_BEDROCKRUNTIME_API Aws::Utils::Json::JsonValue Jsonize() const;
33+
34+
};
35+
36+
} // namespace Model
37+
} // namespace BedrockRuntime
38+
} // namespace Aws
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0.
4+
*/
5+
6+
#pragma once
7+
#include <aws/bedrock-runtime/BedrockRuntime_EXPORTS.h>
8+
#include <aws/bedrock-runtime/model/BidirectionalInputPayloadPart.h>
9+
#include <utility>
10+
#include <aws/core/utils/event/EventStream.h>
11+
12+
namespace Aws
13+
{
14+
namespace BedrockRuntime
15+
{
16+
namespace Model
17+
{
18+
19+
/**
20+
* <p>Payload content, the speech chunk, for the bidirectional input of the
21+
* invocation step.</p><p><h3>See Also:</h3> <a
22+
* href="http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelWithBidirectionalStreamInput">AWS
23+
* API Reference</a></p>
24+
*/
25+
class AWS_BEDROCKRUNTIME_API InvokeModelWithBidirectionalStreamInput : public Aws::Utils::Event::EventEncoderStream
26+
{
27+
public:
28+
InvokeModelWithBidirectionalStreamInput& WriteBidirectionalInputPayloadPart(const BidirectionalInputPayloadPart& value)
29+
{
30+
Aws::Utils::Event::Message msg;
31+
msg.InsertEventHeader(":message-type", Aws::String("event"));
32+
msg.InsertEventHeader(":event-type", Aws::String("chunk"));
33+
msg.InsertEventHeader(":content-type", Aws::String("application/json"));
34+
msg.WriteEventPayload(value.Jsonize().View().WriteCompact());
35+
WriteEvent(msg);
36+
return *this;
37+
}
38+
39+
};
40+
41+
} // namespace Model
42+
} // namespace BedrockRuntime
43+
} // namespace Aws

0 commit comments

Comments
 (0)