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/ConverseStreamInitialResponse.h>
14#include <aws/bedrock-runtime/model/MessageStartEvent.h>
15#include <aws/bedrock-runtime/model/ContentBlockStartEvent.h>
16#include <aws/bedrock-runtime/model/ContentBlockDeltaEvent.h>
17#include <aws/bedrock-runtime/model/ContentBlockStopEvent.h>
18#include <aws/bedrock-runtime/model/MessageStopEvent.h>
19#include <aws/bedrock-runtime/model/ConverseStreamMetadataEvent.h>
23namespace BedrockRuntime
47 typedef std::function<void(
const MessageStopEvent&)> MessageStopEventCallback;
55 AWS_BEDROCKRUNTIME_API
virtual void OnEvent()
override;
84 AWS_BEDROCKRUNTIME_API
void HandleEventInMessage();
85 AWS_BEDROCKRUNTIME_API
void HandleErrorInMessage();
88 ConverseStreamInitialResponseCallbackEx m_onInitialResponse;
89 MessageStartEventCallback m_onMessageStartEvent;
90 ContentBlockStartEventCallback m_onContentBlockStartEvent;
91 ContentBlockDeltaEventCallback m_onContentBlockDeltaEvent;
92 ContentBlockStopEventCallback m_onContentBlockStopEvent;
93 MessageStopEventCallback m_onMessageStopEvent;
94 ConverseStreamMetadataEventCallback m_onConverseStreamMetadataEvent;
95 ErrorCallback m_onError;
98namespace ConverseStreamEventMapper
AWS_BEDROCKRUNTIME_API ConverseStreamHandler & operator=(const ConverseStreamHandler &)=default
void SetInitialResponseCallbackEx(const ConverseStreamInitialResponseCallbackEx &callback)
AWS_BEDROCKRUNTIME_API ConverseStreamHandler()
void SetInitialResponseCallback(const ConverseStreamInitialResponseCallback &noArgCallback)
void SetOnErrorCallback(const ErrorCallback &callback)
void SetMessageStartEventCallback(const MessageStartEventCallback &callback)
virtual AWS_BEDROCKRUNTIME_API void OnEvent() override
void SetConverseStreamMetadataEventCallback(const ConverseStreamMetadataEventCallback &callback)
void SetContentBlockStartEventCallback(const ContentBlockStartEventCallback &callback)
void SetContentBlockStopEventCallback(const ContentBlockStopEventCallback &callback)
ConverseStreamInitialResponseCallbackEx & GetInitialResponseCallbackEx()
void SetContentBlockDeltaEventCallback(const ContentBlockDeltaEventCallback &callback)
void SetMessageStopEventCallback(const MessageStopEventCallback &callback)
AWS_BEDROCKRUNTIME_API ConverseStreamEventType GetConverseStreamEventTypeForName(const Aws::String &name)
AWS_BEDROCKRUNTIME_API Aws::String GetNameForConverseStreamEventType(ConverseStreamEventType value)
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String