gpt-image-1
This commit is contained in:
parent
c8e61302bd
commit
77ac9d22cf
|
|
@ -213,7 +213,7 @@ public class CompletionProvider
|
|||
model = agentConfig?.Model ?? agentSetting.LlmConfig?.Model;
|
||||
if (state.ContainsState("model"))
|
||||
{
|
||||
model = state.GetState("model", model ?? "dall-e-3");
|
||||
model = state.GetState("model", model ?? "gpt-image-1");
|
||||
}
|
||||
else if (state.ContainsState("model_id") || !string.IsNullOrEmpty(modelId))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -38,10 +38,8 @@ public partial class ImageCompletionProvider
|
|||
|
||||
var options = new ImageGenerationOptions
|
||||
{
|
||||
Size = size,
|
||||
Quality = quality,
|
||||
Style = style,
|
||||
ResponseFormat = format
|
||||
Quality = new GeneratedImageQuality("medium"),
|
||||
Size = GeneratedImageSize.W1024xH1024
|
||||
};
|
||||
return (prompt, count, options);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public partial class ImageCompletionProvider : IImageCompletion
|
|||
{
|
||||
generatedImage.ImageUrl = image?.ImageUri?.AbsoluteUri ?? string.Empty;
|
||||
}
|
||||
else if (format == GeneratedImageFormat.Bytes)
|
||||
else
|
||||
{
|
||||
var base64Str = string.Empty;
|
||||
var bytes = image?.ImageBytes?.ToArray();
|
||||
|
|
@ -125,16 +125,16 @@ public partial class ImageCompletionProvider : IImageCompletion
|
|||
|
||||
private GeneratedImageFormat GetImageFormat(string format)
|
||||
{
|
||||
var value = !string.IsNullOrEmpty(format) ? format : "uri";
|
||||
var value = !string.IsNullOrEmpty(format) ? format : "bytes";
|
||||
|
||||
GeneratedImageFormat retFormat;
|
||||
switch (value)
|
||||
{
|
||||
case "bytes":
|
||||
retFormat = GeneratedImageFormat.Bytes;
|
||||
case "url":
|
||||
retFormat = GeneratedImageFormat.Uri;
|
||||
break;
|
||||
default:
|
||||
retFormat = GeneratedImageFormat.Uri;
|
||||
retFormat = GeneratedImageFormat.Bytes;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue