This repository was archived by the owner on Jul 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Implement consistent Whisper task option for OpenAI and Azure bridges #350
Merged
Conversation
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
Co-authored-by: chr-hertel <[email protected]>
Copilot finished work on behalf of
chr-hertel
June 27, 2025 12:39
chr-hertel
reviewed
Jun 27, 2025
chr-hertel
reviewed
Jun 27, 2025
chr-hertel
reviewed
Jun 27, 2025
chr-hertel
reviewed
Jun 27, 2025
Co-authored-by: chr-hertel <[email protected]>
e627a0b
to
bf6653b
Compare
LGTM 👍 thanks @copilot 😄 |
OskarStark
added a commit
to symfony/ai
that referenced
this pull request
Jul 1, 2025
…ges (#350) (Copilot) This PR was merged into the main branch. Discussion ---------- fix: consistent Whisper task option for OpenAI and Azure bridges (#350) | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Docs? | no | Issues | | License | MIT Cherry picking php-llm/llm-chain#350 Commits ------- 5d66c61 fix: consistent Whisper task option for OpenAI and Azure bridges (#350)
symfony-splitter
pushed a commit
to symfony/ai-platform
that referenced
this pull request
Jul 11, 2025
…ges (#350) (Copilot) This PR was merged into the main branch. Discussion ---------- fix: consistent Whisper task option for OpenAI and Azure bridges (#350) | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Docs? | no | Issues | | License | MIT Cherry picking php-llm/llm-chain#350 Commits ------- 5d66c61 fix: consistent Whisper task option for OpenAI and Azure bridges (#350)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR addresses the inconsistency between OpenAI and Azure Whisper implementations by introducing a configurable
task
option that controls which endpoint is used.Problem
Previously, the Whisper implementations were inconsistent:
/audio/transcriptions
endpoint/audio/translations
endpointThis made it impossible to use both transcription and translation features consistently across platforms.
Solution
Introduced a
task
option that allows users to specify whether they want transcription or translation:Changes Made
New Task Interface: Created
PhpLlm\LlmChain\Platform\Bridge\OpenAI\Whisper\Task
with constants:TRANSCRIPTION = 'transcription'
TRANSLATION = 'translation'
Enhanced OpenAI ModelClient:
task
from optionsEnhanced Azure WhisperModelClient:
task
from optionsComprehensive Tests: Added test coverage for both implementations covering all scenarios
Breaking Change
/translations
endpoint. Now it defaults to/transcriptions
for consistency with OpenAI.Migration: If you were relying on Azure Whisper's translation behavior, explicitly specify the task:
Backward Compatibility
Both implementations now behave consistently and support both transcription and translation endpoints.
Fixes #349.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/CodeWithKyrian/chromadb-php/zipball/53bb269c6e76ae9976b0750eed3731d1fdcb9ea5
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/CodeWithKyrian/jinja-php/zipball/3a246c831af5c3c3c532399aa0c1e5209441675f
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/CodeWithKyrian/transformers-libsloader/zipball/7052adad23e969701a961437b77422f820df05ba
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/CodeWithKyrian/transformers-php/zipball/474406c25d33e36fcc4f6225719a46afa82acbf8
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/OskarStark/enum-helper/zipball/adccc8c099db61cb26497a1e1987fc95ebda02a9
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/eea219a577085bd13ff0cb644a422c20798316c7
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/async-aws/bedrock-runtime/zipball/518cd3baa6df494fb0fb029c1149921c1af3fe80
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/async-aws/core/zipball/58ab79116d990e7053b2e31162f47df4223148c5
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/doctrine/dbal/zipball/b37d160498ea91a2382a2ebe825c4ea6254fc0ec
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)/usr/bin/php8.3 -n -c /tmp/lryxyr /usr/bin/composer install --no-dev --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/dompdf/php-font-lib/zipball/a1681e9793040740a405ac5b189275059e2a9863
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/interop-phpobjects/polite-math/zipball/621246cdc108b1388307097e06361ca5b9259467
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/libvips/php-vips/zipball/a54c1cceea581b592a199edd61a7c06f44a24c08
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/mongodb/mongo-php-library/zipball/3bbe7ba9578724c7e1f47fcd17c881c0995baaad
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)/usr/bin/php8.3 -n -c /tmp/Kcp9Lc /usr/bin/composer update --prefer-stable --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)/usr/bin/php8.3 -n -c /tmp/Kcp9Lc /usr/bin/composer update --prefer-stable --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/php-imagine/Imagine/zipball/80ab21434890dee9ba54969d31c51ac8d4d551e0
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/phpstan/phpdoc-parser/zipball/9b30d6fd026b2c132b3985ce6b23bec09ab3aa68
/usr/bin/php8.3 -n -c /tmp/lryxyr /usr/bin/composer install --no-dev --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/rindow/rindow-math-matrix/zipball/6d6622b4495d6325e4065430d143d6f4c3b5f0c4
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/rindow/rindow-matlib-ffi/zipball/b5eddacc8a0fbc640cfdb90d6a40414ba6c76529
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/rindow/rindow-openblas-ffi/zipball/efcddb9b24ac9d2d2f3a7d1092fbd5f66dccbb5e
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/rokka-io/imagine-vips/zipball/6c86dc4a988fbd51081973abd29cbc38989e2e94
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/symfony/console/zipball/66c1440edf6f339fd82ed6c7caa76cb006211b44
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/symfony/http-client-contracts/zipball/75d7043853a42837e68111812f4d964b01e5101c
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)/usr/bin/php8.3 -n -c /tmp/Kcp9Lc /usr/bin/composer update --prefer-stable --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/symfony/http-client/zipball/57e4fb86314015a695a750ace358d07a7e37b8a9
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)/usr/bin/php8.3 -n -c /tmp/Kcp9Lc /usr/bin/composer update --prefer-stable --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)/usr/bin/php8.3 -n -c /tmp/lryxyr /usr/bin/composer install --no-dev --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/symfony/polyfill-php85/zipball/6fedf31ce4e3648f4ff5ca58bfd53127d38f05fd
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)/usr/bin/php8.3 -n -c /tmp/Kcp9Lc /usr/bin/composer update --prefer-stable --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/symfony/string/zipball/f3570b8c61ca887a9e2938e85cb6458515d2b125
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991
/usr/bin/php8.3 -n -c /tmp/kJITtg /usr/bin/composer install --no-interaction --ignore-platform-req=ext-mongodb
(http block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.