feat(providers/azure): add speech
Background
Continuing the migration of Orate, this PR migrates transcription functionality for Azure.
Summary
This pull request introduces support for Azure OpenAI speech models in the AI SDK. The changes include new documentation, examples, and test cases to demonstrate and verify the functionality.
New Feature: Azure OpenAI Speech Models
- Added support for Azure OpenAI speech models using the
.speech()factory method. This includes the ability to generate speech with various options such as voice, speed, and response format. (content/providers/01-ai-sdk-providers/03-azure.mdx,packages/azure/src/azure-openai-provider.ts, [1] [2] - Updated documentation to include Azure OpenAI speech models in the list of supported models and provided usage examples. (
content/docs/03-ai-sdk-core/37-speech.mdx, content/docs/03-ai-sdk-core/37-speech.mdxL144-R149)
Examples
- Added multiple example scripts demonstrating how to use the Azure OpenAI speech models with different options like instructions, speed, and voice. (
examples/ai-core/src/generate-speech/azure-instructions.ts,examples/ai-core/src/generate-speech/azure-speed.ts,examples/ai-core/src/generate-speech/azure-voice.ts,examples/ai-core/src/generate-speech/azure.ts, [1] [2] [3]
Tests
- Added tests to verify the functionality of the Azure OpenAI speech models, including generating audio data and checking the content type of the response. (
packages/azure/src/azure-openai-provider.test.ts, [1] [2]
Additional Changes
- Created a changeset to document the new feature addition. (
.changeset/seven-kangaroos-think.md, .changeset/seven-kangaroos-think.mdR1-R5)
Tasks
- [x] Tests for the changes have been added (for bug fixes / features)
- [x] Docs have been added / updated (for bug fixes / features)
- [x] If required, a patch changeset for relevant packages has been added
- [x] You've run
pnpm prettier-fixto fix any formatting issues
Future Work
Leaving this in draft as all the tests and checks passed but I haven't run the example files myself yet.
Any planned ETA as to when this will be merged?
Sorry, we didn't get to this in time. Please re-create the PR if the change is still needed and we'll take a look! This comment is automated as part of our triage process. Truly sorry for the inconvenieince, we are doing our best 🖤