Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
},
"exclude_types_from_init_exports": true
},
"originGitCommit": "26314a9d3199f5e135302c3c3645b6bbb8f556d4"
"originGitCommit": "9b9b2fa1161d85c0e7da5c783a8bc4e2b4dae7c0"
}
15 changes: 11 additions & 4 deletions .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/agora_agent/agentkit/presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def infer_asr_preset(asr: typing.Optional[typing.Dict[str, typing.Any]]) -> typi
if not asr or asr.get("vendor") != "deepgram":
return None
params = asr.get("params") or {}
if params.get("key"):
if params.get("api_key"):
return None
return _DEEPGRAM_MODEL_TO_PRESET.get(_normalize_model_name(params.get("model")) or "")

Expand Down
2 changes: 1 addition & 1 deletion src/agora_agent/agentkit/vendors/stt.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def to_config(self) -> Dict[str, Any]:
params: Dict[str, Any] = dict(self.additional_params or {})

if self.api_key is not None:
params["key"] = self.api_key
params["api_key"] = self.api_key
if self.model is not None:
params["model"] = self.model
if self.language is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@
from .start_agents_request_properties_parameters_silence_config import (
StartAgentsRequestPropertiesParametersSilenceConfig,
)
from .start_agents_request_properties_parameters_speak import StartAgentsRequestPropertiesParametersSpeak


class StartAgentsRequestPropertiesParameters(UncheckedBaseModel):
"""
Agent configuration parameters.
"""

speak: typing.Optional[StartAgentsRequestPropertiesParametersSpeak] = pydantic.Field(default=None)
"""
Settings for the agent's speak behavior.
"""

silence_config: typing.Optional[StartAgentsRequestPropertiesParametersSilenceConfig] = pydantic.Field(default=None)
"""
Settings related to agent silence behavior. Does not apply when you integrate a `mllm`.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2
from ...core.unchecked_base_model import UncheckedBaseModel


class StartAgentsRequestPropertiesParametersSpeak(UncheckedBaseModel):
"""
Settings for the agent's speak behavior.
"""

batch: typing.Optional[bool] = pydantic.Field(default=None)
"""
Whether to skip sentence segmentation for speak requests:
- `false`: Skip sentence segmentation.
- Omitted or `true`: Preserve sentence segmentation.
"""

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:

class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
4 changes: 2 additions & 2 deletions src/agora_agent/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ def __init__(

def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
"User-Agent": "agora-agents/v2.10.0",
"User-Agent": "agora-agents/v2.11.0",
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "agora-agents",
"X-Fern-SDK-Version": "v2.10.0",
"X-Fern-SDK-Version": "v2.11.0",
**(self.get_custom_headers() or {}),
}
headers["Authorization"] = httpx.BasicAuth(self._get_username(), self._get_password())._auth_header
Expand Down
17 changes: 17 additions & 0 deletions src/agora_agent/types/asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from .google_asr_params import GoogleAsrParams
from .microsoft_asr_params import MicrosoftAsrParams
from .open_ai_asr_params import OpenAiAsrParams
from .rtzr_asr_params import RtzrAsrParams
from .sarvam_asr_params import SarvamAsrParams
from .smallest_ai_asr_params import SmallestAiAsrParams
from .speechmatics_asr_params import SpeechmaticsAsrParams
Expand Down Expand Up @@ -210,6 +211,21 @@ class Config:
extra = pydantic.Extra.allow


class Asr_Rtzr(UncheckedBaseModel):
vendor: typing.Literal["rtzr"] = "rtzr"
language: typing.Optional[AsrLanguage] = None
params: RtzrAsrParams

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:

class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow


class Asr_Xai(UncheckedBaseModel):
vendor: typing.Literal["xai"] = "xai"
language: typing.Optional[AsrLanguage] = None
Expand Down Expand Up @@ -299,6 +315,7 @@ class Config:
Asr_Assemblyai,
Asr_Speechmatics,
Asr_Sarvam,
Asr_Rtzr,
Asr_Xai,
Asr_Xfyun,
Asr_XfyunBigmodel,
Expand Down
2 changes: 1 addition & 1 deletion src/agora_agent/types/deepgram_asr_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DeepgramAsrParams(UncheckedBaseModel):
WebSocket URL for Deepgram's streaming API
"""

key: str = pydantic.Field()
api_key: str = pydantic.Field()
"""
Deepgram API key
"""
Expand Down
27 changes: 27 additions & 0 deletions src/agora_agent/types/rtzr_asr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .asr_language import AsrLanguage
from .rtzr_asr_params import RtzrAsrParams


class RtzrAsr(UncheckedBaseModel):
"""
RTZR ASR configuration.
"""

language: typing.Optional[AsrLanguage] = None
params: RtzrAsrParams

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:

class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
82 changes: 82 additions & 0 deletions src/agora_agent/types/rtzr_asr_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel


class RtzrAsrParams(UncheckedBaseModel):
"""
RTZR ASR configuration parameters.
"""

client_id: str = pydantic.Field()
"""
RTZR client ID.
"""

client_secret: str = pydantic.Field()
"""
RTZR client secret.
"""

