-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CMake and enhance ChatGPTIPAProvider class
- Added new include directories and library search paths in `FindLog4cplus.cmake`. - Modified `find_package` and updated `LOG4CPLUS_LIBRARY` handling in `CMakeLists.txt`. - Added new header files to the `HEADERS` list in `CMakeLists.txt`. - Introduced header guard, namespace, and `ChatGPTConfiguration` struct in `ChatGPTConfiguration.h`. - Enhanced `ChatGPTIPAProvider` with destructor, `initialize` method, and new member variables. - Implemented `initialize` method and updated `processInput` in `ChatGPTIPAProvider.cpp`. - Added `initialize` method to `IPAProvider` class. - Modified `addIPAProvider` in `ProviderRegistry` to initialize providers.
- Loading branch information
Showing
10 changed files
with
98 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...er/include/w3c/voiceinteraction/ipa/reference/external/ipa/chatgpt/ChatGPTConfiguration.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* 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 | ||
*/ | ||
|
||
#ifndef CHATGPTCONFIGURATION_H | ||
#define CHATGPTCONFIGURATION_H | ||
|
||
#include <nlohmann/json.hpp> | ||
|
||
namespace w3c { | ||
namespace voiceinteraction { | ||
namespace ipa { | ||
namespace reference { | ||
namespace external { | ||
namespace ipa { | ||
namespace chatgpt { | ||
|
||
struct ChatGPTConfiguration { | ||
std::string endpoint; | ||
std::string key; | ||
std::string systemMessage; | ||
}; | ||
|
||
void from_json(const nlohmann::json& j, ChatGPTConfiguration& config) { | ||
j.at("endpoint").get_to(config.endpoint); | ||
j.at("key").get_to(config.key); | ||
j.at("systemMessage").get_to(config.systemMessage); | ||
} | ||
|
||
} // chatgpt | ||
} // ipa | ||
} // external | ||
} // namespace reference | ||
} // ipa | ||
} // voiceinteraction | ||
} // w3c | ||
|
||
#endif // CHATGPTCONFIGURATION_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters