Skip to content

RDKEMW-21282: Firebolt 9 TTS.speak param additions - #98

Open
brendanobra wants to merge 3 commits into
developfrom
RDKEMW-21812
Open

RDKEMW-21282: Firebolt 9 TTS.speak param additions#98
brendanobra wants to merge 3 commits into
developfrom
RDKEMW-21812

Conversation

@brendanobra

Copy link
Copy Markdown
Contributor

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.

Copilot AI lite review requested due to automatic review settings August 12, 2026 22:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) and TextToSpeechImpl::speak (implementation) to accept optional parameters (callSign, language, voice, volume, rate, pitch) with std::nullopt defaults.
  • 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.

Comment thread docs/openrpc/the-spec/firebolt-open-rpc.json
Comment thread src/texttospeech_impl.cpp Outdated
Copilot AI review requested due to automatic review settings August 12, 2026 23:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 exercising TextToSpeechInterface().speak(...) with any of these optional arguments (current component test only calls speak(text)). Adding at least one component test that calls speak with 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);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants