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
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,19 @@ control events.
- `src/voice-live-bridge-basic-python/model_contract.py` — model backend protocol shared without
circular imports
- `src/voice-live-bridge-basic-python/model_client.py` — Foundry Responses model adapter
- `src/voice-live-bridge-basic-python/requirements.txt` — fully pinned runtime dependency graph
- `src/voice-live-bridge-basic-python/pyproject.toml` — runtime and development dependencies
- `src/voice-live-bridge-basic-python/uv.lock` — fully pinned dependency graph
- `sample.yaml` — repository build-readiness validation

Do not commit `.vscode` launch or task files generated by the Foundry Toolkit.

## Dependency workflow

Follow `samples/python/hosted-agents/DEPENDENCY_POLICY.md`. The runtime
`requirements.txt` is the portable consumer artifact and must pin the complete direct and
transitive graph. Regenerate it whenever a dependency input changes, and run the static and
resolver-backed policy checks before completing dependency changes.
Follow `samples/python/hosted-agents/DEPENDENCY_POLICY.md`. Runtime and development
dependencies are declared in `pyproject.toml`; `uv.lock` is the portable, fully
pinned consumer artifact. Regenerate the lock whenever a dependency input changes,
and run the static and resolver-backed policy checks before completing dependency
changes.

## Runtime logging

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ history mutation, or hosted-agent handoff.

## Prerequisites

1. Python 3.13.
2. Azure Developer CLI (`azd`) 1.27.1 or later with the Foundry extension.
3. Azure CLI authentication for local model access.
4. A Foundry project and model deployment, or permission for `azd provision` to create them.
1. Python 3.13 or later.
2. [uv](https://docs.astral.sh/uv/getting-started/installation/) 0.11.7 or later,
installed and available on `PATH`.
3. Azure Developer CLI (`azd`) 1.27.1 or later with the Foundry extension.
4. Azure CLI authentication for local model access.
5. A Foundry project and model deployment, or permission for `azd provision` to create them.

Install and authenticate the tools:

Expand Down Expand Up @@ -113,9 +115,8 @@ sample therefore uses the protocol-aware smoke client instead of the standard In
From the sample source directory:

```bash
python3.13 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt -r requirements-dev.txt
python -m pip install uv
uv sync --frozen
cp .env.example .env
```

Expand All @@ -129,7 +130,7 @@ Load the environment and start the server:
set -a
source .env
set +a
python main.py
uv run --no-sync python main.py
```

The server listens on `PORT` or port `8088` and exposes `GET /readiness` and the
Expand All @@ -140,7 +141,7 @@ The server listens on `PORT` or port `8088` and exposes `GET /readiness` and the
The smoke test sends `/help`, so it validates the Bridge wire flow without calling a model:

```bash
python scripts/smoke_test.py
uv run --no-sync python scripts/smoke_test.py
```

Expected message sequence:
Expand Down Expand Up @@ -182,8 +183,8 @@ the Voice wrapper and Voice Live.
Tests use deterministic fake model streams and make no cloud calls:

```bash
python -m pytest -q
ruff check .
uv run --no-sync python -m pytest -q
uv run --no-sync ruff check .
```

From the repository root, run the standard per-sample validator:
Expand Down Expand Up @@ -214,7 +215,7 @@ bash .github/scripts/validate-sample.sh \
Protocol `1.0`. This is separate from the `invocations_ws` transport version in `azure.yaml`.
- If model calls fail locally, verify `FOUNDRY_PROJECT_ENDPOINT`,
`AZURE_AI_MODEL_DEPLOYMENT_NAME`, and the active Azure CLI identity.
- If the smoke test cannot connect, start `python main.py` first and verify that port `8088` is
- If the smoke test cannot connect, start `uv run --no-sync python main.py` first and verify that port `8088` is
available, or set the smoke client's URL to match `PORT`.

## Next steps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ name: Voice Live Bridge Basic Python
description: A hosted text agent implementing Voice Live Bridge Protocol 1.0.

build: >-
python -m pip install --disable-pip-version-check
-r src/voice-live-bridge-basic-python/requirements.txt
-r src/voice-live-bridge-basic-python/requirements-dev.txt
cd src/voice-live-bridge-basic-python &&
uv sync --frozen
validate: >-
cd src/voice-live-bridge-basic-python &&
python -m compileall -q . &&
python -c "import azure.ai.agentserver.invocations.voice" &&
python -m ruff check .
uv run --no-sync python -m compileall -q -x '[.]venv' . &&
uv run --no-sync python -c "import azure.ai.agentserver.invocations.voice" &&
uv run --no-sync ruff check .
test: >-
cd src/voice-live-bridge-basic-python &&
python -m pytest -q
uv run --no-sync python -m pytest -q
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
[project]
name = "voice-live-bridge-basic-python"
version = "0.1.0"
description = "A Microsoft Foundry hosted voice bridge agent."
requires-python = ">=3.13"
dependencies = [
"azure-ai-agentserver-core==2.1.0",
"azure-ai-agentserver-invocations==1.1.0",
"azure-identity==1.25.1",
"openai==3.1.0",
"opentelemetry-api==1.43.0",
]

[dependency-groups]
dev = [
"iniconfig==2.3.0",
"pluggy==1.6.0",
"Pygments==2.21.0",
"pytest==9.1.1",
"pytest-asyncio==1.4.0",
"ruff==0.16.5",
"starlette==1.6.0",
"websockets==17.1",
]

[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
Expand All @@ -7,4 +32,4 @@ line-length = 100
target-version = "py313"

[tool.ruff.lint]
select = ["E", "F", "I", "B", "ASYNC"]
select = ["E", "F", "I", "B", "ASYNC"]

This file was deleted.

This file was deleted.

Loading
Loading