Skip to content

Missing images/edits Endpoints in _deployments_endpoints #2336

Open
@sandeeprawat

Description

@sandeeprawat

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions