Skip to content

Commit

Permalink
Documentation update, adding clarity and rephrasing.
Browse files Browse the repository at this point in the history
This release improves support for newer models in Amazon Bedrock Flows.
This release adds Reasoning Content support to Converse and ConverseStream APIs
Adding support for ReasoningContent fields in Pre-Processing, Post-Processing and Orchestration Trace outputs.
  • Loading branch information
aws-sdk-cpp-automation committed Feb 24, 2025
1 parent c0eab4e commit 3a8bb67
Show file tree
Hide file tree
Showing 49 changed files with 1,937 additions and 885 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.512
1.11.513
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <aws/bedrock-agent-runtime/BedrockAgentRuntime_EXPORTS.h>
#include <aws/bedrock-agent-runtime/model/Metadata.h>
#include <aws/bedrock-agent-runtime/model/RawResponse.h>
#include <aws/bedrock-agent-runtime/model/ReasoningContentBlock.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

Expand Down Expand Up @@ -65,6 +66,19 @@ namespace Model
inline OrchestrationModelInvocationOutput& WithRawResponse(RawResponse&& value) { SetRawResponse(std::move(value)); return *this;}
///@}

///@{
/**
* <p>Contains content about the reasoning that the model made during the
* orchestration step. </p>
*/
inline const ReasoningContentBlock& GetReasoningContent() const{ return m_reasoningContent; }
inline bool ReasoningContentHasBeenSet() const { return m_reasoningContentHasBeenSet; }
inline void SetReasoningContent(const ReasoningContentBlock& value) { m_reasoningContentHasBeenSet = true; m_reasoningContent = value; }
inline void SetReasoningContent(ReasoningContentBlock&& value) { m_reasoningContentHasBeenSet = true; m_reasoningContent = std::move(value); }
inline OrchestrationModelInvocationOutput& WithReasoningContent(const ReasoningContentBlock& value) { SetReasoningContent(value); return *this;}
inline OrchestrationModelInvocationOutput& WithReasoningContent(ReasoningContentBlock&& value) { SetReasoningContent(std::move(value)); return *this;}
///@}

///@{
/**
* <p>The unique identifier of the trace.</p>
Expand All @@ -86,6 +100,9 @@ namespace Model
RawResponse m_rawResponse;
bool m_rawResponseHasBeenSet = false;

ReasoningContentBlock m_reasoningContent;
bool m_reasoningContentHasBeenSet = false;

Aws::String m_traceId;
bool m_traceIdHasBeenSet = false;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <aws/bedrock-agent-runtime/model/Metadata.h>
#include <aws/bedrock-agent-runtime/model/PostProcessingParsedResponse.h>
#include <aws/bedrock-agent-runtime/model/RawResponse.h>
#include <aws/bedrock-agent-runtime/model/ReasoningContentBlock.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

Expand Down Expand Up @@ -79,6 +80,19 @@ namespace Model
inline PostProcessingModelInvocationOutput& WithRawResponse(RawResponse&& value) { SetRawResponse(std::move(value)); return *this;}
///@}

///@{
/**
* <p>Contains content about the reasoning that the model made during the
* post-processing step.</p>
*/
inline const ReasoningContentBlock& GetReasoningContent() const{ return m_reasoningContent; }
inline bool ReasoningContentHasBeenSet() const { return m_reasoningContentHasBeenSet; }
inline void SetReasoningContent(const ReasoningContentBlock& value) { m_reasoningContentHasBeenSet = true; m_reasoningContent = value; }
inline void SetReasoningContent(ReasoningContentBlock&& value) { m_reasoningContentHasBeenSet = true; m_reasoningContent = std::move(value); }
inline PostProcessingModelInvocationOutput& WithReasoningContent(const ReasoningContentBlock& value) { SetReasoningContent(value); return *this;}
inline PostProcessingModelInvocationOutput& WithReasoningContent(ReasoningContentBlock&& value) { SetReasoningContent(std::move(value)); return *this;}
///@}

