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
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ pip install agent-server-sdk
Use the **builder pattern** with `Agent` and `AgentSession`. The SDK auto-generates all required tokens:

```python
from agent import AgentClient, Area
from agent.agentkit import Agent, expires_in_hours
from agent.agentkit.vendors import AliyunLLM, MiniMaxTTS, FengmingSTT
from shengwang_agent import AgentClient, Area
from shengwang_agent.agentkit import Agent, expires_in_hours
from shengwang_agent.agentkit.vendors import AliyunLLM, MiniMaxTTS, FengmingSTT

client = AgentClient(
area=Area.CN,
Expand Down Expand Up @@ -104,8 +104,8 @@ client.stop_agent(agent_session_id)
Generate tokens yourself and pass them in — useful when inspecting or reusing tokens:

```python
from agent import AgentClient, Area
from agent.agentkit.token import generate_convo_ai_token, expires_in_hours
from shengwang_agent import AgentClient, Area
from shengwang_agent.agentkit.token import generate_convo_ai_token, expires_in_hours

APP_ID = "your-app-id"
APP_CERT = "your-app-certificate"
Expand Down Expand Up @@ -153,8 +153,8 @@ A full reference for this library is available [here](https://github.com/Shengwa
Instantiate and use the client with the following:

```python
from agent import AgentClient, MicrosoftTtsParams, Tts_Microsoft
from agent.agents import (
from shengwang_agent import AgentClient, MicrosoftTtsParams, Tts_Microsoft
from shengwang_agent.agents import (
StartAgentsRequestProperties,
StartAgentsRequestPropertiesAsr,
StartAgentsRequestPropertiesLlm,
Expand Down Expand Up @@ -206,8 +206,8 @@ The SDK also exports an `async` client so that you can make non-blocking calls t
```python
import asyncio

from agent import AsyncAgentClient, MicrosoftTtsParams, Tts_Microsoft
from agent.agents import (
from shengwang_agent import AsyncAgentClient, MicrosoftTtsParams, Tts_Microsoft
from shengwang_agent.agents import (
StartAgentsRequestProperties,
StartAgentsRequestPropertiesAsr,
StartAgentsRequestPropertiesLlm,
Expand Down Expand Up @@ -264,7 +264,7 @@ When the API returns a non-success status code (4xx or 5xx response), a subclass
will be thrown.

```python
from agent.core.api_error import ApiError
from shengwang_agent.core.api_error import ApiError

try:
client.agents.start(...)
Expand All @@ -278,7 +278,7 @@ except ApiError as e:
Paginated requests will return a `SyncPager` or `AsyncPager`, which can be used as generators for the underlying object.

```python
from agent import AgentClient
from shengwang_agent import AgentClient

client = AgentClient(
authorization="YOUR_AUTHORIZATION",
Expand Down Expand Up @@ -312,7 +312,7 @@ The SDK provides access to raw response data, including headers, through the `.w
The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.

```python
from agent import AgentClient
from shengwang_agent import AgentClient

client = AgentClient(
...,
Expand Down Expand Up @@ -356,7 +356,7 @@ The SDK defaults to a 60 second timeout. You can configure this with a timeout o

```python

from agent import AgentClient
from shengwang_agent import AgentClient

client = AgentClient(
...,
Expand All @@ -377,7 +377,7 @@ and transports.

```python
import httpx
from agent import AgentClient
from shengwang_agent import AgentClient

client = AgentClient(
...,
Expand Down
12 changes: 6 additions & 6 deletions docs/concepts/agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The `Agent` class is a fluent builder for configuring AI agent properties. It co
## Constructor

```python
from agent.agentkit import Agent
from shengwang_agent.agentkit import Agent

agent = Agent(
name='support-assistant',
Expand Down Expand Up @@ -73,8 +73,8 @@ Each `with_*` method returns a **new** `Agent` instance — the original is unch
## Chaining Example

```python
from agent.agentkit import Agent
from agent.agentkit.vendors import AliyunLLM, MiniMaxTTS, FengmingSTT
from shengwang_agent.agentkit import Agent
from shengwang_agent.agentkit.vendors import AliyunLLM, MiniMaxTTS, FengmingSTT

agent = (
Agent(name='my-agent', instructions='你是一个智能助手。')
Expand All @@ -89,9 +89,9 @@ agent = (
Because each `with_*` call returns a new `Agent`, you can build a base configuration and create multiple sessions from it:

```python
from agent import AgentClient, Area
from agent.agentkit import Agent
from agent.agentkit.vendors import AliyunLLM, MiniMaxTTS, FengmingSTT
from shengwang_agent import AgentClient, Area
from shengwang_agent.agentkit import Agent
from shengwang_agent.agentkit.vendors import AliyunLLM, MiniMaxTTS, FengmingSTT

client = AgentClient(area=Area.CN, app_id='your-app-id', app_certificate='your-app-certificate')

Expand Down
12 changes: 6 additions & 6 deletions docs/concepts/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,18 @@ The `Agent` builder class is the same for both — it does not make HTTP calls,

```python
# Top-level client and types
from agent import AgentClient, AsyncAgentClient, Area, Pool
from shengwang_agent import AgentClient, AsyncAgentClient, Area, Pool

# Agentkit layer
from agent.agentkit import Agent, AgentSession
from agent.agentkit.agent_session import AsyncAgentSession
from shengwang_agent.agentkit import Agent, AgentSession
from shengwang_agent.agentkit.agent_session import AsyncAgentSession

# Vendor classes
from agent.agentkit.vendors import AliyunLLM, MiniMaxTTS, FengmingSTT
from shengwang_agent.agentkit.vendors import AliyunLLM, MiniMaxTTS, FengmingSTT

# Token helpers
from agent.agentkit.token import generate_rtc_token
from shengwang_agent.agentkit.token import generate_rtc_token

# Also available from top-level
from agent import Agent, AgentSession, AsyncAgentSession, generate_rtc_token
from shengwang_agent import Agent, AgentSession, AsyncAgentSession, generate_rtc_token
```
6 changes: 3 additions & 3 deletions docs/concepts/session.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ You can check the current state with `session.status`.
Use `Agent.create_session()` to create a session:

```python
from agent import AgentClient, Area
from agent.agentkit import Agent
from agent.agentkit.vendors import AliyunLLM, MiniMaxTTS, FengmingSTT
from shengwang_agent import AgentClient, Area
from shengwang_agent.agentkit import Agent
from shengwang_agent.agentkit.vendors import AliyunLLM, MiniMaxTTS, FengmingSTT

client = AgentClient(area=Area.CN, app_id='your-app-id', app_certificate='your-app-certificate')

Expand Down
10 changes: 5 additions & 5 deletions docs/concepts/vendors.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The SDK provides typed vendor classes for every supported provider. Each vendor
All vendor classes are available from `agent.agentkit.vendors`:

```python
from agent.agentkit.vendors import AliyunLLM, MiniMaxTTS, FengmingSTT
from shengwang_agent.agentkit.vendors import AliyunLLM, MiniMaxTTS, FengmingSTT
```

## LLM Vendors
Expand All @@ -27,7 +27,7 @@ Used with `agent.with_llm()` for the cascading flow (ASR → LLM → TTS).
| `CustomLLM` | Custom endpoint | `api_key` |

```python
from agent.agentkit.vendors import AliyunLLM
from shengwang_agent.agentkit.vendors import AliyunLLM

llm = AliyunLLM(api_key='your-aliyun-key', model='qwen-max')
```
Expand All @@ -47,7 +47,7 @@ Used with `agent.with_tts()`. Each TTS vendor produces audio at a specific sampl
| `StepFunTTS` | StepFun | `key` |

```python
from agent.agentkit.vendors import MiniMaxTTS
from shengwang_agent.agentkit.vendors import MiniMaxTTS

tts = MiniMaxTTS(key='your-minimax-key', voice_id='your-voice-id')
```
Expand All @@ -66,7 +66,7 @@ Used with `agent.with_stt()`.
| `XfyunDialectSTT` | Xfyun Dialect | `app_id`, `api_key` |

```python
from agent.agentkit.vendors import FengmingSTT
from shengwang_agent.agentkit.vendors import FengmingSTT

stt = FengmingSTT(language='zh-CN')
```
Expand All @@ -80,7 +80,7 @@ Used with `agent.with_avatar()`. Avatars require specific TTS sample rates — s
| `SensetimeAvatar` | Sensetime | `api_key`, `agora_uid` |

```python
from agent.agentkit.vendors import SensetimeAvatar
from shengwang_agent.agentkit.vendors import SensetimeAvatar

avatar = SensetimeAvatar(api_key='your-sensetime-key', agora_uid='2')
```
Expand Down
16 changes: 8 additions & 8 deletions docs/getting-started/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Pass your App ID and App Certificate. The SDK generates a fresh ConvoAI token (c
### Sync

```python
from agent import AgentClient, Area
from shengwang_agent import AgentClient, Area

client = AgentClient(
area=Area.CN,
Expand All @@ -27,7 +27,7 @@ client = AgentClient(
### Async

```python
from agent import AsyncAgentClient, Area
from shengwang_agent import AsyncAgentClient, Area

client = AsyncAgentClient(
area=Area.CN,
Expand All @@ -43,7 +43,7 @@ Use your customer ID and customer secret. The SDK sends `Authorization: Basic ba
### Sync

```python
from agent import AgentClient, Area
from shengwang_agent import AgentClient, Area

client = AgentClient(
area=Area.CN,
Expand All @@ -57,7 +57,7 @@ client = AgentClient(
### Async

```python
from agent import AsyncAgentClient, Area
from shengwang_agent import AsyncAgentClient, Area

client = AsyncAgentClient(
area=Area.CN,
Expand All @@ -73,8 +73,8 @@ client = AsyncAgentClient(
Pass a manually generated `agora token=...` string via `auth_token`. Use this for debugging or when you want to control the REST API token lifecycle yourself:

```python
from agent import AgentClient, Area
from agent.agentkit.token import generate_convo_ai_token
from shengwang_agent import AgentClient, Area
from shengwang_agent.agentkit.token import generate_convo_ai_token

raw_token = generate_convo_ai_token(
app_id='your-app-id',
Expand Down Expand Up @@ -104,7 +104,7 @@ client = AgentClient(
For advanced use cases you can generate tokens directly:

```python
from agent.agentkit.token import generate_rtc_token, generate_convo_ai_token
from shengwang_agent.agentkit.token import generate_rtc_token, generate_convo_ai_token

# RTC-only token (for channel join)
rtc_token = generate_rtc_token(
Expand Down Expand Up @@ -153,7 +153,7 @@ auth_header = f'agora token={convo_token}'
When the SDK auto-generates a token (app credentials mode, or session without a pre-built `token`), the default lifetime is **86400 seconds (24 hours)**. You can customise this via `expires_in` on `create_session()`:

```python
from agent.agentkit import expires_in_hours, expires_in_minutes
from shengwang_agent.agentkit import expires_in_hours, expires_in_minutes

session = agent.create_session(
client,
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ The SDK supports both synchronous and asynchronous usage:

```python
# Sync
from agent import AgentClient, Area
from shengwang_agent import AgentClient, Area

# Async
from agent import AsyncAgentClient, AsyncAgentSession, Area
from shengwang_agent import AsyncAgentClient, AsyncAgentSession, Area
```

Both clients share the same constructor parameters and capabilities. See [Authentication](./authentication.md) for setup details.
12 changes: 6 additions & 6 deletions docs/getting-started/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ This guide walks you through building a voice agent using the cascading flow (AS
This complete script creates an agent with Aliyun for the LLM, MiniMax for TTS, and Fengming for STT:

```python
from agent import AgentClient, Area
from agent.agentkit import Agent
from agent.agentkit.vendors import AliyunLLM, MiniMaxTTS, FengmingSTT
from shengwang_agent import AgentClient, Area
from shengwang_agent.agentkit import Agent
from shengwang_agent.agentkit.vendors import AliyunLLM, MiniMaxTTS, FengmingSTT

# 1. Create a client with app credentials
client = AgentClient(
Expand Down Expand Up @@ -56,9 +56,9 @@ For async applications, use `AsyncAgentClient` for the client. All session metho

```python
import asyncio
from agent import AsyncAgentClient, Area
from agent.agentkit import Agent
from agent.agentkit.vendors import AliyunLLM, MiniMaxTTS, FengmingSTT
from shengwang_agent import AsyncAgentClient, Area
from shengwang_agent.agentkit import Agent
from shengwang_agent.agentkit.vendors import AliyunLLM, MiniMaxTTS, FengmingSTT

async def main():
# 1. Create an async client
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: Debug logging, raw response data, retries, timeouts, and custom htt
Enable HTTP request/response logging by passing `debug=True` when creating the client. This logs each request (method, URL, headers, body preview) and response (status, headers) before and after it is sent. Authorization headers are redacted.

```python
from agent import AgentClient, Area
from shengwang_agent import AgentClient, Area

client = AgentClient(
area=Area.US,
Expand All @@ -38,7 +38,7 @@ logging.getLogger("agent").setLevel(logging.DEBUG)
Use `.with_raw_response` to get a client that returns raw responses with `.headers` and `.data`:

```python
from agent import AgentClient, Area
from shengwang_agent import AgentClient, Area

client = AgentClient(
area=Area.US,
Expand Down Expand Up @@ -86,7 +86,7 @@ Pass a custom `httpx.Client` or `httpx.AsyncClient` for proxies, custom transpor

```python
import httpx
from agent import AgentClient, Area
from shengwang_agent import AgentClient, Area

client = AgentClient(
area=Area.US,
Expand Down
Loading
Loading