-
-
Notifications
You must be signed in to change notification settings - Fork 528
Dall E
Tolga Kayhan edited this page Jan 26, 2023
·
1 revision
var imageResult = await sdk.Image.CreateImage(new ImageCreateRequest
{
Prompt = "Laser cat eyes",
N = 2,
Size = StaticValues.ImageStatics.Size.Size256,
ResponseFormat = StaticValues.ImageStatics.ResponseFormat.Url,
User = "TestUser"
});
var imageResult = await sdk.Image.CreateImage(new ImageCreateRequest
{
Prompt = "Laser cat eyes",
N = 2,
Size = "256x256",
ResponseFormat = "url",
User = "TestUser"
});
if (imageResult.Successful)
{
Console.WriteLine(string.Join("\n", imageResult.Results.Select(r => r.Url)));
}
else //handle errors
{
if (imageResult.Error == null)
{
throw new Exception("Unknown Error");
}
Console.WriteLine($"{imageResult.Error.Code}: {completionResult.Error.Message}");
}