///@{
/**
* <p>The unique identifier of the trace.</p>
Expand All @@ -103,6 +117,9 @@ namespace Model
RawResponse m_rawResponse;
bool m_rawResponseHasBeenSet = false;

ReasoningContentBlock m_reasoningContent;
bool m_reasoningContentHasBeenSet = false;

Aws::String m_traceId;
bool m_traceIdHasBeenSet = false;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <aws/bedrock-agent-runtime/model/Metadata.h>
#include <aws/bedrock-agent-runtime/model/PreProcessingParsedResponse.h>
#include <aws/bedrock-agent-runtime/model/RawResponse.h>
#include <aws/bedrock-agent-runtime/model/ReasoningContentBlock.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

Expand Down Expand Up @@ -79,6 +80,19 @@ namespace Model
inline PreProcessingModelInvocationOutput& WithRawResponse(RawResponse&& value) { SetRawResponse(std::move(value)); return *this;}
///@}

///@{
/**
* <p>Contains content about the reasoning that the model made during the
* pre-processing step. </p>
*/
inline const ReasoningContentBlock& GetReasoningContent() const{ return m_reasoningContent; }
inline bool ReasoningContentHasBeenSet() const { return m_reasoningContentHasBeenSet; }
inline void SetReasoningContent(const ReasoningContentBlock& value) { m_reasoningContentHasBeenSet = true; m_reasoningContent = value; }
inline void SetReasoningContent(ReasoningContentBlock&& value) { m_reasoningContentHasBeenSet = true; m_reasoningContent = std::move(value); }
inline PreProcessingModelInvocationOutput& WithReasoningContent(const ReasoningContentBlock& value) { SetReasoningContent(value); return *this;}
inline PreProcessingModelInvocationOutput& WithReasoningContent(ReasoningContentBlock&& value) { SetReasoningContent(std::move(value)); return *this;}
///@}

