-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[VoiceAgents][Do not merge] Voice Agents private preview #48249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
xitzhang
wants to merge
14
commits into
main
Choose a base branch
from
xitzhang/prompt-voice-agent-private-preview
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d5f65f0
Add azure-ai-voiceagents SDK (1.0.0b1)
fa8108b
t pushMerge remote-tracking branch 'origin/main' into xitzhang/prompt…
4a2b434
Fix CI: api.md consistency, mypy/pyright/pylint, cspell, sample links
c8e7f76
Regenerate api.md after aio client __init__ removal
ab532dc
Fix CI: README required sections, pylint unused-import, verifytypes a…
e5cbc65
Potential fix for pull request finding
xitzhang d50050d
update changelog
961f2da
Merge branch 'xitzhang/prompt-voice-agent-private-preview' of https:/…
b1c4957
Potential fix for pull request finding
xitzhang ab1bb95
Potential fix for pull request finding
xitzhang 8d2f4b7
Potential fix for pull request finding
xitzhang a74d4ca
Address PR review comments for azure-ai-voiceagents
eca690e
Fix CI cspell error and async sample Brotli handling in azure-ai-voic…
6e3ef8a
Fix CI pylint unused-import and cspell Efmt errors in azure-ai-voicea…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Release History | ||
|
|
||
| ## 1.0.0b1 (Unreleased) | ||
|
|
||
| ### Other Changes | ||
|
|
||
| - Initial version |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| Copyright (c) Microsoft Corporation. | ||
|
|
||
| MIT License | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| include *.md | ||
| include LICENSE | ||
| include azure/ai/voiceagents/py.typed | ||
| recursive-include tests *.py | ||
| recursive-include samples *.py *.md | ||
| include azure/__init__.py | ||
| include azure/ai/__init__.py |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| # Azure AI Voice Agents client library for Python | ||
|
|
||
| The Azure AI Voice Agents client library lets Python applications create and manage voice agents and read persisted conversation, transcript, and audio data through an Azure AI Foundry project endpoint. | ||
|
|
||
| ## Getting started | ||
|
|
||
| ### Install the package | ||
|
|
||
| ```bash | ||
| python -m pip install azure-ai-voiceagents | ||
| ``` | ||
|
|
||
| #### Prerequisites | ||
|
|
||
| - Python 3.10 or later is required to use this package. | ||
| - You need an [Azure subscription][azure_sub] to use this package. | ||
| - An existing [Azure AI Foundry][azure_ai_foundry] project and its endpoint. | ||
|
|
||
| ### Use with AI tools | ||
|
|
||
| AI coding tools such as VS Code and GitHub Copilot can help you write and debug code that uses this library. See [Using the Azure SDK for Python with AI tools](https://aka.ms/azsdk/python/ai) for available integrations. | ||
|
|
||
| #### Create with an Azure Active Directory Credential | ||
| To use an [Azure Active Directory (AAD) token credential][authenticate_with_token], | ||
| provide an instance of the desired credential type obtained from the | ||
| [azure-identity][azure_identity_credentials] library. | ||
|
|
||
| To authenticate with AAD, you must first [pip][pip] install [`azure-identity`][azure_identity_pip] | ||
|
|
||
| After setup, you can choose which type of [credential][azure_identity_credentials] from azure.identity to use. | ||
| As an example, [DefaultAzureCredential][default_azure_credential] can be used to authenticate the client: | ||
|
|
||
| Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: | ||
| `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET` | ||
|
|
||
| Use the returned token credential to authenticate the client: | ||
|
|
||
| ```python | ||
| >>> from azure.ai.voiceagents import VoiceAgentsClient | ||
| >>> from azure.identity import DefaultAzureCredential | ||
| >>> client = VoiceAgentsClient(endpoint='<endpoint>', credential=DefaultAzureCredential()) | ||
| ``` | ||
|
|
||
| ## Key concepts | ||
|
|
||
| - **Voice agent**: A configured agent that handles voice interactions. Use the | ||
| `voice_agents` operations on `VoiceAgentsClient` to create, retrieve, update, | ||
| list versions of, and delete voice agents. | ||
| - **Conversation**: A persisted record of an interaction with a voice agent, | ||
| including status, timestamps, and aggregate usage. Use the | ||
| `agent_endpoint_conversations` operations to read conversations, transcripts, | ||
| and audio. | ||
| - **Foundry project endpoint**: Voice agents are accessed through an Azure AI | ||
| Foundry project endpoint of the form | ||
| `https://<ai-services-account-name>.services.ai.azure.com/api/projects/<project-name>`. | ||
|
|
||
| ## Examples | ||
|
|
||
| ```python | ||
| >>> from azure.ai.voiceagents import VoiceAgentsClient | ||
| >>> from azure.identity import DefaultAzureCredential | ||
| >>> from azure.core.exceptions import HttpResponseError | ||
|
|
||
| >>> client = VoiceAgentsClient(endpoint='<endpoint>', credential=DefaultAzureCredential()) | ||
| >>> try: | ||
| <!-- write test code here --> | ||
| except HttpResponseError as e: | ||
| print('service responds error: {}'.format(e.response.json())) | ||
|
|
||
| ``` | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| Errors returned by the service are raised as | ||
| [`azure.core.exceptions.HttpResponseError`][http_response_error]. The exception's | ||
| `status_code` and `response` provide details about the failure. For example, a | ||
| missing resource surfaces as a `404` status code, which you can inspect to decide | ||
| whether to retry or skip the operation. | ||
|
|
||
| ## Next steps | ||
|
|
||
| See the [samples][samples] for more complete examples of creating and managing | ||
| voice agents and reading conversation data. | ||
|
|
||
| ## Contributing | ||
|
|
||
| This project welcomes contributions and suggestions. Most contributions require | ||
| you to agree to a Contributor License Agreement (CLA) declaring that you have | ||
| the right to, and actually do, grant us the rights to use your contribution. | ||
| For details, visit https://cla.microsoft.com. | ||
|
|
||
| When you submit a pull request, a CLA-bot will automatically determine whether | ||
| you need to provide a CLA and decorate the PR appropriately (e.g., label, | ||
| comment). Simply follow the instructions provided by the bot. You will only | ||
| need to do this once across all repos using our CLA. | ||
|
|
||
| This project has adopted the | ||
| [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information, | ||
| see the Code of Conduct FAQ or contact opencode@microsoft.com with any | ||
| additional questions or comments. | ||
|
|
||
| <!-- LINKS --> | ||
| [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ | ||
| [authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token | ||
| [azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials | ||
| [azure_identity_pip]: https://pypi.org/project/azure-identity/ | ||
| [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential | ||
| [pip]: https://pypi.org/project/pip/ | ||
| [azure_sub]: https://azure.microsoft.com/free/ | ||
| [azure_ai_foundry]: https://learn.microsoft.com/azure/ai-foundry/ | ||
| [http_response_error]: https://learn.microsoft.com/python/api/azure-core/azure.core.exceptions.httpresponseerror | ||
| [samples]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/voiceagents/azure-ai-voiceagents/samples | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "apiVersion": "v1", | ||
| "apiVersions": { | ||
| "Azure.AI.Projects": "v1" | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.