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>
13#include <aws/bedrock-runtime/model/InvokeModelWithResponseStreamInitialResponse.h>
14#include <aws/bedrock-runtime/model/PayloadPart.h>
18namespace BedrockRuntime
33 typedef std::function<void(
const PayloadPart&)> PayloadPartCallback;
40 AWS_BEDROCKRUNTIME_API
virtual void OnEvent()
override;
49 inline void SetInitialResponseCallbackEx(
const InvokeModelWithResponseStreamInitialResponseCallbackEx& callback) { m_onInitialResponse = callback; }
64 AWS_BEDROCKRUNTIME_API
void HandleEventInMessage();
65 AWS_BEDROCKRUNTIME_API
void HandleErrorInMessage();
68 InvokeModelWithResponseStreamInitialResponseCallbackEx m_onInitialResponse;
69 PayloadPartCallback m_onPayloadPart;
70 ErrorCallback m_onError;
73namespace InvokeModelWithResponseStreamEventMapper
void SetInitialResponseCallback(const InvokeModelWithResponseStreamInitialResponseCallback &noArgCallback)
void SetInitialResponseCallbackEx(const InvokeModelWithResponseStreamInitialResponseCallbackEx &callback)
void SetPayloadPartCallback(const PayloadPartCallback &callback)
virtual AWS_BEDROCKRUNTIME_API void OnEvent() override
InvokeModelWithResponseStreamInitialResponseCallbackEx & GetInitialResponseCallbackEx()
AWS_BEDROCKRUNTIME_API InvokeModelWithResponseStreamHandler & operator=(const InvokeModelWithResponseStreamHandler &)=default
void SetOnErrorCallback(const ErrorCallback &callback)
AWS_BEDROCKRUNTIME_API InvokeModelWithResponseStreamHandler()
AWS_BEDROCKRUNTIME_API InvokeModelWithResponseStreamEventType GetInvokeModelWithResponseStreamEventTypeForName(const Aws::String &name)
AWS_BEDROCKRUNTIME_API Aws::String GetNameForInvokeModelWithResponseStreamEventType(InvokeModelWithResponseStreamEventType value)
InvokeModelWithResponseStreamEventType
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String