///@{
/**
* <p>The unique identifier of the trace.</p>
Expand All @@ -103,6 +117,9 @@ namespace Model
RawResponse m_rawResponse;
bool m_rawResponseHasBeenSet = false;

ReasoningContentBlock m_reasoningContent;
bool m_reasoningContentHasBeenSet = false;

Aws::String m_traceId;
bool m_traceIdHasBeenSet = false;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ namespace Model
/**
* <p>Specifies whether to override the default parser Lambda function when parsing
* the raw foundation model output in the part of the agent sequence defined by the
* <code>promptType</code>. If you set the field as <code>OVERRIDEN</code>, the
* <code>promptType</code>. If you set the field as <code>OVERRIDDEN</code>, the
* <code>overrideLambda</code> field in the <a
* href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html">PromptOverrideConfiguration</a>
* must be specified with the ARN of a Lambda function.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once
#include <aws/bedrock-agent-runtime/BedrockAgentRuntime_EXPORTS.h>
#include <aws/bedrock-agent-runtime/model/ReasoningTextBlock.h>
#include <aws/core/utils/Array.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace BedrockAgentRuntime
{
namespace Model
{

/**
* <p>Contains content regarding the reasoning that the foundation model made with
* respect to the content in the content block. Reasoning refers to a Chain of
* Thought (CoT) that the model generates to enhance the accuracy of its final
* response.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/ReasoningContentBlock">AWS
* API Reference</a></p>
*/
class ReasoningContentBlock
{
public:
AWS_BEDROCKAGENTRUNTIME_API ReasoningContentBlock();
AWS_BEDROCKAGENTRUNTIME_API ReasoningContentBlock(Aws::Utils::Json::JsonView jsonValue);
AWS_BEDROCKAGENTRUNTIME_API ReasoningContentBlock& operator=(Aws::Utils::Json::JsonView jsonValue);
AWS_BEDROCKAGENTRUNTIME_API Aws::Utils::Json::JsonValue Jsonize() const;


///@{
/**
* <p>Contains information about the reasoning that the model used to return the
* content in the content block.</p>
*/
inline const ReasoningTextBlock& GetReasoningText() const{ return m_reasoningText; }
inline bool ReasoningTextHasBeenSet() const { return m_reasoningTextHasBeenSet; }
inline void SetReasoningText(const ReasoningTextBlock& value) { m_reasoningTextHasBeenSet = true; m_reasoningText = value; }
inline void SetReasoningText(ReasoningTextBlock&& value) { m_reasoningTextHasBeenSet = true; m_reasoningText = std::move(value); }
inline ReasoningContentBlock& WithReasoningText(const ReasoningTextBlock& value) { SetReasoningText(value); return *this;}
inline ReasoningContentBlock& WithReasoningText(ReasoningTextBlock&& value) { SetReasoningText(std::move(value)); return *this;}
///@}

///@{
/**
* <p>The content in the reasoning that was encrypted by the model provider for
* trust and safety reasons.</p>
*/
inline const Aws::Utils::ByteBuffer& GetRedactedContent() const{ return m_redactedContent; }
inline bool RedactedContentHasBeenSet() const { return m_redactedContentHasBeenSet; }
inline void SetRedactedContent(const Aws::Utils::ByteBuffer& value) { m_redactedContentHasBeenSet = true; m_redactedContent = value; }
inline void SetRedactedContent(Aws::Utils::ByteBuffer&& value) { m_redactedContentHasBeenSet = true; m_redactedContent = std::move(value); }
inline ReasoningContentBlock& WithRedactedContent(const Aws::Utils::ByteBuffer& value) { SetRedactedContent(value); return *this;}
inline ReasoningContentBlock& WithRedactedContent(Aws::Utils::ByteBuffer&& value) { SetRedactedContent(std::move(value)); return *this;}
///@}
private:

ReasoningTextBlock m_reasoningText;
bool m_reasoningTextHasBeenSet = false;

Aws::Utils::ByteBuffer m_redactedContent;
bool m_redactedContentHasBeenSet = false;
};

} // namespace Model
} // namespace BedrockAgentRuntime
} // namespace Aws
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once
#include <aws/bedrock-agent-runtime/BedrockAgentRuntime_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace BedrockAgentRuntime
{
namespace Model
{

/**
* <p>Contains information about the reasoning that the model used to return the
* content in the content block.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/ReasoningTextBlock">AWS
* API Reference</a></p>
*/
class ReasoningTextBlock
{
public:
AWS_BEDROCKAGENTRUNTIME_API ReasoningTextBlock();
AWS_BEDROCKAGENTRUNTIME_API ReasoningTextBlock(Aws::Utils::Json::JsonView jsonValue);
AWS_BEDROCKAGENTRUNTIME_API ReasoningTextBlock& operator=(Aws::Utils::Json::JsonView jsonValue);
AWS_BEDROCKAGENTRUNTIME_API Aws::Utils::Json::JsonValue Jsonize() const;


///@{
/**
* <p>A hash of all the messages in the conversation to ensure that the content in
* the reasoning text block isn't tampered with. You must submit the signature in
* subsequent <code>Converse</code> requests, in addition to the previous messages.
* If the previous messages are tampered with, the response throws an error.</p>
*/
inline const Aws::String& GetSignature() const{ return m_signature; }
inline bool SignatureHasBeenSet() const { return m_signatureHasBeenSet; }
inline void SetSignature(const Aws::String& value) { m_signatureHasBeenSet = true; m_signature = value; }
inline void SetSignature(Aws::String&& value) { m_signatureHasBeenSet = true; m_signature = std::move(value); }
inline void SetSignature(const char* value) { m_signatureHasBeenSet = true; m_signature.assign(value); }
inline ReasoningTextBlock& WithSignature(const Aws::String& value) { SetSignature(value); return *this;}
inline ReasoningTextBlock& WithSignature(Aws::String&& value) { SetSignature(std::move(value)); return *this;}
inline ReasoningTextBlock& WithSignature(const char* value) { SetSignature(value); return *this;}
///@}

///@{
/**
* <p>Text describing the reasoning that the model used to return the content in
* the content block.</p>
*/
inline const Aws::String& GetText() const{ return m_text; }
inline bool TextHasBeenSet() const { return m_textHasBeenSet; }
inline void SetText(const Aws::String& value) { m_textHasBeenSet = true; m_text = value; }
inline void SetText(Aws::String&& value) { m_textHasBeenSet = true; m_text = std::move(value); }
inline void SetText(const char* value) { m_textHasBeenSet = true; m_text.assign(value); }
inline ReasoningTextBlock& WithText(const Aws::String& value) { SetText(value); return *this;}
inline ReasoningTextBlock& WithText(Aws::String&& value) { SetText(std::move(value)); return *this;}
inline ReasoningTextBlock& WithText(const char* value) { SetText(value); return *this;}
///@}
private:

Aws::String m_signature;
bool m_signatureHasBeenSet = false;

Aws::String m_text;
bool m_textHasBeenSet = false;
};

} // namespace Model
} // namespace BedrockAgentRuntime
} // namespace Aws
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace Model
OrchestrationModelInvocationOutput::OrchestrationModelInvocationOutput() :
m_metadataHasBeenSet(false),
m_rawResponseHasBeenSet(false),
m_reasoningContentHasBeenSet(false),
m_traceIdHasBeenSet(false)
{
}
Expand All @@ -47,6 +48,13 @@ OrchestrationModelInvocationOutput& OrchestrationModelInvocationOutput::operator
m_rawResponseHasBeenSet = true;
}

