How to use DALLE using Azure Open AI? #28707
Replies: 2 comments
-
To use DALL-E with Azure OpenAI in LangChain, you can follow these steps:
These steps will help you configure and use DALL-E with Azure OpenAI in LangChain. If you need more detailed guidance, you might want to check the LangChain documentation or the specific module for DALL-E integration [1][2]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
-
Here's what worked for me (non-langchain solution) from openai import AzureOpenAI
import json
client = AzureOpenAI(
api_version = OPENAI_API_VERSION,
api_key = AZURE_OPENAI_API_KEY,
azure_endpoint = AZURE_OPENAI_ENDPOINT,
)
response = client.images.generate(
model = "dall-e-3",
prompt = prompt,
)
json_response = json.loads(response.model_dump_json())
image_url = json_response["data"][0]["url"] |
Beta Was this translation helpful? Give feedback.
-
I found the docs for dalle_image_generator but could not find anything for Azure OpenAI
Beta Was this translation helpful? Give feedback.
All reactions