Skip to content

Missing images/edits Endpoints in _deployments_endpoints #2336

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
1 task done
sandeeprawat opened this issue Apr 30, 2025 · 2 comments
Open
1 task done

Missing images/edits Endpoints in _deployments_endpoints #2336

sandeeprawat opened this issue Apr 30, 2025 · 2 comments

Comments

@sandeeprawat
Copy link

sandeeprawat commented Apr 30, 2025

Confirm this is a feature request for the Python library and not the underlying OpenAI API.

  • This is a feature request for the Python library

Describe the feature or improvement you're requesting

Description
The _deployments_endpoints set defined in src/openai/lib/azure.py is missing the images/edit endpoints. This may cause issues when working with Azure deployments for editing images.

https://github.com/openai/openai-python/blob/main/src/openai/lib/azure.py#19-19

Relevant Code

_deployments_endpoints = set(
    [
        "/completions",
        "/chat/completions",
        "/embeddings",
        "/audio/transcriptions",
        "/audio/translations",
        "/audio/speech",
        "/images/generations",
    ]
)

Suggested Fix
Include the missing endpoint "/images/edit" in the _deployments_endpoints set.

_deployments_endpoints = set(
    [
        "/completions",
        "/chat/completions",
        "/embeddings",
        "/audio/transcriptions",
        "/audio/translations",
        "/audio/speech",
        "/images/generations",
        "/images/edits",  # Add this line
    ]
)

Steps to Reproduce
Use an Azure deployment for the images/edit endpoint.
Observe that the endpoint is not handled correctly due to its absence in _deployments_endpoints.

Environment
Repository: openai/openai-python
File: src/openai/lib/azure.py
Commit: fad098f

Additional context

No response

@sandeeprawat sandeeprawat changed the title Missing images/edit Endpoints in _deployments_endpoints Missing images/edits Endpoints in _deployments_endpoints Apr 30, 2025
@auggie246
Copy link

PR #2332 pending but because this repo is auto generated, there's not much human reviewer looking at it. Might take some time before it gets accepted

@sandeeprawat
Copy link
Author

PR #2332 pending but because this repo is auto generated, there's not much human reviewer looking at it. Might take some time before it gets accepted

We can use below code to hack it for the time being

import openai as ai

print("fixing the library with edit functionality")
ai._azure._deployments_endpoints.add("/images/edits")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants