diff --git a/NuguAgents/Sources/CapabilityAgents/Image/Image+Event.swift b/NuguAgents/Sources/CapabilityAgents/Image/Image+Event.swift index 1f6db8e4..ab872cb0 100644 --- a/NuguAgents/Sources/CapabilityAgents/Image/Image+Event.swift +++ b/NuguAgents/Sources/CapabilityAgents/Image/Image+Event.swift @@ -27,7 +27,7 @@ extension ImageAgent { let referrerDialogRequestId: String? enum TypeInfo { - case sendImage + case sendImage(service: [String: AnyHashable]?) } } @@ -46,6 +46,8 @@ extension ImageAgent.Event: Eventable { var payload: [String: AnyHashable] { var payload: [String: AnyHashable] = [:] switch typeInfo { + case let .sendImage(service): + payload["service"] = service default: break } diff --git a/NuguAgents/Sources/CapabilityAgents/Image/ImageAgent.swift b/NuguAgents/Sources/CapabilityAgents/Image/ImageAgent.swift index b1eb2e83..c55f85b8 100644 --- a/NuguAgents/Sources/CapabilityAgents/Image/ImageAgent.swift +++ b/NuguAgents/Sources/CapabilityAgents/Image/ImageAgent.swift @@ -31,7 +31,7 @@ private enum Const { } public class ImageAgent: ImageAgentProtocol { - public var capabilityAgentProperty: CapabilityAgentProperty = .init(category: .image, version: "1.0") + public var capabilityAgentProperty: CapabilityAgentProperty = .init(category: .image, version: "1.1") // private private let directiveSequencer: DirectiveSequenceable @@ -74,6 +74,7 @@ public class ImageAgent: ImageAgentProtocol { public extension ImageAgent { @discardableResult func requestSendImage( _ image: Data, + service: [String: AnyHashable]?, completion: ((StreamDataState) -> Void)? = nil ) -> String { let eventIdentifier = EventIdentifier() @@ -88,7 +89,7 @@ public extension ImageAgent { guard let self = self else { return } self.upstreamDataSender.sendStream( Event( - typeInfo: .sendImage, + typeInfo: .sendImage(service: service), referrerDialogRequestId: nil ).makeEventMessage( property: self.capabilityAgentProperty, diff --git a/NuguAgents/Sources/CapabilityAgents/Image/ImageAgentProtocol.swift b/NuguAgents/Sources/CapabilityAgents/Image/ImageAgentProtocol.swift index 7a037452..7ad14ede 100644 --- a/NuguAgents/Sources/CapabilityAgents/Image/ImageAgentProtocol.swift +++ b/NuguAgents/Sources/CapabilityAgents/Image/ImageAgentProtocol.swift @@ -24,6 +24,16 @@ import NuguCore public protocol ImageAgentProtocol: CapabilityAgentable { @discardableResult func requestSendImage( _ image: Data, + service: [String: AnyHashable]?, completion: ((StreamDataState) -> Void)? ) -> String } + +public extension ImageAgentProtocol { + @discardableResult func requestSendImage( + _ image: Data, + completion: ((StreamDataState) -> Void)? + ) -> String { + requestSendImage(image, service: nil, completion: completion) + } +}