You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhance RimeTTS configuration with credential mode support
- Updated RimeTTS parameters to include `credential_mode`, allowing for both BYOK and managed credential configurations.
- Added validation logic to ensure required parameters are provided based on the selected credential mode.
- Updated documentation to reflect changes in parameter requirements and usage examples for both credential modes.
- Added tests to verify correct behavior for RimeTTS with managed and BYOK credential modes.
For `RimeTTS`, omitting `credential_mode` selects BYOK validation. Set `credential_mode=CredentialMode.MANAGED` to use managed credentials. See the [RimeTTS vendor reference](../reference/vendors.md#rimetts) for both configurations.
75
+
74
76
### CN TTS Vendors
75
77
76
78
Used with `agent.with_tts()` when routing to `Area.CN`. Use `MiniMaxCNTTS` and `MicrosoftCNTTS` for CN-specific implementations that differ from the global classes.
|`key`|`str`|BYOK: Yes; Managed: No |`None`| Rime API key |
326
+
|`speaker`|`str`|BYOK: Yes; Managed: No |`None`| Speaker ID |
325
327
|`model_id`|`str`| Yes | — | Model ID |
326
-
|`base_url`|`str`| No |`None`| WebSocket URL |
328
+
|`base_url`|`str`| Managed: Yes; BYOK: No |`None`| WebSocket URL |
329
+
|`credential_mode`|`CredentialMode`| No |`None`| Shared credential mode (`"managed"` or `"byok"`); omission uses BYOK validation |
327
330
|`skip_patterns`|`List[int]`| No |`None`| Skip patterns |
328
331
332
+
When `credential_mode` is omitted or set to `"byok"`, provide `key`, `speaker`, and `model_id`:
333
+
334
+
```python
335
+
import os
336
+
337
+
from agora_agent import RimeTTS
338
+
339
+
tts = RimeTTS(
340
+
key=os.environ["RIME_API_KEY"],
341
+
speaker="your-speaker-id",
342
+
model_id="mist",
343
+
)
344
+
```
345
+
346
+
For Agora-managed credentials, set `credential_mode=CredentialMode.MANAGED` and provide `base_url` and `model_id`:
347
+
348
+
```python
349
+
from agora_agent import CredentialMode, RimeTTS
350
+
351
+
tts = RimeTTS(
352
+
credential_mode=CredentialMode.MANAGED,
353
+
base_url="wss://your-rime-endpoint.example.com",
354
+
model_id="mist",
355
+
)
356
+
```
357
+
358
+
AgentKit serializes `credential_mode` at the top level of the Rime TTS configuration, alongside `vendor` and `params`. It omits the field when the option is not provided, preserving the existing BYOK request shape.
0 commit comments