From d6d1c67cdf382cf621c2a3e327cdb52946358ac7 Mon Sep 17 00:00:00 2001 From: Dirk Schnelle-Walka Date: Wed, 3 Apr 2024 14:17:49 +0200 Subject: [PATCH] issue #51 added a call result to external client response --- source/SOURCE.md | 16 +++++++- source/w3cipa/w3cipaframework/CMakeLists.txt | 1 + .../voiceinteraction/ipa/AudioDeliveryType.h | 2 +- .../w3c/voiceinteraction/ipa/CallResult.h | 40 +++++++++++++++++++ .../ipa/ExternalClientResponse.h | 7 ++++ .../ipa/ExternalClientResponse.cpp | 8 ++++ .../paArchitecture/paArchitecture-1-3.htm | 19 ++++----- 7 files changed, 82 insertions(+), 11 deletions(-) create mode 100644 source/w3cipa/w3cipaframework/include/w3c/voiceinteraction/ipa/CallResult.h diff --git a/source/SOURCE.md b/source/SOURCE.md index e7c771a..96c6791 100644 --- a/source/SOURCE.md +++ b/source/SOURCE.md @@ -8,7 +8,7 @@ You will need - A C/C++ compiler supporting at least C++ 17 - CMake version 3.24 - a local copy of libcurl https://curl.se/download.html so that it can be found - by FindPackage + by FindPackage on Windows systems - A C++ IDE of your choice - An OpenAI developer key @@ -64,6 +64,8 @@ Replace OPENAI-DEVELOPER-KEY with your actual key ### Manual Build +On Windows systems + ``` cd source/w3cipa mkdir build @@ -71,6 +73,18 @@ cd build cmake .. -DCURL_INCLUDE_DIR= -DCURL_LIBRARY= make && make install ``` + +On Linux based systems or any other + +``` +cd source/w3cipa +mkdir build +cd build +cmake .. +make && make install +``` + + ## Open Issues A list of open issues can be displayed via diff --git a/source/w3cipa/w3cipaframework/CMakeLists.txt b/source/w3cipa/w3cipaframework/CMakeLists.txt index 4093124..0883169 100644 --- a/source/w3cipa/w3cipaframework/CMakeLists.txt +++ b/source/w3cipa/w3cipaframework/CMakeLists.txt @@ -23,6 +23,7 @@ set(HEADERS include/w3c/voiceinteraction/ipa/AudioData.h include/w3c/voiceinteraction/ipa/AudioDeliveryType.h include/w3c/voiceinteraction/ipa/AudioEncoding.h + include/w3c/voiceinteraction/ipa/CallResult.h include/w3c/voiceinteraction/ipa/ClientInput.h include/w3c/voiceinteraction/ipa/ClientRequest.h include/w3c/voiceinteraction/ipa/ClientResponse.h diff --git a/source/w3cipa/w3cipaframework/include/w3c/voiceinteraction/ipa/AudioDeliveryType.h b/source/w3cipa/w3cipaframework/include/w3c/voiceinteraction/ipa/AudioDeliveryType.h index 6e5ddde..bccc13d 100644 --- a/source/w3cipa/w3cipaframework/include/w3c/voiceinteraction/ipa/AudioDeliveryType.h +++ b/source/w3cipa/w3cipaframework/include/w3c/voiceinteraction/ipa/AudioDeliveryType.h @@ -37,4 +37,4 @@ enum AudioDeliveryType } // namespace voiceinteraction } // namespace w3c -#endif // !defined(EA_C8411B85_9B7F_4a80_BD05_97815CF258AD__INCLUDED_) +#endif // !defined(AUDIODELIVERYTYPE_H) diff --git a/source/w3cipa/w3cipaframework/include/w3c/voiceinteraction/ipa/CallResult.h b/source/w3cipa/w3cipaframework/include/w3c/voiceinteraction/ipa/CallResult.h new file mode 100644 index 0000000..6fc9716 --- /dev/null +++ b/source/w3cipa/w3cipaframework/include/w3c/voiceinteraction/ipa/CallResult.h @@ -0,0 +1,40 @@ +/* + * IPA Reference Implementation: https://github.com/w3c/voiceinteraction + * + * Copyright (C) 2024 World Wide Web Consortium. All Rights Reserved. + * + * This work is distributed under the W3C Software and Document License [1] + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * [1] https://www.w3.org/Consortium/Legal/copyright-software + */ + +#if !defined(CALL_RESULT_H) +#define CALL_RESULT_H + +namespace w3c { +namespace voiceinteraction { +namespace ipa { + +/** + * Indicator to success or failure. + * @author Dirk Schnelle-Walka + */ +enum CallResult +{ + /** + * A call has been completed successfully. + */ + SUCCESS = 0, + /** + * There was an error in the call. + */ + FAILURE = 1 +}; + +} // namespace ipa +} // namespace voiceinteraction +} // namespace w3c + +#endif // !defined(CALL_RESULT_H) diff --git a/source/w3cipa/w3cipaframework/include/w3c/voiceinteraction/ipa/ExternalClientResponse.h b/source/w3cipa/w3cipaframework/include/w3c/voiceinteraction/ipa/ExternalClientResponse.h index be65399..4d96a39 100644 --- a/source/w3cipa/w3cipaframework/include/w3c/voiceinteraction/ipa/ExternalClientResponse.h +++ b/source/w3cipa/w3cipaframework/include/w3c/voiceinteraction/ipa/ExternalClientResponse.h @@ -15,6 +15,7 @@ #include +#include "CallResult.h" #include "ErrorMessage.h" #include "MultiModalOutputs.h" #include "RequestId.h" @@ -84,6 +85,12 @@ class ExternalClientResponse */ const std::shared_ptr getSemanticInterpretation() const; + /** + * Checks if there was an error in the call. + * @return {@link CallResult#SUCCESS} in case there was no error. + */ + CallResult getCallResult() const; + /** * Checks if this reponse includes an error * @return {@code true} if the response includes an error diff --git a/source/w3cipa/w3cipaframework/src/w3c/voiceinteraction/ipa/ExternalClientResponse.cpp b/source/w3cipa/w3cipaframework/src/w3c/voiceinteraction/ipa/ExternalClientResponse.cpp index 31c6471..773cfe0 100644 --- a/source/w3cipa/w3cipaframework/src/w3c/voiceinteraction/ipa/ExternalClientResponse.cpp +++ b/source/w3cipa/w3cipaframework/src/w3c/voiceinteraction/ipa/ExternalClientResponse.cpp @@ -53,6 +53,14 @@ const std::shared_ptr ExternalClientResponse::getSemanti return interpretation; } +CallResult ExternalClientResponse::getCallResult() const { + if (error == nullptr) { + return CallResult::SUCCESS; + } else { + return CallResult::FAILURE; + } +} + bool ExternalClientResponse::hasError() const { return error != nullptr; } diff --git a/voice interaction drafts/paArchitecture/paArchitecture-1-3.htm b/voice interaction drafts/paArchitecture/paArchitecture-1-3.htm index 0e2aad0..66d974a 100644 --- a/voice interaction drafts/paArchitecture/paArchitecture-1-3.htm +++ b/voice interaction drafts/paArchitecture/paArchitecture-1-3.htm @@ -23,7 +23,7 @@

Architecture and
Latest version
- Last modified: March 21, 2023 https://github.com/w3c/voiceinteraction/blob/master/voice%20interaction%20drafts/paArchitecture/paArchitecture-1-3.htm (GitHub repository)
@@ -34,8 +34,8 @@

Architecture and
Editors
- Dirk Schnelle-Walka
Deborah Dahl, Conversational - Technologies + Dirk Schnelle-Walka
+ Deborah Dahl, Conversational Technologies

@@ -454,12 +454,13 @@

Basic IPA Architecture
Fig. 1 Basic architecture of an IPA
-

This architecture follows a traditional partitioning of - conversational systems, with separate components for speech - recognition, natural language understanding, dialog management, - natural language generation, and audio output, (audio files or - text to speech). This architecture does not rule out combining - some of these components in specific systems.

+

This architecture aims at following both, a traditional + partitioning of conversational systems, with separate components + for speech recognition, natural language understanding, dialog + management, natural language generation, and audio output, + (audio files or text to speech) as well as newer LLM (Large + Language Model) based approaches. This architecture does not + rule out combining some of these components in specific systems.

This architecture aims at serving, among others, the following most popular high-level use cases for IPAs