Skip to content

feat(agents): support declarative prompt-voice agents (managed model) - #9364

Draft
v1212 wants to merge 3 commits into
Azure:mainfrom
v1212:users/wujia/prompt-voice-agent-managed-model
Draft

feat(agents): support declarative prompt-voice agents (managed model)#9364
v1212 wants to merge 3 commits into
Azure:mainfrom
v1212:users/wujia/prompt-voice-agent-managed-model

Conversation

@v1212

@v1212 v1212 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds azd support for a new declarative prompt-voice agent kind that creates a managed speech-to-speech (voice) agent on Azure AI Foundry, end-to-end through azd initazure.yamlazd deploy.

Scope (intentionally narrow): prompt-voice + managed model only. BYOM, hosted-voice, tools, avatar, and cascaded models are deliberately left as follow-up PRs.

Draft — the create/list/connect contract is validated against the live service. Kept as draft while end-to-end voice session runtime is investigated (see Known gaps).

What's included

  • yaml (agent_yaml/yaml.go, parse.go): new prompt-voice authoring kind + VoiceAgent struct/parsing/validation.
  • map (agent_yaml/map.go): translate authoring kind prompt-voice → data-plane service kind voice; default the audio pipeline (PCM16 @ 24 kHz, server_vad, whisper-1, DragonHD default voice); v1 = implicit model_type: managed.
  • agent_api (agent_api/models.go, operations.go): VoiceAgentDefinition wire structs + CreateVoiceAgent with the required preview header Foundry-Features: VoiceAgents=V1Preview.
  • project (project/agent_definition.go, service_target_agent.go): voice-aware definition read/write + an isolated deployVoiceAgent deploy path — the existing hosted/container path is byte-for-byte unchanged.
  • init (cmd/init.go, init_from_templates_helpers.go): --kind / --voice flags, voice manifest synthesis, and a new prompt option.
  • schema + tests: azure.ai.agent.json gains the prompt-voice kind + voice service properties; unit tests cover the map translation, voice-type selection, and manifest parse/validation.

Compatibility

All changes are additive — new case branches with untouched defaults and omitempty fields. Existing azd init / invoke / deploy / list flows and the hosted/workflow code paths are unchanged.

Testing

  • go build ./..., go vet ./..., and cspell clean.
  • New unit tests (map_voice_test.go, parse_voice_test.go) plus the existing suite pass.
  • Live validation against a real Foundry project (proj-voice): an agent created via the real CreateVoiceAgentAPIRequest + CreateVoiceAgent code appears in the project list and its stored definition is byte-identical to the service's own managed reference agent (kind:voice / model_type:managed / audio pipeline / voice config). Connect reaches session.created.

Known gaps (why this is a draft)

  • End-to-end voice session runtime still surfaces errors that reproduce equally on the service's own reference managed agent (e.g. session.audio.output.voice string coercion at the Voice Live layer, and a demo-client session.update framing issue) — being investigated; not specific to this change.

Follow-ups

  • BYOM (self_deployed) model type
  • hosted-voice, tools, avatar, cascaded models

Add azd support for a new 'prompt-voice' agent kind that creates a
managed speech-to-speech (voice) agent on Azure AI Foundry.

- yaml: new prompt-voice kind + VoiceAgent authoring struct/parsing
- map: translate authoring kind prompt-voice -> data-plane kind voice,
  defaulting the audio pipeline (PCM16@24k, server_vad, whisper-1,
  DragonHD default voice) and v1 implicit managed model_type
- agent_api: VoiceAgentDefinition wire structs + CreateVoiceAgent with
  Foundry-Features: VoiceAgents=V1Preview preview header
- project: voice-aware agent_definition read/write + isolated
  deployVoiceAgent deploy path (container path unchanged)
- init: --kind/--voice flags, voice manifest synthesis, prompt option

Scope: prompt-voice + managed model only. BYOM, hosted-voice, tools,
avatar, and cascaded models are follow-ups. Draft: needs further
end-to-end session testing and optimization.
@azure-pipelines

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

@github-actions github-actions Bot added the ext-agents azure.ai.agents extension label Jul 30, 2026
- map_voice_test.go: cover CreateVoiceAgentAPIRequest defaults/overrides,
  managed enforcement, BYOM rejection, missing-model error, and the
  isOpenAIVoice/buildVoiceConfig voice-type selection
- parse_voice_test.go: cover prompt-voice manifest parsing and
  ValidateAgentDefinition (ok / missing model.id / self_deployed rejected)
- azure.ai.agent.json: add prompt-voice to the kind enum and document the
  voice service properties (modelType/model/instructions/voice/store)
- cspell.yaml: allow BYOM
The azure.ai.projects synthesis copy must stay byte-identical to the
azure.ai.agents copy (TestAgentsSynthesisCopyMatches). Mirror the
prompt-voice comment update made in the agents synthesizer.

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.

Pull request overview

Adds managed declarative prompt-voice agents across initialization, configuration, API mapping, and deployment.

Changes:

  • Adds voice-agent YAML/schema models and validation.
  • Maps voice manifests to Foundry’s preview API contract.
  • Adds voice-specific initialization and deployment paths with tests.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
schemas/azure.ai.agent.json Adds voice-agent schema fields.
internal/synthesis/synthesizer.go Marks voice agents as non-container.
internal/project/service_target_agent.go Adds voice deployment handling.
internal/project/agent_definition.go Adds inline voice configuration conversion.
internal/pkg/agents/agent_yaml/yaml.go Defines voice authoring models.
internal/pkg/agents/agent_yaml/parse.go Parses and validates voice manifests.
internal/pkg/agents/agent_yaml/parse_voice_test.go Tests voice parsing and validation.
internal/pkg/agents/agent_yaml/map.go Maps voice manifests to API requests.
internal/pkg/agents/agent_yaml/map_voice_test.go Tests voice request mapping.
internal/pkg/agents/agent_api/operations.go Adds the preview create operation.
internal/pkg/agents/agent_api/models.go Defines voice API wire models.
internal/cmd/init.go Adds voice initialization flags and flow.
internal/cmd/init_from_templates_helpers.go Adds the interactive voice option.
cspell.yaml Adds voice-related terminology.

Comment on lines +1079 to +1082
if va, isVoice, vErr := VoiceAgentFromResolvedService(serviceConfig, p.projectPath); vErr != nil {
return nil, vErr
} else if isVoice {
return p.deployVoiceAgent(ctx, serviceConfig, va, azdEnv, progress)
Comment on lines +1286 to +1290
// Prompt-voice fast path: when --kind prompt-voice is set without a
// manifest, there is no source to scaffold and no template/language to
// choose. Synthesize a declarative (managed) voice manifest and route it
// through the manifest flow (which skips the init-mode / template /
// language prompts and code scaffolding). Mirrors the --image fast path.
Comment on lines +1299 to +1304
if flags.image != "" {
return exterrors.Validation(
exterrors.CodeInvalidParameter,
"--kind prompt-voice cannot be combined with --image",
"a voice agent is managed and has no container image; drop --image",
)
Comment on lines +1785 to +1787
for key, value := range map[string]string{
fmt.Sprintf("AGENT_%s_NAME", serviceKey): agentObject.Name,
fmt.Sprintf("AGENT_%s_ENDPOINT", serviceKey): baseEndpoint,
@github-actions github-actions Bot added the ext-projects azure.ai.projects extension label Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext-agents azure.ai.agents extension ext-projects azure.ai.projects extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants