Bug
send_tts_tokens() sends:
{"type": "tts:tokens", "data": {"tokens": "hello"}}
But the feature-server's ws-requestor.js only accepts type: "ack" or type: "command" (source). Any other type hits the default case and is rejected with "invalid type property: tts:tokens".
Correct format
{"type": "command", "command": "tts:tokens", "data": {"id": 1, "tokens": "hello"}}
Missing id field
Additionally, the id field is required in data by _lccTtsTokens (source) but the SDK does not send it. Without id, the handler silently returns — no error, no audio, no tts:tokens-result.
Affected methods
send_tts_tokens() — wrong type, missing id
flush_tts_tokens() — wrong type (should be {"type": "command", "command": "tts:flush"})
clear_tts_tokens() — wrong type (should be {"type": "command", "command": "tts:clear"})
Current SDK code
async def send_tts_tokens(self, text: str, **opts: Any) -> None:
msg: dict[str, Any] = {"type": "tts:tokens", "data": {"tokens": text}}
await self._ws.send(json.dumps(msg))
Expected
async def send_tts_tokens(self, text: str, id: int = 1, **opts: Any) -> None:
msg: dict[str, Any] = {"type": "command", "command": "tts:tokens", "data": {"id": id, "tokens": text}}
await self._ws.send(json.dumps(msg))
Environment
- jambonz-python-sdk: 0.3.1 (pip)
- jambonz-feature-server: 10.1.5
Bug
send_tts_tokens()sends:{"type": "tts:tokens", "data": {"tokens": "hello"}}But the feature-server's
ws-requestor.jsonly acceptstype: "ack"ortype: "command"(source). Any other type hits the default case and is rejected with"invalid type property: tts:tokens".Correct format
{"type": "command", "command": "tts:tokens", "data": {"id": 1, "tokens": "hello"}}Missing
idfieldAdditionally, the
idfield is required in data by_lccTtsTokens(source) but the SDK does not send it. Withoutid, the handler silently returns — no error, no audio, notts:tokens-result.Affected methods
send_tts_tokens()— wrongtype, missingidflush_tts_tokens()— wrongtype(should be{"type": "command", "command": "tts:flush"})clear_tts_tokens()— wrongtype(should be{"type": "command", "command": "tts:clear"})Current SDK code
Expected
Environment