promptflow icon indicating copy to clipboard operation
promptflow copied to clipboard

Adding Support for Image Generation with AzureOpenAI

Open marlenezw opened this issue 1 year ago • 0 comments

This PR adds support for image generation with the AzureOpenAI API and Dalle. This capability was added to AzureOpenai in a recent release and more information can be found here.

The API should use the following structure that will work with Prompty and Promptflow

client = AzureOpenAI(
    api_version="2024-02-01",  
    api_key=os.environ["AZURE_OPENAI_API_KEY"],  
    azure_endpoint=os.environ['AZURE_OPENAI_ENDPOINT']
)

result = client.images.generate(
    model="dalle3", # the name of your DALL-E 3 deployment
    prompt="a close-up of a bear walking throughthe forest",
    n=1
)

marlenezw avatar May 13 '24 14:05 marlenezw