Skip to content

Commit

Permalink
NuguClient 내 requestTextInput overloading 메서드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jayce1116 committed Jan 3, 2024
1 parent 3e97ff1 commit f68d1a5
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions NuguClientKit/Sources/Client/NuguClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,35 @@ public extension NuguClient {
service: [String: AnyHashable]? = nil,
completion: ((StreamDataState) -> Void)? = nil
) -> String {
requestTextInput(
text: text,
token: token,
playServiceId: playServiceId,
source: source,
service: service,
completion: completion
).dialogRequestId
}

/// Send event that needs a text-based recognition
///
/// This function cancel speech recognition.(e.g. `ASRAgentProtocol.startRecognition(:initiator)`)
/// Use `NuguClient.textAgent.requestTextInput` directly to request independent of speech recognition.
///
/// - Parameters:
/// - text: The `text` to be recognized
/// - token: token
/// - requestType: `TextAgentRequestType`
/// - completion: The completion handler to call when the request is complete
/// - Returns: The eventIdentifier for request.
@discardableResult func requestTextInput(
text: String,
token: String? = nil,
playServiceId: String? = nil,
source: TextInputSource? = nil,
service: [String: AnyHashable]? = nil,
completion: ((StreamDataState) -> Void)? = nil
) -> EventIdentifier {
dialogStateAggregator.isChipsRequestInProgress = true

return textAgent.requestTextInput(
Expand Down

0 comments on commit f68d1a5

Please sign in to comment.