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
56 changes: 35 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,60 @@
name: ci

on:
push:
workflow_dispatch:

on: [push]
jobs:
compile:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6

uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v6
uses: actions/setup-python@v4
with:
python-version: '3.8'

python-version: 3.8
- name: Bootstrap poetry
run: curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1

run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
- name: Install dependencies
run: poetry install

- name: Compile
run: poetry run mypy .

test:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6

uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v6
uses: actions/setup-python@v4
with:
python-version: '3.8'

python-version: 3.8
- name: Bootstrap poetry
run: curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1

run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
- name: Install dependencies
run: poetry install

- name: Test
run: poetry run pytest -rP .

publish:
needs: [compile, test]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
- name: Install dependencies
run: poetry install
- name: Publish to pypi
run: |
poetry config repositories.remote https://upload.pypi.org/legacy/
poetry --no-interaction -v publish --build --repository remote --username "$PYPI_USERNAME" --password "$PYPI_PASSWORD"
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
65 changes: 0 additions & 65 deletions .github/workflows/release.yml

This file was deleted.

34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Agora Agent Server SDK for Python
# Agoraio Python Library

[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FAgoraIO-Conversational-AI%2Fagent-server-sdk-python)
[![pypi](https://img.shields.io/pypi/v/agent-server-sdk-python)](https://pypi.python.org/pypi/agent-server-sdk-python)
[![pypi](https://img.shields.io/pypi/v/agora-agent-server-sdk)](https://pypi.python.org/pypi/agora-agent-server-sdk)

The Agora Conversational AI SDK provides convenient access to the Agora Conversational AI APIs,
enabling you to build voice-powered AI agents with support for both cascading flows (ASR -> LLM -> TTS)
Expand Down Expand Up @@ -30,7 +30,7 @@ and multimodal flows (MLLM) for real-time audio processing.
## Installation

```sh
pip install agent-server-sdk-python
pip install agora-agent-server-sdk
```

## Quick Start
Expand Down Expand Up @@ -155,37 +155,36 @@ A full reference for this library is available [here](https://github.com/AgoraIO
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.

```python
from agora_agent import Agora, Area
from agora_agent.agentkit import (
AdvancedFeatures,
TurnDetectionConfig,
TurnDetectionTypeValues,
)
from agora_agent.agents import (
from agora-agent-server-sdk import Agora
from agora-agent-server-sdk.agents import (
StartAgentsRequestProperties,
StartAgentsRequestPropertiesAdvancedFeatures,
StartAgentsRequestPropertiesMllm,
StartAgentsRequestPropertiesMllmVendor,
StartAgentsRequestPropertiesTts,
StartAgentsRequestPropertiesTtsVendor,
StartAgentsRequestPropertiesLlm,
StartAgentsRequestPropertiesTurnDetection,
StartAgentsRequestPropertiesTurnDetectionType,
)

client = Agora(
area=Area.US,
app_id="YOUR_APP_ID",
app_certificate="YOUR_APP_CERTIFICATE",
customer_id="YOUR_CUSTOMER_ID",
customer_secret="YOUR_CUSTOMER_SECRET",
)

client.agents.start(
client.app_id,
appid="your_app_id",
name="mllm_agent",
properties=StartAgentsRequestProperties(
channel="channel_name",
token="your_token",
agent_rtc_uid="1001",
remote_rtc_uids=["1002"],
idle_timeout=120,
advanced_features=AdvancedFeatures(enable_mllm=True),
advanced_features=StartAgentsRequestPropertiesAdvancedFeatures(
enable_mllm=True,
),
mllm=StartAgentsRequestPropertiesMllm(
url="wss://api.openai.com/v1/realtime",
api_key="<your_openai_api_key>",
Expand All @@ -198,8 +197,8 @@ client.agents.start(
output_modalities=["text", "audio"],
greeting_message="Hello! I'm ready to chat in real-time.",
),
turn_detection=TurnDetectionConfig(
type=TurnDetectionTypeValues.SERVER_VAD, # deprecated; use config.end_of_speech instead
turn_detection=StartAgentsRequestPropertiesTurnDetection(
type=StartAgentsRequestPropertiesTurnDetectionType.SERVER_VAD,
threshold=0.5,
silence_duration_ms=500,
),
Expand All @@ -215,6 +214,7 @@ client.agents.start(
)
```


## MLLM Flow (Multimodal)

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.
Expand Down
Loading
Loading