Skip to content

Commit 47e82cb

Browse files
committed
[fern-generated] Update SDK
Generated by Fern CLI Version: unknown Generators: - fernapi/fern-python-sdk: 4.37.0
1 parent a217c8e commit 47e82cb

45 files changed

Lines changed: 407 additions & 528 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.fern/replay.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.fernignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ docs/
1414
pyproject.toml
1515
poetry.lock
1616
requirements.txt
17+
.fern/replay.lock
18+
.fern/replay.yml
19+
.gitattributes

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.fern/replay.lock linguist-generated=true

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
- name: Publish to pypi
5555
run: |
5656
poetry config repositories.remote https://upload.pypi.org/legacy/
57-
poetry --no-interaction -v publish --build --repository remote --username "__token__" --password "$PYPI_API_TOKEN"
57+
poetry --no-interaction -v publish --build --repository remote --username "$PYPI_USERNAME" --password "$PYPI_PASSWORD"
5858
env:
59-
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
59+
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
60+
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

.github/workflows/release.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ and multimodal flows (MLLM) for real-time audio processing.
1818
- [Documentation](#documentation)
1919
- [Reference](#reference)
2020
- [Mllm Flow Multimodal](#mllm-flow-multimodal)
21+
- [Mllm Flow Multimodal](#mllm-flow-multimodal)
2122
- [Usage](#usage)
2223
- [Async Client](#async-client)
2324
- [Exception Handling](#exception-handling)
@@ -278,6 +279,71 @@ client.agents.start(
278279
```
279280

280281

282+
## MLLM Flow (Multimodal)
283+
284+
For real-time audio processing using OpenAI's Realtime API or Google Gemini Live, use the MLLM (Multimodal Large Language Model) flow instead of the cascading ASR -> LLM -> TTS flow. See the [MLLM Overview](https://docs.agora.io/en/conversational-ai/models/mllm/overview) for more details.
285+
286+
```python
287+
from agora-agent-server-sdk import Agora
288+
from agora-agent-server-sdk.agents import (
289+
StartAgentsRequestProperties,
290+
StartAgentsRequestPropertiesAdvancedFeatures,
291+
StartAgentsRequestPropertiesMllm,
292+
StartAgentsRequestPropertiesMllmVendor,
293+
StartAgentsRequestPropertiesTts,
294+
StartAgentsRequestPropertiesTtsVendor,
295+
StartAgentsRequestPropertiesLlm,
296+
StartAgentsRequestPropertiesTurnDetection,
297+
StartAgentsRequestPropertiesTurnDetectionType,
298+
)
299+
300+
client = Agora(
301+
customer_id="YOUR_CUSTOMER_ID",
302+
customer_secret="YOUR_CUSTOMER_SECRET",
303+
)
304+
305+
client.agents.start(
306+
appid="your_app_id",
307+
name="mllm_agent",
308+
properties=StartAgentsRequestProperties(
309+
channel="channel_name",
310+
token="your_token",
311+
agent_rtc_uid="1001",
312+
remote_rtc_uids=["1002"],
313+
idle_timeout=120,
314+
advanced_features=StartAgentsRequestPropertiesAdvancedFeatures(
315+
enable_mllm=True,
316+
),
317+
mllm=StartAgentsRequestPropertiesMllm(
318+
url="wss://api.openai.com/v1/realtime",
319+
api_key="<your_openai_api_key>",
320+
vendor=StartAgentsRequestPropertiesMllmVendor.OPENAI,
321+
params={
322+
"model": "gpt-4o-realtime-preview",
323+
"voice": "alloy",
324+
},
325+
input_modalities=["audio"],
326+
output_modalities=["text", "audio"],
327+
greeting_message="Hello! I'm ready to chat in real-time.",
328+
),
329+
turn_detection=StartAgentsRequestPropertiesTurnDetection(
330+
type=StartAgentsRequestPropertiesTurnDetectionType.SERVER_VAD,
331+
threshold=0.5,
332+
silence_duration_ms=500,
333+
),
334+
# TTS and LLM are still required but not used when MLLM is enabled
335+
tts=StartAgentsRequestPropertiesTts(
336+
vendor=StartAgentsRequestPropertiesTtsVendor.MICROSOFT,
337+
params={},
338+
),
339+
llm=StartAgentsRequestPropertiesLlm(
340+
url="https://api.openai.com/v1/chat/completions",
341+
),
342+
),
343+
)
344+
```
345+
346+
281347
## Usage
282348

283349
Instantiate and use the client with the following:
@@ -288,6 +354,9 @@ from agora_agent.agents import (
288354
StartAgentsRequestProperties,
289355
StartAgentsRequestPropertiesAsr,
290356
StartAgentsRequestPropertiesLlm,
357+
StartAgentsRequestPropertiesTurnDetection,
358+
StartAgentsRequestPropertiesTurnDetectionConfig,
359+
StartAgentsRequestPropertiesTurnDetectionConfigEndOfSpeech,
291360
)
292361

293362
client = Agora(
@@ -325,6 +394,13 @@ client.agents.start(
325394
greeting_message="Hello, how can I assist you today?",
326395
failure_message="Please hold on a second.",
327396
),
397+
turn_detection=StartAgentsRequestPropertiesTurnDetection(
398+
config=StartAgentsRequestPropertiesTurnDetectionConfig(
399+
end_of_speech=StartAgentsRequestPropertiesTurnDetectionConfigEndOfSpeech(
400+
mode="semantic",
401+
),
402+
),
403+
),
328404
),
329405
)
330406
```
@@ -341,6 +417,9 @@ from agora_agent.agents import (
341417
StartAgentsRequestProperties,
342418
StartAgentsRequestPropertiesAsr,
343419
StartAgentsRequestPropertiesLlm,
420+
StartAgentsRequestPropertiesTurnDetection,
421+
StartAgentsRequestPropertiesTurnDetectionConfig,
422+
StartAgentsRequestPropertiesTurnDetectionConfigEndOfSpeech,
344423
)
345424

346425
client = AsyncAgora(
@@ -381,6 +460,13 @@ async def main() -> None:
381460
greeting_message="Hello, how can I assist you today?",
382461
failure_message="Please hold on a second.",
383462
),
463+
turn_detection=StartAgentsRequestPropertiesTurnDetection(
464+
config=StartAgentsRequestPropertiesTurnDetectionConfig(
465+
end_of_speech=StartAgentsRequestPropertiesTurnDetectionConfigEndOfSpeech(
466+
mode="semantic",
467+
),
468+
),
469+
),
384470
),
385471
)
386472

reference.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ from agora_agent.agents import (
3232
StartAgentsRequestProperties,
3333
StartAgentsRequestPropertiesAsr,
3434
StartAgentsRequestPropertiesLlm,
35+
StartAgentsRequestPropertiesTurnDetection,
36+
StartAgentsRequestPropertiesTurnDetectionConfig,
37+
StartAgentsRequestPropertiesTurnDetectionConfigEndOfSpeech,
3538
)
3639

3740
client = Agora(
@@ -69,6 +72,13 @@ client.agents.start(
6972
greeting_message="Hello, how can I assist you today?",
7073
failure_message="Please hold on a second.",
7174
),
75+
turn_detection=StartAgentsRequestPropertiesTurnDetection(
76+
config=StartAgentsRequestPropertiesTurnDetectionConfig(
77+
end_of_speech=StartAgentsRequestPropertiesTurnDetectionConfigEndOfSpeech(
78+
mode="semantic",
79+
),
80+
),
81+
),
7282
),
7383
)
7484

@@ -242,7 +252,6 @@ The agent state to filter by. Only one state can be specified per query:
242252
- `RUNNING` (2): The agent is running.
243253
- `STOPPING` (3): The agent is stopping.
244254
- `STOPPED` (4): The agent has exited.
245-
- `RECOVERING` (5): The agent is recovering.
246255
- `FAILED` (6): The agent failed to execute.
247256

248257
</dd>
@@ -516,6 +525,22 @@ client.agents.get_turns(
516525
<dl>
517526
<dd>
518527

528+
**page_index:** `typing.Optional[int]` — The page number. Starts from 1.
529+
530+
</dd>
531+
</dl>
532+
533+
<dl>
534+
<dd>
535+
536+
**page_size:** `typing.Optional[int]` — The number of dialogue turns returned per page.
537+
538+
</dd>
539+
</dl>
540+
541+
<dl>
542+
<dd>
543+
519544
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
520545

521546
</dd>
@@ -540,7 +565,7 @@ client.agents.get_turns(
540565
<dl>
541566
<dd>
542567

543-
Stop the specified conversational agent instance.
568+
Stop the specified conversational agent instance. The API responds after request parameters are validated, and the stop operation is processed asynchronously after the response is returned.
544569
</dd>
545570
</dl>
546571
</dd>
@@ -1015,6 +1040,7 @@ client.agent_management.agent_think(
10151040

10161041
The action to take when the agent is in a listening state:
10171042
- `inject`: Inject the custom text instruction into the current turn without interrupting it.
1043+
- `interrupt`: Immediately interrupt the current flow and initiate a new round of dialogue.
10181044
- `ignore`: Ignore the request.
10191045

10201046
</dd>

src/agora_agent/agent_management/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def agent_think(
7272
on_listening_action : typing.Optional[AgentThinkAgentManagementRequestOnListeningAction]
7373
The action to take when the agent is in a listening state:
7474
- `inject`: Inject the custom text instruction into the current turn without interrupting it.
75+
- `interrupt`: Immediately interrupt the current flow and initiate a new round of dialogue.
7576
- `ignore`: Ignore the request.
7677
7778
on_thinking_action : typing.Optional[AgentThinkAgentManagementRequestOnThinkingAction]
@@ -186,6 +187,7 @@ async def agent_think(
186187
on_listening_action : typing.Optional[AgentThinkAgentManagementRequestOnListeningAction]
187188
The action to take when the agent is in a listening state:
188189
- `inject`: Inject the custom text instruction into the current turn without interrupting it.
190+
- `interrupt`: Immediately interrupt the current flow and initiate a new round of dialogue.
189191
- `ignore`: Ignore the request.
190192
191193
on_thinking_action : typing.Optional[AgentThinkAgentManagementRequestOnThinkingAction]

src/agora_agent/agent_management/raw_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def agent_think(
6565
on_listening_action : typing.Optional[AgentThinkAgentManagementRequestOnListeningAction]
6666
The action to take when the agent is in a listening state:
6767
- `inject`: Inject the custom text instruction into the current turn without interrupting it.
68+
- `interrupt`: Immediately interrupt the current flow and initiate a new round of dialogue.
6869
- `ignore`: Ignore the request.
6970
7071
on_thinking_action : typing.Optional[AgentThinkAgentManagementRequestOnThinkingAction]
@@ -167,6 +168,7 @@ async def agent_think(
167168
on_listening_action : typing.Optional[AgentThinkAgentManagementRequestOnListeningAction]
168169
The action to take when the agent is in a listening state:
169170
- `inject`: Inject the custom text instruction into the current turn without interrupting it.
171+
- `interrupt`: Immediately interrupt the current flow and initiate a new round of dialogue.
170172
- `ignore`: Ignore the request.
171173
172174
on_thinking_action : typing.Optional[AgentThinkAgentManagementRequestOnThinkingAction]

src/agora_agent/agent_management/types/agent_think_agent_management_request_on_listening_action.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
import typing
44

5-
AgentThinkAgentManagementRequestOnListeningAction = typing.Union[typing.Literal["inject", "ignore"], typing.Any]
5+
AgentThinkAgentManagementRequestOnListeningAction = typing.Union[
6+
typing.Literal["inject", "interrupt", "ignore"], typing.Any
7+
]

0 commit comments

Comments
 (0)