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
5 changes: 3 additions & 2 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"cliVersion": "4.4.4",
"cliVersion": "5.0.0",
"generatorName": "fernapi/fern-python-sdk",
"generatorVersion": "4.37.0",
"generatorConfig": {
Expand All @@ -12,5 +12,6 @@
"skip_validation": true
},
"exclude_types_from_init_exports": true
}
},
"originGitCommit": "b55cdf73dddbda3aa248668eefd04d21d60ee675"
}
10 changes: 10 additions & 0 deletions .fern/replay.lock

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

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
__pycache__/
dist/
poetry.toml
.venv/
27 changes: 0 additions & 27 deletions PYTHON-AGENTKIT-SNAKE-CASE-AUDIT.md

This file was deleted.

13 changes: 6 additions & 7 deletions src/agora_agent/agents/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from .types.get_history_agents_response import GetHistoryAgentsResponse
from .types.get_turns_agents_response import GetTurnsAgentsResponse
from .types.interrupt_agents_response import InterruptAgentsResponse
from .types.list_agents_request_state import ListAgentsRequestState
from .types.list_agents_response import ListAgentsResponse
from .types.list_agents_response_data_list_item import ListAgentsResponseDataListItem
from .types.speak_agents_request_priority import SpeakAgentsRequestPriority
Expand Down Expand Up @@ -161,7 +160,7 @@ def list(
channel: typing.Optional[str] = None,
from_time: typing.Optional[float] = None,
to_time: typing.Optional[float] = None,
state: typing.Optional[ListAgentsRequestState] = None,
state: typing.Optional[str] = None,
limit: typing.Optional[int] = None,
cursor: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
Expand All @@ -183,8 +182,8 @@ def list(
to_time : typing.Optional[float]
The end timestamp (in seconds) for the query. Default is current time.

state : typing.Optional[ListAgentsRequestState]
The agent state to filter by. Only one state can be specified per query:
state : typing.Optional[str]
The agent state filter. You can specify one or more agent states as a comma-separated list in a single request, for example `state=0,1,2`:
- `IDLE` (0): Agent is idle.
- `STARTING` (1): The agent is being started.
- `RUNNING` (2): The agent is running.
Expand Down Expand Up @@ -729,7 +728,7 @@ async def list(
channel: typing.Optional[str] = None,
from_time: typing.Optional[float] = None,
to_time: typing.Optional[float] = None,
state: typing.Optional[ListAgentsRequestState] = None,
state: typing.Optional[str] = None,
limit: typing.Optional[int] = None,
cursor: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
Expand All @@ -751,8 +750,8 @@ async def list(
to_time : typing.Optional[float]
The end timestamp (in seconds) for the query. Default is current time.

state : typing.Optional[ListAgentsRequestState]
The agent state to filter by. Only one state can be specified per query:
state : typing.Optional[str]
The agent state filter. You can specify one or more agent states as a comma-separated list in a single request, for example `state=0,1,2`:
- `IDLE` (0): Agent is idle.
- `STARTING` (1): The agent is being started.
- `RUNNING` (2): The agent is running.
Expand Down
13 changes: 6 additions & 7 deletions src/agora_agent/agents/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from .types.get_history_agents_response import GetHistoryAgentsResponse
from .types.get_turns_agents_response import GetTurnsAgentsResponse
from .types.interrupt_agents_response import InterruptAgentsResponse
from .types.list_agents_request_state import ListAgentsRequestState
from .types.list_agents_response import ListAgentsResponse
from .types.list_agents_response_data_list_item import ListAgentsResponseDataListItem
from .types.speak_agents_request_priority import SpeakAgentsRequestPriority
Expand Down Expand Up @@ -115,7 +114,7 @@ def list(
channel: typing.Optional[str] = None,
from_time: typing.Optional[float] = None,
to_time: typing.Optional[float] = None,
state: typing.Optional[ListAgentsRequestState] = None,
state: typing.Optional[str] = None,
limit: typing.Optional[int] = None,
cursor: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
Expand All @@ -137,8 +136,8 @@ def list(
to_time : typing.Optional[float]
The end timestamp (in seconds) for the query. Default is current time.

state : typing.Optional[ListAgentsRequestState]
The agent state to filter by. Only one state can be specified per query:
state : typing.Optional[str]
The agent state filter. You can specify one or more agent states as a comma-separated list in a single request, for example `state=0,1,2`:
- `IDLE` (0): Agent is idle.
- `STARTING` (1): The agent is being started.
- `RUNNING` (2): The agent is running.
Expand Down Expand Up @@ -656,7 +655,7 @@ async def list(
channel: typing.Optional[str] = None,
from_time: typing.Optional[float] = None,
to_time: typing.Optional[float] = None,
state: typing.Optional[ListAgentsRequestState] = None,
state: typing.Optional[str] = None,
limit: typing.Optional[int] = None,
cursor: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
Expand All @@ -678,8 +677,8 @@ async def list(
to_time : typing.Optional[float]
The end timestamp (in seconds) for the query. Default is current time.

state : typing.Optional[ListAgentsRequestState]
The agent state to filter by. Only one state can be specified per query:
state : typing.Optional[str]
The agent state filter. You can specify one or more agent states as a comma-separated list in a single request, for example `state=0,1,2`:
- `IDLE` (0): Agent is idle.
- `STARTING` (1): The agent is being started.
- `RUNNING` (2): The agent is running.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ class GetHistoryAgentsResponseContentsItem(UncheckedBaseModel):
Message content.
"""

speech_start_ms: typing.Optional[int] = pydantic.Field(default=None)
"""
The start timestamp of the speech segment in milliseconds, relative to the beginning of the current session. Returned only when `llm.vendor='custom'`.
"""

speech_end_ms: typing.Optional[int] = pydantic.Field(default=None)
"""
The end timestamp of the speech segment in milliseconds, relative to the beginning of the current session. Returned only when `llm.vendor='custom'`.
"""

speech_algorithmic_delay: typing.Optional[int] = pydantic.Field(default=None)
"""
The total delay in milliseconds introduced by audio processing algorithms, including noise reduction, background voice suppression, and voiceprint locking, after audio is captured from the user's microphone. Use this value to align timestamps with cloud recording audio. Returned only when `llm.vendor='custom'`, `contents[].role='user'`, and actual voice input is present.
"""

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
Expand Down
5 changes: 0 additions & 5 deletions src/agora_agent/agents/types/list_agents_request_state.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class StartAgentsRequestProperties(UncheckedBaseModel):

idle_timeout: typing.Optional[int] = pydantic.Field(default=None)
"""
Sets the timeout after all the users specified in `remote_rtc_uids` are detected to have left the channel. When the timeout value is exceeded, the agent automatically stops and exits the channel. A value of `0` means that the agent does not exit until it is stopped manually.
Sets the timeout after all the users specified in `remote_rtc_uids` are detected to have left the channel. When the timeout value is exceeded, the agent automatically stops and exits the channel. A value of `0` disables exit due to channel idle timeout only; it does not allow the agent to run indefinitely. Regardless of this value, the maximum runtime of a single task is 72 hours, after which the agent automatically exits.
"""

geofence: typing.Optional[StartAgentsRequestPropertiesGeofence] = pydantic.Field(default=None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class StartAgentsRequestPropertiesAvatar(UncheckedBaseModel):
- `anam`: Anam (Beta)
- `generic`: Generic (Beta)
- `sensetime`: SenseTime Avatar
- `spatius`: Spatius Avatar
"""

params: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import typing

StartAgentsRequestPropertiesAvatarVendor = typing.Union[
typing.Literal["akool", "liveavatar", "anam", "generic", "sensetime", "heygen"], typing.Any
typing.Literal["akool", "liveavatar", "anam", "generic", "sensetime", "spatius", "heygen"], typing.Any
]
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ class StartAgentsRequestPropertiesParameters(UncheckedBaseModel):
- `aiserver`: Optimized for interactions between the user and the conversational AI agent in terms of latency and network resilience.
"""

opt_out: typing.Optional[bool] = pydantic.Field(default=None)
"""
Whether to disable data retention for the current session:
- `false`: Default. Session data retention remains enabled.
- `true`: Disables session data retention. When disabled, historical session content cannot be used for troubleshooting, effectiveness review, or agent optimization.
"""

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class StartAgentsRequestPropertiesTurnDetectionConfigEndOfSpeech(UncheckedBaseMo
End of speech detection mode:
- `vad`: Based on VAD (Voice Activity Detection). Detects silence duration.
- `semantic`: Based on semantic triggering. Uses semantic understanding to determine when conversation ends.
- `manual`: The client explicitly submits the end of the user turn through signaling.
"""

vad_config: typing.Optional[StartAgentsRequestPropertiesTurnDetectionConfigEndOfSpeechVadConfig] = pydantic.Field(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import typing

StartAgentsRequestPropertiesTurnDetectionConfigEndOfSpeechMode = typing.Union[
typing.Literal["vad", "semantic"], typing.Any
typing.Literal["vad", "semantic", "manual"], typing.Any
]
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class StartAgentsRequestPropertiesTurnDetectionConfigStartOfSpeech(UncheckedBase
- `vad`: Based on VAD (Voice Activity Detection). Uses audio signal detection.
- `keywords`: Deprecated. Use `interruption.mode = "keywords"` instead.
- `disabled`: Deprecated. Use `interruption.enable = false` with `interruption.disabled_config.strategy` to configure the handling strategy.
- `manual`: The client explicitly submits the start of the user turn through signaling.
"""

vad_config: typing.Optional[StartAgentsRequestPropertiesTurnDetectionConfigStartOfSpeechVadConfig] = pydantic.Field(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import typing

StartAgentsRequestPropertiesTurnDetectionConfigStartOfSpeechMode = typing.Union[
typing.Literal["vad", "keywords", "disabled"], typing.Any
typing.Literal["vad", "keywords", "disabled", "manual"], typing.Any
]
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.2.1",
"User-Agent": "agora-agents/v2.3.2",
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "agora-agents",
"X-Fern-SDK-Version": "v2.2.1",
"X-Fern-SDK-Version": "v2.3.2",
**(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 @@ -19,6 +19,7 @@
from .sarvam_asr_params import SarvamAsrParams
from .speechmatics_asr_params import SpeechmaticsAsrParams
from .tencent_asr_params import TencentAsrParams
from .x_ai_asr_params import XAiAsrParams
from .xfyun_asr_params import XfyunAsrParams
from .xfyun_bigmodel_asr_params import XfyunBigmodelAsrParams
from .xfyun_dialect_asr_params import XfyunDialectAsrParams
Expand Down Expand Up @@ -189,6 +190,21 @@ class Config:
extra = pydantic.Extra.allow


class Asr_Xai(UncheckedBaseModel):
vendor: typing.Literal["xai"] = "xai"
language: typing.Optional[AsrLanguage] = None
params: XAiAsrParams

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_Xfyun(UncheckedBaseModel):
vendor: typing.Literal["xfyun"] = "xfyun"
language: typing.Optional[AsrLanguage] = None
Expand Down Expand Up @@ -247,6 +263,7 @@ class Config:
Asr_Assemblyai,
Asr_Speechmatics,
Asr_Sarvam,
Asr_Xai,
Asr_Xfyun,
Asr_XfyunBigmodel,
Asr_XfyunDialect,
Expand Down
39 changes: 39 additions & 0 deletions src/agora_agent/types/generic_tts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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 .generic_tts_params import GenericTtsParams


class GenericTts(UncheckedBaseModel):
"""
Generic OpenAI-compatible Text-to-Speech configuration.
"""

url: str = pydantic.Field()
"""
Callback address of the generic TTS service.
"""

headers: typing.Dict[str, str] = pydantic.Field()
"""
Custom headers to include in requests to the generic TTS service.
"""

params: GenericTtsParams
skip_patterns: typing.Optional[typing.List[int]] = pydantic.Field(default=None)
"""
Controls whether the TTS module skips bracketed content when reading LLM response text.
"""

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
Loading
Loading