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
Copy file name to clipboardExpand all lines: README.md
+41-20Lines changed: 41 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ pip install agora-agents
19
19
20
20
## Quick Start
21
21
22
-
Start with the `Agent` builder: create a client with app credentials, choose your ASR, LLM, and TTS providers, then start a session. Omit vendor API keys for supported Agora-managed models, or provide keys when you want BYOK.
22
+
Start with the `Agent` builder: create a client with app credentials, pass it to `Agent(client=client, ...)`, choose your ASR, LLM, and TTS providers, then start a session. Omit vendor API keys for supported Agora-managed global models, or provide keys when you want BYOK.
23
23
Set Agora interaction language with `turn_detection.language`; provider-specific STT language values remain under `asr.params`. Ares uses only the REST `asr.language` value sourced from `turn_detection.language`.
`Agora` generates the required ConvoAI REST auth and RTC join tokens automatically when you provide `app_id` and `app_certificate`. For supported Agora-managed models, leave vendor API keys unset; provide keys when you want BYOK.
97
+
`Agora` generates the required ConvoAI REST auth and RTC join tokens automatically when you provide `app_id` and `app_certificate`. For supported Agora-managed global models, leave vendor API keys unset; provide keys when you want BYOK. CN MiniMax TTS is not Agora-managed in the same way and typically includes `key`.
98
+
99
+
### Regional agent builders
100
+
101
+
Bind the client once with `Agent(client=client, ...)` and pass vendor classes directly such as `OpenAI(...)` or `MiniMaxTTS(...)`. The bound client selects the API routing region and provides IDE hints via `CNAgent` / `GlobalAgent`, but does not restrict which vendor classes you can use. See `[docs/guides/regional-routing.md](./docs/guides/regional-routing.md)` for regional examples.
98
102
99
103
## AI Studio pipeline IDs
100
104
101
105
Use `pipeline_id` when you want a published AI Studio pipeline to provide the base agent configuration:
@@ -133,7 +140,7 @@ AgentKit sends the resolved value as the top-level `/join` field `pipeline_id`,
133
140
Use the same `Agent` builder shape, but provide credentials explicitly when you want vendor-managed billing and routing instead of Agora-managed models.
Copy file name to clipboardExpand all lines: docs/concepts/agent.md
+24-20Lines changed: 24 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,17 @@ description: The Agent builder — configure an AI agent with LLM, TTS, STT, and
6
6
7
7
# Agent
8
8
9
-
The `Agent` class is a fluent builder for configuring AI agent properties. It collects vendor settings (LLM, TTS, STT, MLLM, avatar) and session parameters, then produces a fully configured `AgentSession` when you call `create_session()`.
9
+
The `Agent` class is a fluent builder for configuring AI agent properties. Pass a bound `Agora` or `AsyncAgora` client with `client=...` — it is required for `create_session()` and `create_async_session()`. The builder collects vendor settings (LLM, TTS, STT, MLLM, avatar) and produces a fully configured `AgentSession` when you call `create_session()`. The agent instance name is set on `create_session(name=...)`, not on the `Agent` constructor.
10
10
11
11
## Constructor
12
12
13
13
<!-- snippet: executable -->
14
14
```python
15
-
from agora_agent import Agent, OpenAI
15
+
from agora_agent import Agent, Agora, Area, OpenAI
|`name`|`str`| No | Agent display name (used as session name if not overridden) |
34
+
|`client`|`Agora` / `AsyncAgora`| Yes | Authenticated client from `Agora(...)` or `AsyncAgora(...)`. Required for `create_session()` and `create_async_session()`. |
35
+
|`pipeline_id`|`str`| No | Published AI Studio pipeline ID used as this agent's base configuration |
33
36
|`instructions`|`str`| No | Deprecated. Use LLM vendor `system_messages` instead. |
34
37
|`greeting`|`str`| No | Deprecated. Use LLM/MLLM vendor `greeting_message` instead. |
35
38
|`failure_message`|`str`| No | Deprecated. Use LLM/MLLM vendor `failure_message` instead. |
|`filler_words`|`FillerWordsConfig`| No | Filler words while waiting for LLM |
45
48
49
+
When `client` is provided, `Agent(client=...)` returns `CNAgent` for `Area.CN` and `GlobalAgent` for global areas.
50
+
46
51
## Builder Methods
47
52
48
53
Each `with_*` method returns a **new**`Agent` instance — the original is unchanged. This immutability lets you safely reuse a base configuration for multiple sessions.
@@ -63,7 +68,6 @@ Each `with_*` method returns a **new** `Agent` instance — the original is unch
63
68
|---|---|---|
64
69
|`with_instructions(text)`|`str`| Deprecated. Use LLM vendor `system_messages` instead. |
65
70
|`with_greeting(text)`|`str`| Deprecated. Use LLM/MLLM vendor `greeting_message` instead. |
66
-
|`with_name(name)`|`str`| Override the agent name |
67
71
|`with_turn_detection(config)`|`TurnDetectionConfig`| Configure `turn_detection.language` and cascading-flow SOS/EOS detection; use `with_interruption()` for interruption behavior |
68
72
|`with_sal(config)`|`SalConfig`| Set SAL configuration |
69
73
|`with_advanced_features(features)`|`Dict[str, Any]`| Set advanced features |
@@ -79,11 +83,12 @@ Each `with_*` method returns a **new** `Agent` instance — the original is unch
79
83
80
84
<!-- snippet: executable -->
81
85
```python
82
-
from agora_agent import Agent
83
-
from agora_agent import OpenAI, ElevenLabsTTS, DeepgramSTT
86
+
from agora_agent import Agent, Agora, Area, DeepgramSTT, ElevenLabsTTS, OpenAI
Creates a new `AgentSession` bound to a client and channel.
133
+
Creates a new `AgentSession`using the client already bound to the agent. Pass the agent instance name via the `name` parameter here — it is sent to the Start Agent API when the session starts.
Copy file name to clipboardExpand all lines: docs/concepts/architecture.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ The Python SDK has three layers:
26
26
27
27
This is the primary developer-facing API. It provides:
28
28
29
-
-**`Agent`** — a fluent builder for configuring AI agents with LLM, TTS, STT, MLLM, and avatar vendors
29
+
-**`Agent`** — a fluent builder for configuring AI agents with LLM, TTS, STT, MLLM, and avatar vendors. Requires a bound `Agora` / `AsyncAgora` client via `client=...`.
Copy file name to clipboardExpand all lines: docs/concepts/session.md
+35-5Lines changed: 35 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,8 @@ description: Manage the full lifecycle of a running Agora Conversational AI agen
8
8
9
9
`AgentSession` (sync) and `AsyncAgentSession` (async) manage the lifecycle of a running AI agent. They handle starting, stopping, sending speech, interrupting, updating configuration, and retrieving history.
10
10
11
+
Presets are configured at session creation time when you use them explicitly. Most applications should configure vendors on the `Agent` builder instead — see [Quick Start](../getting-started/quick-start.md).
12
+
11
13
## State Machine
12
14
13
15
An agent session moves through these states:
@@ -31,16 +33,17 @@ You can check the current state with `session.status`.
31
33
32
34
## Creating a Session
33
35
34
-
Use `Agent.create_session()` to create a session:
36
+
Use `Agent.create_session()` to create a session. The parent `Agent` must be constructed with `client=...`. Set the agent instance name with the `name` parameter — this value is sent to the Start Agent API when you call `session.start()`.
35
37
36
38
<!-- snippet: executable -->
37
39
```python
38
-
from agora_agent import Agent, Agora, Area, OpenAI, ElevenLabsTTS, DeepgramSTT
40
+
from agora_agent import Agent, Agora, Area, DeepgramSTT, ElevenLabsTTS, OpenAI
When you omit credentials for supported Agora-managed global models on the builder, AgentKit sends the matching Agora-managed configuration at session start. Pass your own vendor API keys when you need BYOK. CN MiniMax TTS is not Agora-managed in the same way and typically includes `key`.
123
+
124
+
<!-- snippet: fragment -->
125
+
```python
126
+
from agora_agent import Agent, Agora, Area, DeepgramSTT, OpenAI, OpenAITTS
0 commit comments