api_base: typing.Optional[str] = pydantic.Field(default=None)
"""
RTZR API base URL.
"""

model_name: typing.Optional[str] = pydantic.Field(default=None)
"""
RTZR recognition model name.
"""

language: typing.Optional[str] = pydantic.Field(default=None)
"""
RTZR recognition language code. Defaults to Korean (`ko`).
"""

sample_rate: typing.Optional[int] = pydantic.Field(default=None)
"""
Input audio sample rate in Hz.
"""

encoding: typing.Optional[str] = pydantic.Field(default=None)
"""
Input audio encoding.
"""

use_itn: typing.Optional[bool] = pydantic.Field(default=None)
"""
Whether to enable inverse text normalization.
"""

use_disfluency_filter: typing.Optional[bool] = pydantic.Field(default=None)
"""
Whether to filter disfluencies such as stuttering.
"""

use_profanity_filter: typing.Optional[bool] = pydantic.Field(default=None)
"""
Whether to filter profanity.
"""

use_punctuation: typing.Optional[bool] = pydantic.Field(default=None)
"""
Whether to add punctuation to the recognized text.
"""

keywords: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
"""
Keywords to improve recognition accuracy.
"""

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:

class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
24 changes: 17 additions & 7 deletions src/agora_agent/types/sarvam_tts_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,42 @@ class SarvamTtsParams(UncheckedBaseModel):

speaker: str = pydantic.Field()
"""
Voice ID (e.g., anushka, abhilash, karun, hitesh, manisha, vidya, arya)
Speaker voice to use.
"""

target_language_code: SarvamTtsParamsTargetLanguageCode = pydantic.Field()
"""
Target language code (e.g., en-IN)
Target language code in BCP-47 format (e.g., `hi-IN`, `bn-IN`, `en-IN`).
"""

pitch: typing.Optional[float] = pydantic.Field(default=None)
"""
Pitch adjustment for the voice
Pitch control for the `bulbul:v2` model.
"""

pace: typing.Optional[float] = pydantic.Field(default=None)
"""
Speed of speech
Speech speed. Defaults to `1.0`.
"""

loudness: typing.Optional[float] = pydantic.Field(default=None)
"""
Volume level of the speech
Audio loudness control for the `bulbul:v2` model.
"""

sample_rate: typing.Optional[float] = pydantic.Field(default=None)
speech_sample_rate: typing.Optional[int] = pydantic.Field(default=None)
"""
Audio sample rate in Hz
Output speech sample rate in Hz. Defaults to `24000`.
"""

enable_preprocessing: typing.Optional[bool] = pydantic.Field(default=None)
"""
Whether to normalize English words and numeric entities. Defaults to `false`.
"""

model: typing.Optional[str] = pydantic.Field(default=None)
"""
TTS model to use. Defaults to `bulbul:v3`.
"""

if IS_PYDANTIC_V2:
Expand Down
6 changes: 3 additions & 3 deletions tests/custom/test_request_body.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def test_byok_pipeline_full_properties_shape() -> None:
# ASR
asr = props["asr"]
assert asr["vendor"] == "deepgram"
assert asr["params"]["key"] == "dg-key"
assert asr["params"]["api_key"] == "dg-key"
assert asr["params"]["model"] == "nova-2"
assert asr["params"]["language"] == "en"

Expand Down Expand Up @@ -630,7 +630,7 @@ def test_6b_tts_preset_with_byok_llm_and_asr() -> None:

properties = dump(call["properties"])
# BYOK ASR: key and model both retained (nothing stripped for BYOK path)
assert properties["asr"]["params"]["key"] == "dg-key"
assert properties["asr"]["params"]["api_key"] == "dg-key"
assert properties["asr"]["params"]["model"] == "nova-2"
# BYOK LLM key retained
assert properties["llm"]["api_key"] == "openai-key"
Expand Down Expand Up @@ -779,7 +779,7 @@ def test_byok_deepgram_stt_params() -> None:
)
props = build_properties(agent, allow_missing={"llm", "tts"})
assert props["asr"]["vendor"] == "deepgram"
assert props["asr"]["params"]["key"] == "dg-key"
assert props["asr"]["params"]["api_key"] == "dg-key"
assert props["asr"]["params"]["model"] == "nova-2"
assert props["asr"]["params"]["language"] == "en"

Expand Down
6 changes: 3 additions & 3 deletions tests/custom/test_stt_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ def test_stt_vendor_params_match_documented_shapes() -> None:
DeepgramSTT(model="enhanced")

assert DeepgramSTT(api_key="dg-key", language="en").to_config()["params"] == {
"key": "dg-key",
"api_key": "dg-key",
"language": "en",
}

# api_key → wire key "key"; keyterm passes through unchanged
# api_key uses the generated Deepgram ASR field name; keyterm passes through unchanged
assert DeepgramSTT(api_key="dg-key", model="nova-3", language="en", keyterm="term").to_config()["params"] == {
"key": "dg-key",
"api_key": "dg-key",
"model": "nova-3",
"language": "en",
"keyterm": "term",
Expand Down
Loading