-
Notifications
You must be signed in to change notification settings - Fork 90
feat: support using the action with Azure-hosted OpenAI models #47
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
Merged
Merged
Changes from all commits
Commits
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
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 |
|---|---|---|
|
|
@@ -18,6 +18,10 @@ inputs: | |
| description: "OpenAI API key used by Codex." | ||
| required: false | ||
| default: "" | ||
| responses-api-endpoint: | ||
| description: "Optional Responses API endpoint override, e.g. https://example.openai.azure.com/openai/v1/responses. Defaults to the proxy's built-in endpoint when empty." | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Defaults to Responses API when empty? |
||
| required: false | ||
| default: "" | ||
| working-directory: | ||
| description: "Working directory that Codex should use. Defaults to the repository root." | ||
| required: false | ||
|
|
@@ -165,17 +169,29 @@ runs: | |
| fi | ||
|
|
||
| # This is its own step to minimize the runtime logic that has access to the | ||
| # API key. Note we use `env -u OPENAI_API_KEY` to ensure extra copies of the | ||
| # key do not end up in the memory of the `codex-responses-api-proxy` process | ||
| # where environment variables are stored. | ||
| # API key. Note we use `env -u PROXY_API_KEY` to ensure extra copies of the | ||
| # key do not end up in the memory of the `codex-responses-api-proxy` | ||
| # process where environment variables are stored. | ||
| - name: Start Responses API proxy | ||
| if: ${{ inputs['openai-api-key'] != '' && steps.start_proxy.outputs.server_info_file_exists == 'false' }} | ||
| env: | ||
| OPENAI_API_KEY: ${{ inputs['openai-api-key'] }} | ||
| PROXY_API_KEY: ${{ inputs['openai-api-key'] }} | ||
| shell: bash | ||
| run: | | ||
| upstream_url="${{ inputs['responses-api-endpoint'] }}" | ||
|
|
||
| args=( | ||
| codex-responses-api-proxy | ||
| --http-shutdown | ||
| --server-info "${{ steps.derive_server_info.outputs.server_info_file }}" | ||
| ) | ||
|
|
||
| if [ -n "$upstream_url" ]; then | ||
| args+=(--upstream-url "$upstream_url") | ||
| fi | ||
|
|
||
| ( | ||
| printenv OPENAI_API_KEY | env -u OPENAI_API_KEY codex-responses-api-proxy --http-shutdown --server-info "${{ steps.derive_server_info.outputs.server_info_file }}" | ||
| printenv PROXY_API_KEY | env -u PROXY_API_KEY "${args[@]}" | ||
| ) & | ||
|
|
||
| - name: Wait for Responses API proxy | ||
|
|
||
Large diffs are not rendered by default.
Oops, something went wrong.
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mention api-version query parameter?