if(jsonValue.ValueExists("reasoningContent"))
{
m_reasoningContent = jsonValue.GetObject("reasoningContent");

m_reasoningContentHasBeenSet = true;
}

if(jsonValue.ValueExists("traceId"))
{
m_traceId = jsonValue.GetString("traceId");
Expand All @@ -73,6 +81,12 @@ JsonValue OrchestrationModelInvocationOutput::Jsonize() const

}

if(m_reasoningContentHasBeenSet)
{
payload.WithObject("reasoningContent", m_reasoningContent.Jsonize());

}

if(m_traceIdHasBeenSet)
{
payload.WithString("traceId", m_traceId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ PostProcessingModelInvocationOutput::PostProcessingModelInvocationOutput() :
m_metadataHasBeenSet(false),
m_parsedResponseHasBeenSet(false),
m_rawResponseHasBeenSet(false),
m_reasoningContentHasBeenSet(false),
m_traceIdHasBeenSet(false)
{
}
Expand Down Expand Up @@ -55,6 +56,13 @@ PostProcessingModelInvocationOutput& PostProcessingModelInvocationOutput::operat
m_rawResponseHasBeenSet = true;
}

if(jsonValue.ValueExists("reasoningContent"))
{
m_reasoningContent = jsonValue.GetObject("reasoningContent");

m_reasoningContentHasBeenSet = true;
}

if(jsonValue.ValueExists("traceId"))
{
m_traceId = jsonValue.GetString("traceId");
Expand Down Expand Up @@ -87,6 +95,12 @@ JsonValue PostProcessingModelInvocationOutput::Jsonize() const

}

if(m_reasoningContentHasBeenSet)
{
payload.WithObject("reasoningContent", m_reasoningContent.Jsonize());

}

if(m_traceIdHasBeenSet)
{
payload.WithString("traceId", m_traceId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ PreProcessingModelInvocationOutput::PreProcessingModelInvocationOutput() :
m_metadataHasBeenSet(false),
m_parsedResponseHasBeenSet(false),
m_rawResponseHasBeenSet(false),
m_reasoningContentHasBeenSet(false),
m_traceIdHasBeenSet(false)
{
}
Expand Down Expand Up @@ -55,6 +56,13 @@ PreProcessingModelInvocationOutput& PreProcessingModelInvocationOutput::operator
m_rawResponseHasBeenSet = true;
}

if(jsonValue.ValueExists("reasoningContent"))
{
m_reasoningContent = jsonValue.GetObject("reasoningContent");

m_reasoningContentHasBeenSet = true;
}

if(jsonValue.ValueExists("traceId"))
{
m_traceId = jsonValue.GetString("traceId");
Expand Down Expand Up @@ -87,6 +95,12 @@ JsonValue PreProcessingModelInvocationOutput::Jsonize() const

}

if(m_reasoningContentHasBeenSet)
{
payload.WithObject("reasoningContent", m_reasoningContent.Jsonize());

}

if(m_traceIdHasBeenSet)
{
payload.WithString("traceId", m_traceId);
Expand Down
Loading

0 comments on commit 3a8bb67

Please sign in to comment.