-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add Azure Dall-E #1209
Add Azure Dall-E #1209
Conversation
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.
Tested locally. Batch of formatting comments.
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureImageGenerationRequest.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureImageGenerationResponse.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureImageGenerationResponse.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureImageGenerationResponse.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureImageGenerationResponse.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Outdated
Show resolved
Hide resolved
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.
Tested locally. Batch of formatting comments.
Add some newlines to follow formatting guidelines.
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.
LGTM! Thanks for the PR.
Co-authored-by: Lee Miller <lemiller@microsoft.com>
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Outdated
Show resolved
Hide resolved
fix: add maximum retry limit to prevent infinite looping.
I tried to add some limitations on the maximum number of retries to avoid falling into an infinite loop. While making improvements, I noticed that there have been some updates to the Azure Dall-E API version, so I also took the opportunity to update it. Please review again. @dmytrostruk |
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/CustomClient/OpenAIClientBase.cs
Outdated
Show resolved
Hide resolved
@SergeyMenshykh Thanks for your suggestion. I have updated the implementation method according to the document, and it now appears much clearer. If there is anything that needs to be adjusted, please let me know. |
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.AI.OpenAI/ImageGeneration/AzureOpenAIImageGeneration.cs
Show resolved
Hide resolved
### Motivation and Context Implement Azure OpenAI Dall E ### Description Implement Azure OpenAI Image Generation according to the official [documentation](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#image-generation) and the examples provided by Azure OpenAI Studio, so that it can be used in SK. Due to the differences between the API of Azure OpenAI Dall-E and OpenAI Dall-E, some modifications have been made to OpenAIClientBase under CustomClient to ensure compatibility. Co-authored-by: Lee Miller <lemiller@microsoft.com> Co-authored-by: Shawn Callegari <36091529+shawncal@users.noreply.github.com> Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
Motivation and Context
Implement Azure OpenAI Dall E
Description
Implement Azure OpenAI Image Generation according to the official documentation and the examples provided by Azure OpenAI Studio, so that it can be used in SK.
Due to the differences between the API of Azure OpenAI Dall-E and OpenAI Dall-E, some modifications have been made to OpenAIClientBase under CustomClient to ensure compatibility.
Contribution Checklist
dotnet format