RDKEMW-21282: Firebolt 9 TTS.speak param additions - #98
Open
brendanobra wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Extends the Firebolt C++ client’s TextToSpeech::speak API to support additional optional request parameters, and updates request marshalling and related contract artifacts to match.
Changes:
- Updated
ITextToSpeech::speak(public API) andTextToSpeechImpl::speak(implementation) to accept optional parameters (callSign,language,voice,volume,rate,pitch) withstd::nulloptdefaults. - Updated speak request marshalling to only include optional keys when the corresponding value is provided.
- Added unit tests covering default payload behavior and optional-field inclusion/omission; updated OpenRPC spec examples/params for
TextToSpeech.speak.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
include/firebolt/texttospeech.h |
Public interface updated to accept optional speak parameters and document them. |
src/texttospeech_impl.h |
Impl header updated to match the new speak signature. |
src/texttospeech_impl.cpp |
Speak request parameter marshalling updated to conditionally emit optional keys. |
test/unit/textToSpeechTest.cpp |
Added unit tests validating speak payload marshalling and error propagation. |
docs/openrpc/the-spec/firebolt-open-rpc.json |
OpenRPC spec updated to include new optional TextToSpeech.speak params and example inputs. |
docs/openrpc/the-spec/firebolt-open-rpc--legacy.json |
Legacy OpenRPC spec updated similarly for TextToSpeech.speak. |
docs/openrpc/openrpc/text_to_speech.json |
Module-level OpenRPC definition updated similarly for speak. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
Suppressed comments (2)
docs/openrpc/the-spec/firebolt-open-rpc.json:2489
- The PR description states that no OpenRPC updates are included, but this change updates the OpenRPC spec by adding optional parameters and examples for
TextToSpeech.speak. Either update the PR description/notes to reflect the OpenRPC changes, or drop these spec edits if they are unintended/out of scope.
"name": "TextToSpeech.speak",
"summary": "Speak the utterance immediately. Any ongoing speech is interrupted.",
"description": "Text argument is either plain text or a well-formed SSML document TTS_status, not success attribute, to be used by caller to indicate success of call 0 OK, 1 Fail, 2 not enabled, 3 invalid configuration Raises onSpeechinterrupted if speaking is interrupted",
"params": [
{
"name": "text",
"summary": "String to be converted to Audio for speech",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "callSign",
test/unit/textToSpeechTest.cpp:79
- The new optional
speak(...)request parameters are covered in unit tests, but there is no component test exercisingTextToSpeechInterface().speak(...)with any of these optional arguments (current component test only callsspeak(text)). Adding at least one component test that callsspeakwith a representative subset/all optional args would validate end-to-end schema acceptance over JSON-RPC (per the repo’s API-facing change discipline).
TEST_F(TextToSpeechUTest, speak_payloadDefaultsToTextOnly)
{
EXPECT_CALL(mockHelper, getJson("TextToSpeech.speak", _))
.WillOnce(Invoke(
[&](const std::string& /*methodName*/, const nlohmann::json& parameters)
{
nlohmann::json expected = {{"text", "I am a text waiting for speech."}};
EXPECT_EQ(parameters, expected) << "Parameters do not match expected payload: " << expected.dump()
<< " but got: " << parameters.dump();
return Firebolt::Result<nlohmann::json>{jsonEngine.get_value("TextToSpeech.speak")};
}));
auto result = ttsImpl.speak("I am a text waiting for speech.");
ASSERT_TRUE(result);
}
swethasukumarr
approved these changes
Aug 13, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RDKEMW-21812: Extend TextToSpeech speak API with optional parameters and add marshalling coverage
Description:
This change extends the firebolt-cpp-client TextToSpeech speak API to support additional optional request parameters while preserving backward compatibility for existing callers.
What changed:
Updated the public TextToSpeech interface speak signature to accept optional parameters with default nullopt values:
callSign
language
voice
volume
rate
pitch
Updated TextToSpeech implementation declaration and definition to match the new signature.
Updated speak request marshalling to include optional fields only when provided.
Kept existing speak(text) call pattern working via defaulted optional arguments.
Test coverage added:
speak_payloadDefaultsToTextOnly
speak_payloadIncludesAllOptionalFieldsWhenProvided
speak_payloadIncludesOnlyProvidedOptionalFields
speak_payloadOmitsUnsetOptionalKeys
speak_payloadPreservesEmptyStringOptionalValues
speak_payloadUsesCallSignKeyNotLegacyCallsign
speak_propagatesHelperError
Validation:
Ran full unit test suite via ./run-unit-tests.sh --clean
Result: all tests passed (146/146), including all TextToSpeech unit tests
Notes:
This PR is scoped to firebolt-cpp-client only.
No transport or external schema/OpenRPC updates are included in this change.