Skip to content

Add post-call delivery configuration and related models to VoiceAgent… - #49813

Open
Howie Leung (howieleung) wants to merge 20 commits into
mainfrom
feature/azure-ai-projects/vnext
Open

Howie Leung (howieleung) wants to merge 20 commits into
mainfrom
feature/azure-ai-projects/vnext

Conversation

@howieleung

Copy link
Copy Markdown
Member

… (#49805)

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
9 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new post-call delivery feature lacks a required changelog entry covering VoiceAgentDefinition.post_call, Event Grid/routine destinations, and the preview restriction on audio delivery, leaving the capability and limitation out of release notes.

1 open issue
What changed in this PR

Adds post-call delivery configuration to Voice Agents in azure-ai-projects, allowing callers to configure Event Grid and routine destinations.

Changes:

  • Adds VoiceAgentDefinition.post_call, destination models, and related enums; documents that audio delivery is unsupported in this preview.
  • Exports the new types and refreshes API snapshots, cross-language mappings, and the TypeSpec revision.
  • Adds Pylint suppressions to the sample CI runner.
File Description
sdk/​ai/​azure-ai-projects/​tsp-location.yaml Updates the source specification commit.
sdk/​ai/​azure-ai-projects/​tests/​samples/​ci/​run_samples.py Suppresses line-length and unused-suppression warnings.
sdk/​ai/​azure-ai-projects/​azure/​ai/​projects/​models/​_models.py Adds post-call configuration and destination models.
sdk/​ai/​azure-ai-projects/​azure/​ai/​projects/​models/​_enums.py Adds destination and delivery-content enums.
sdk/​ai/​azure-ai-projects/​azure/​ai/​projects/​models/​__init__.py Exports the new models and enums.
sdk/​ai/​azure-ai-projects/​apiview-properties.json Updates cross-language API mappings and version.
sdk/​ai/​azure-ai-projects/​api.metadata.yml Refreshes the API hash.
sdk/​ai/​azure-ai-projects/​api.md Records the expanded public API.

Review effort: Balanced

@github-actions

This comment has been minimized.

Copilot AI balanced review requested due to automatic review settings November 4, 2026 19:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new post_call API lacks tests for serialization and polymorphic decoding of both destination subtypes, and release notes omit the feature and its preview audio restriction.

2 open issues

Review effort: Balanced

Comment on lines +29806 to +29808
destinations: list["_models.VoiceAgentPostCallDestination"] = rest_field(
visibility=["read", "create", "update", "delete", "query"]
)
- Improved the clarity of SSE frame documentation in AgentsOperations by formatting the description of the `data` field.
- Expanded the list of known values for the `provider` keyword in BetaVoiceAgentsTelephonyOperations to include "sip" for both bindings and calls.
- Updated the commit reference in tsp-location.yaml to reflect the latest changes in the Azure REST API specs repository.
Copilot AI balanced review requested due to automatic review settings November 4, 2026 20:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new handoff events return dictionaries instead of typed models in both sync and async dispatch, and transfer_tool annotations incorrectly exclude valid null values.

4 open issues

Review effort: Balanced

Comment on lines +659 to +661
VoiceAgentServerEventSessionHandoffAborted,
VoiceAgentServerEventSessionHandoffCompleted,
VoiceAgentServerEventSessionHandoffStarted,
- Introduced new methods for managing live conversations in the BetaVoiceAgentsLiveConversationsOperations class, including listing, retrieving, deleting, and streaming audio for live conversations.
- Updated public methods documentation to reflect the addition of 9 new methods under the `beta.voice_agents.live_conversations` namespace.
- Updated the TSP location YAML file to point to the latest commit in the Azure REST API specs repository.
@github-actions

This comment has been minimized.

Copilot AI balanced review requested due to automatic review settings November 5, 2026 22:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread sdk/ai/azure-ai-projects/CHANGELOG.md Resolved
@github-actions

This comment has been minimized.

Copilot AI balanced review requested due to automatic review settings November 6, 2026 00:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* [azure-ai-projects] Add GPT Live WebSocket clients and samples

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix GPT Live event registry type narrowing

Validate generated event registry values through a Mapping of objects so Pyright correctly narrows model classes without casts. Add invalid-registry regression coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* [azure-ai-projects] Add GPT Live REST conversation samples

Add sync and async REST-only samples for stored conversation, item, and recording APIs, with opt-in downloads and deletion. Add 42 enabled offline guards and related documentation. Verified all 18 sync/async REST targets against the real service and 555 focused unit cases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* [azure-ai-projects] Address GPT Live review feedback

Protect input WAV recordings from hard-linked output aliases, normalize mapping inputs in Live serialization, and await cancellation-safe shared asynchronous transport cleanup. Add deterministic regressions for all three findings while preserving existing close-error behavior. Verified 580 focused unit cases and type/lint/build checks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* [azure-ai-projects] Add microphone mode to GPT Live audio sample

Extend the existing audio sample with optional PyAudio microphone capture and speaker playback, preserving WAV mode. Bound device buffering, surface callback/send errors, report actual audio bytes, and gracefully close the session on Ctrl+C. Add 24 microphone guards and related documentation. Verified 162 focused tests, both CLI modes against the live service, and user-confirmed physical microphone operation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add recorded GPT Live REST coverage

Cover all nine dedicated Live REST methods in sync and async Test Proxy lifecycles, including pagination, audio content, HTTP statuses, deletion and safe fixture cleanup. Reference the published recording assets and add offline playback regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Align GPT Live samples with review conventions

Consolidate Live samples, remove CLI arguments, use user-temporary audio output, and cover resource ownership and sample conventions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Make GPT Live conversation REST sample self-contained

Create and clean up a stored greeting conversation when no existing ID is supplied. Preserve read-only behavior for supplied IDs and remove source-shape and filename assertions per review while retaining behavioral coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Simplify GPT Live REST sample test coverage

Reuse the existing REST fixture for success and failure cleanup checks. Remove the simulated greeting, clock, and persistence test setup without changing the sample.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Simplify handwritten VoiceAgents documentation

Clarify Realtime and GPT Live setup, sample choices, and client descriptions without changing runtime behavior, public APIs, generated code, or tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* [azure-ai-projects] Align Live WebSocket support with regenerated SDK

Use canonical Realtime/Live query parameters, native discriminator readback, and persisted Live delegation models. Update sync/async documentation, sample constructors and contract tests, and classify never-released Live changes as new features in the changelog.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* [azure-ai-projects] Align custom Live clients and recording layout with vnext

Use native session-update delegation models, preserve typed Foundry ownership and recorded Live REST coverage, expose Live conversation operations, and add typed Realtime handoff dispatch. Refresh API artifacts and unreleased sample notes. Rebase and revalidate this local checkpoint against the newly advanced vnext target before publication.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* [azure-ai-projects] Complete vnext event alignment and refresh API

Expose typed system-tool argument and input-collection events in both Realtime clients, preserving native vnext model names and generated output. Verify the rebased custom SDK with 1,973 passing tests and 120 existing skips, refresh the exact-wheel paired API artifacts, and keep never-released Live changes under features.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix Voice sample docs, streaming tests, and spelling scope

Use absolute source links for strict Sphinx builds, make sync and async connection-error tests deterministic behind CI proxies, and keep voice spelling additions in the AI service configuration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Expand VoiceAgents samples and regression coverage

Add async WebSocket and sync REST examples, native feature and recorded CRUD tests, and protocol regression coverage. Fix the Live connection sample audio clock, simplify sample tests and documentation, and reference verified sanitized recordings.

The generated-audio artifact test remains enabled; its recording is pending because the live service did not publish the artifact during validation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Deduplicate VoiceAgents samples by protocol

Keep one example per scenario: synchronous REST and asynchronous WebSocket workflows. Remove duplicate counterparts, convert the remaining WebSocket entrypoints, and migrate workflow regressions and documentation to the retained examples.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Simplify Voice Agent samples and fix CI validation

Bundle a synthetic spoken-question WAV with shared optional input-path handling, simplify the Live function-tool workflow and documentation, and remove source-shape sample tests while retaining behavioral coverage.

Align the Projects development version and API metadata with 2.11.0 Unreleased, and isolate mocked management-policy requests from inherited CI proxy settings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Keep Voice Agent PR changes scoped to AI

Remove the out-of-scope Azure Core streaming and management-policy test changes. Restore all three Core test files to the PR target while preserving every AI change and the latest target-branch merge.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix interrupted generated-audio recording test

Wait for the persisted interrupted conversation item without requiring an optional generated-audio artifact. Validate the documented not-found result after incomplete generation, while retaining full metadata and WAV validation when audio is returned.

Reference the genuine sanitized cancellation recording and preserve deletion and error-propagation checks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Xiting Zhang <xitzhang@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions

This comment has been minimized.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 6, 2026 02:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions

This comment has been minimized.

- Introduced TelephonyCampaignDatasetReference model to represent dataset references in telephony campaigns.
- Updated DatasetReference model to require a concrete version.
- Refactored TelephonyCampaign to use TelephonyCampaignDatasetReference for recipient_dataset.
- Implemented BetaVoiceAgentsCampaignsOperations for managing telephony campaigns, including create, cancel, and delete operations.
- Added tests for campaign long-running operations (LRO) to ensure correct behavior and error handling.
- Updated public methods documentation to include new campaign operations.
- Cleaned up sample scripts and test files for consistency and readability.
Copilot AI balanced review requested due to automatic review settings November 6, 2026 18:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Timeout handling remains incomplete: a stalled audio send can bypass the overall deadline, while Python 3.10 receive timeouts bypass cancellation and terminate the sample with a traceback.

10 open issues
1 resolved since last review
1 file not reviewed
  • eng/emitter-package-lock.json: Generated file

Review effort: Balanced

while True:
remaining_time(deadline, event_type)
if time.monotonic() >= next_frame:
await connection.session.input_audio.append(audio=silence)
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor
[Pilot] PR Pipeline Failure Analysis

What failed

Pipeline build 7048526 (python - pullrequest) failed across multiple jobs:

  1. Build Analyze — a spell-check (cspell) failure on a file added/modified by this PR:
    sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_campaigns_lro.py:349:50 - Unknown word (Acancel).
    This is a genuine unrecognized token (Acancel, likely a typo or missing word-boundary, e.g. cancel glued to a prefix) introduced by the PR's new voice-agent test file, causing the Analyze job to fail and exit PowerShell with code 1.

  2. Build Test ubuntu2404_311_ib1 and Build Test windows2022_312_ib1 (both whl and sdist variants) — azure-core test failures unrelated to this PR's diff:

    • tests/test_rest_stream_responses.py::test_iter_with_error
    • tests/async_tests/test_rest_stream_responses_async.py::test_iter_with_error

    Both raise ValueError: Should error before entering from a raise ValueError(...) placed inside the test body itself (not library code), at test_rest_stream_responses.py:64 and test_rest_stream_responses_async.py:56, under a with pytest.raises(ServiceRequestError): block for a request to (doesnotexist/redacted) This indicates the azure-coreHTTP client did not raiseServiceRequestErroras expected for an unresolvable host, so execution fell through to the test's own deliberateraise ValueError. This failure is identical across both OS platforms and both package formats (whl/sdist), consistent with a shared root cause in azure-core's request-error handling rather than anything touched by this PR (which only changes sdk/ai/azure-ai-projects`).

  3. Build Test Ubuntu2404_314 also reported FAILURE on the PR checks list, consistent with the same cascading Build Analyze cspell failure blocking the stage.

Relevant pipeline output
2026-11-06T19:34:04.4747940Z ##[error]sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_campaigns_lro.py:349:50 - Unknown word (Acancel)
2026-11-06T19:34:04.4750546Z ##[error]Spelling errors detected. To correct false positives or learn about spell checking see: https://aka.ms/azsdk/engsys/spellcheck
2026-11-06T19:34:04.5601616Z ##[error]PowerShell exited with code 1.
tests/test_rest_stream_responses.py:64: ValueError
E   ValueError: Should error before entering

Recommended next steps

  • Fixable (Build Analyze / cspell): Correct or add the unrecognized word Acancel at sdk/ai/azure-ai-projects/tests/agents/test_voice_agent_campaigns_lro.py:349:50 — likely a typo missing a space/underscore (e.g. Acancel → A cancel or a_cancel), or add it to the repo's cspell dictionary if it is an intentional identifier.
  • Not fixable by this PR's code change (azure-core test failures): These failures occur in sdk/core/azure-core tests, a package this PR does not modify, and reproduce identically on both OS platforms and distribution formats — a strong signal of a pre-existing/flaky azure-core issue unrelated to this PR. Recommend retrying the pipeline and, if it persists, filing/triaging against azure-core's ServiceRequestError handling for unreachable hosts separately from this PR.
  • See https://aka.ms/ci-fix

Automated fix: Requested

Generated by Pipeline Analysis Next Steps · copilot · sonnet50 · 52.6 AIC · ⌖ 0.573 AIC · ⊞ 9.1K · ◷

…ust release date, and enhance sample updates

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants