Skip to content

Commit

Permalink
OpenAI-DotNet 6.4.1 (RageAgainstThePixel#66)
Browse files Browse the repository at this point in the history
- Fixes RageAgainstThePixel#64
- Added `ImageEditRequest` overloads for optional mask parameter
  • Loading branch information
StephenHodgson committed Mar 24, 2023
1 parent 0a9dbc0 commit c4577f5
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<OpenAIDotNetVersion>6.4.0</OpenAIDotNetVersion>
<OpenAIDotNetVersion>6.4.1</OpenAIDotNetVersion>
</PropertyGroup>
</Project>
49 changes: 49 additions & 0 deletions OpenAI-DotNet/Images/ImageEditRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@ namespace OpenAI.Images
{
public sealed class ImageEditRequest : IDisposable
{
/// <summary>
/// Constructor.
/// </summary>
/// <param name="imagePath">
/// The image to edit. Must be a valid PNG file, less than 4MB, and square.
/// If mask is not provided, image must have transparency, which will be used as the mask.
/// </param>
/// <param name="prompt">
/// A text description of the desired image(s). The maximum length is 1000 characters.
/// </param>
/// <param name="numberOfResults">
/// The number of images to generate. Must be between 1 and 10.
/// </param>
/// <param name="size">
/// The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.
/// </param>
/// <param name="user">
/// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
/// </param>
public ImageEditRequest(string imagePath, string prompt, int numberOfResults = 1, ImageSize size = ImageSize.Large, string user = null)
: this(imagePath, null, prompt, numberOfResults, size, user)
{
}

/// <summary>
/// Constructor.
/// </summary>
Expand Down Expand Up @@ -41,6 +65,31 @@ public ImageEditRequest(string imagePath, string maskPath, string prompt, int nu
{
}

/// <summary>
/// Constructor.
/// </summary>
/// <param name="image">
/// The image to edit. Must be a valid PNG file, less than 4MB, and square.
/// If mask is not provided, image must have transparency, which will be used as the mask.
/// </param>
/// <param name="imageName">Name of the image file.</param>
/// <param name="prompt">
/// A text description of the desired image(s). The maximum length is 1000 characters.
/// </param>
/// <param name="numberOfResults">
/// The number of images to generate. Must be between 1 and 10.
/// </param>
/// <param name="size">
/// The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.
/// </param>
/// <param name="user">
/// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
/// </param>
public ImageEditRequest(Stream image, string imageName, string prompt, int numberOfResults = 1, ImageSize size = ImageSize.Large, string user = null)
: this(image, imageName, null, null, prompt, numberOfResults, size, user)
{
}

/// <summary>
/// Constructor.
/// </summary>
Expand Down
4 changes: 3 additions & 1 deletion OpenAI-DotNet/OpenAI-DotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ More context [on Roger Pincombe's blog](https://rogerpincombe.com/openai-dotnet-
<RepositoryUrl>https://github.com/RageAgainstThePixel/OpenAI-DotNet</RepositoryUrl>
<PackageTags>OpenAI, AI, ML, API, gpt-4, gpt-3.5-tubo, gpt-3, chatGPT, chat-gpt, gpt-2, gpt</PackageTags>
<Title>OpenAI API</Title>
<PackageReleaseNotes>Bump version to 6.4.0
<PackageReleaseNotes>Bump version to 6.4.1
- Added ImageEditRequest overloads for optional mask parameter
Bump version to 6.4.0
- Moved OpenAI-DotNet-Proxy back into its own project and package
- Make a few classes sealed that are not meant to be extended
Bump version to 6.3.2
Expand Down

0 comments on commit c4577f5

Please sign in to comment.