Howie/release 2.7.0 - #49051
Draft
Howie Leung (howieleung) wants to merge 24 commits into
Draft
Howie/release 2.7.0#49051Howie Leung (howieleung) wants to merge 24 commits into
Howie Leung (howieleung) wants to merge 24 commits into
Conversation
… into howie/release-2.7.0
|
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. |
…nges, and sample updates
…ocumentation for clarity
… variable arguments and update metadata for version 2.7.0
- Ignore sample_voice_agent_live_text_conversation.py/_async.py in azpysdk's recursive samples check (both eng/tools/azure-sdk-tools/azpysdk/samples.py and scripts/devops_tasks/test_run_samples.py): the interactive input() loop has no timeout/ignore entry, so an automated run can block indefinitely or raise EOFError. - Add a new test_agent_voice_samples group in tests/samples/test_samples.py covering samples/agents/voice/, which was previously undiscovered since get_sample_paths only lists files directly under samples/agents. The 4 pure-HTTP samples (basic, generate, versions, with_tools) are now live recorded and run for real; the 4 WebSocket-based ones (live_text_conversation, live_function_tool, read_conversation, read_conversation_audio) stay skipped since they can't be captured/replayed by the test proxy. New recordings pushed to azure-sdk-assets and assets.json updated to the new tag. - sample_voice_agent_generate.py: wrap the post-create output in try/finally so the agent is always deleted even if reading/printing the generated definition raises. - sample_voice_agent_read_conversation.py / _audio.py: require FOUNDRY_VOICE_AGENT_NAME and FOUNDRY_VOICE_CONVERSATION_ID to be set together or both left unset, instead of treating them independently (which could mutate a user-owned agent without cleanup, or silently pair a conversation id with the wrong default agent).
Per Howie's PR review suggestion: since the temp agent this sample creates always has exactly one version, capture create_version's return value and clean up with agents.delete_version(agent_name, agent_version) instead of agents.delete(agent_name). Functionally equivalent in the normal case (deleting an agent's last version also removes the agent, verified live), but more surgical/consistent with the versioned-resource model. Live-tested end-to-end for both samples' zero-config path: create temp agent, hold conversation, read back (transcript / audio), clean up via delete_version, confirmed agent fully removed afterward. black/pylint clean.
Relax the env-var validation from "both or neither" to "conversation_id requires agent_name" (one-directional), so pointing FOUNDRY_VOICE_AGENT_NAME at your own existing agent without a conversation_id is now supported: the sample holds a new conversation against it instead of erroring out. Only call create_version (and only clean up via delete_version afterward) when the agent is auto-created by this sample; an explicitly named agent is assumed to already exist and is used as-is, never modified or deleted. hold_sample_conversation already raises a clear error if it isn't actually configured with store=True. Live-verified all 4 combinations for both samples: neither set (auto-create + cleanup), agent-only (new conversation on existing agent, left unmodified, not deleted), conversation-id-only (blocked with a clear ValueError), and both set (unchanged, fully manual). black/pylint clean.
This reverts commit 805ef88.
This reverts commit f81b04c.
This reverts commit a8942e0.
…y; improve documentation formatting in _enums.py; update commit reference in tsp-location.yaml
* Address Copilot review feedback on voice-agent samples/tests - Ignore sample_voice_agent_live_text_conversation.py/_async.py in azpysdk's recursive samples check (both eng/tools/azure-sdk-tools/azpysdk/samples.py and scripts/devops_tasks/test_run_samples.py): the interactive input() loop has no timeout/ignore entry, so an automated run can block indefinitely or raise EOFError. - Add a new test_agent_voice_samples group in tests/samples/test_samples.py covering samples/agents/voice/, which was previously undiscovered since get_sample_paths only lists files directly under samples/agents. The 4 pure-HTTP samples (basic, generate, versions, with_tools) are now live recorded and run for real; the 4 WebSocket-based ones (live_text_conversation, live_function_tool, read_conversation, read_conversation_audio) stay skipped since they can't be captured/replayed by the test proxy. New recordings pushed to azure-sdk-assets and assets.json updated to the new tag. - sample_voice_agent_generate.py: wrap the post-create output in try/finally so the agent is always deleted even if reading/printing the generated definition raises. - sample_voice_agent_read_conversation.py / _audio.py: require FOUNDRY_VOICE_AGENT_NAME and FOUNDRY_VOICE_CONVERSATION_ID to be set together or both left unset, instead of treating them independently (which could mutate a user-owned agent without cleanup, or silently pair a conversation id with the wrong default agent). * Use delete_version instead of delete for temp agent cleanup Per Howie's PR review suggestion: since the temp agent this sample creates always has exactly one version, capture create_version's return value and clean up with agents.delete_version(agent_name, agent_version) instead of agents.delete(agent_name). Functionally equivalent in the normal case (deleting an agent's last version also removes the agent, verified live), but more surgical/consistent with the versioned-resource model. Live-tested end-to-end for both samples' zero-config path: create temp agent, hold conversation, read back (transcript / audio), clean up via delete_version, confirmed agent fully removed afterward. black/pylint clean. * Refactor constructors in BetaRealtime and AsyncBetaRealtime to accept variable arguments and update metadata for version 2.7.0 * Support agent-name-only mode in read-conversation samples Relax the env-var validation from "both or neither" to "conversation_id requires agent_name" (one-directional), so pointing FOUNDRY_VOICE_AGENT_NAME at your own existing agent without a conversation_id is now supported: the sample holds a new conversation against it instead of erroring out. Only call create_version (and only clean up via delete_version afterward) when the agent is auto-created by this sample; an explicitly named agent is assumed to already exist and is used as-is, never modified or deleted. hold_sample_conversation already raises a clear error if it isn't actually configured with store=True. Live-verified all 4 combinations for both samples: neither set (auto-create + cleanup), agent-only (new conversation on existing agent, left unmodified, not deleted), conversation-id-only (blocked with a clear ValueError), and both set (unchanged, fully manual). black/pylint clean. * Address Copilot review feedback on voice-agent samples/tests - Ignore sample_voice_agent_live_text_conversation.py/_async.py in azpysdk's recursive samples check (both eng/tools/azure-sdk-tools/azpysdk/samples.py and scripts/devops_tasks/test_run_samples.py): the interactive input() loop has no timeout/ignore entry, so an automated run can block indefinitely or raise EOFError. - Add a new test_agent_voice_samples group in tests/samples/test_samples.py covering samples/agents/voice/, which was previously undiscovered since get_sample_paths only lists files directly under samples/agents. The 4 pure-HTTP samples (basic, generate, versions, with_tools) are now live recorded and run for real; the 4 WebSocket-based ones (live_text_conversation, live_function_tool, read_conversation, read_conversation_audio) stay skipped since they can't be captured/replayed by the test proxy. New recordings pushed to azure-sdk-assets and assets.json updated to the new tag. - sample_voice_agent_generate.py: wrap the post-create output in try/finally so the agent is always deleted even if reading/printing the generated definition raises. - sample_voice_agent_read_conversation.py / _audio.py: require FOUNDRY_VOICE_AGENT_NAME and FOUNDRY_VOICE_CONVERSATION_ID to be set together or both left unset, instead of treating them independently (which could mutate a user-owned agent without cleanup, or silently pair a conversation id with the wrong default agent). * Use delete_version instead of delete for temp agent cleanup Per Howie's PR review suggestion: since the temp agent this sample creates always has exactly one version, capture create_version's return value and clean up with agents.delete_version(agent_name, agent_version) instead of agents.delete(agent_name). Functionally equivalent in the normal case (deleting an agent's last version also removes the agent, verified live), but more surgical/consistent with the versioned-resource model. Live-tested end-to-end for both samples' zero-config path: create temp agent, hold conversation, read back (transcript / audio), clean up via delete_version, confirmed agent fully removed afterward. black/pylint clean. * Support agent-name-only mode in read-conversation samples Relax the env-var validation from "both or neither" to "conversation_id requires agent_name" (one-directional), so pointing FOUNDRY_VOICE_AGENT_NAME at your own existing agent without a conversation_id is now supported: the sample holds a new conversation against it instead of erroring out. Only call create_version (and only clean up via delete_version afterward) when the agent is auto-created by this sample; an explicitly named agent is assumed to already exist and is used as-is, never modified or deleted. hold_sample_conversation already raises a clear error if it isn't actually configured with store=True. Live-verified all 4 combinations for both samples: neither set (auto-create + cleanup), agent-only (new conversation on existing agent, left unmodified, not deleted), conversation-id-only (blocked with a clear ValueError), and both set (unchanged, fully manual). black/pylint clean. --------- Co-authored-by: Xiting Zhang <xitzhang@microsoft.com> Co-authored-by: Howie Leung <howieleung@microsoft.com>
…sdk-for-python into howie/release-2.7.0
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…sdk-for-python into howie/release-2.7.0
…t versions instead of the entire agent
…y mode (#49071) sample_voice_agent_read_conversation.py and its audio counterpart called create_version() on FOUNDRY_VOICE_AGENT_NAME whenever no conversation_id was set, even when agent_name pointed to a real, user-owned agent rather than a temporary one created by the sample. If that agent's current version content happened to match the sample's hardcoded definition, the service deduped and returned the existing version instead of creating a new one; the sample's cleanup then deleted that version, which -- since it was the agent's only version -- deleted the entire agent. Fix: capture owns_agent = not agent_name before defaulting agent_name, and only call create_version (and thus only ever populate created_version, which gates the delete_version cleanup) when owns_agent is true. When the caller names their own agent, the sample now holds a conversation against it directly and never creates, mutates, or deletes it. Verified live against the worst-case fixture (agent content byte-identical to the sample's hardcoded definition) across all 4 FOUNDRY_VOICE_AGENT_NAME / FOUNDRY_VOICE_CONVERSATION_ID combinations for both samples: the agent-only mode no longer issues any create/delete calls and the agent survives, while the other 3 combinations are unaffected. Co-authored-by: Xiting Zhang <xitzhang@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ions and update related documentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
General Guidelines and Best Practices
Testing Guidelines