Skip to content

Commit 95d1898

Browse files
author
github-actions[bot]
committed
feat: Updated OpenAPI spec
1 parent def3196 commit 95d1898

10 files changed

+283
-70
lines changed

src/libs/Ideogram/Generated/Ideogram.IVisionClient.PostDescribe.g.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ public partial interface IVisionClient
2727
/// <param name="imageFilename">
2828
/// An image binary (max size 10MB); only JPEG, WebP and PNG formats are supported at this time.
2929
/// </param>
30+
/// <param name="describeModelVersion">
31+
/// The model version to use for describing images. V_2 uses the current describe model, V_3 uses the new captioner model.
32+
/// </param>
3033
/// <param name="cancellationToken">The token to cancel the operation with</param>
3134
/// <exception cref="global::System.InvalidOperationException"></exception>
3235
global::System.Threading.Tasks.Task<global::Ideogram.DescribeResponse> PostDescribeAsync(
3336
byte[] imageFile,
3437
string imageFilename,
38+
global::Ideogram.DescribeModelVersion? describeModelVersion = default,
3539
global::System.Threading.CancellationToken cancellationToken = default);
3640
}
3741
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
#nullable enable
3+
4+
namespace Ideogram
5+
{
6+
/// <summary>
7+
/// The model version to use for describing images. V_2 uses the current describe model, V_3 uses the new captioner model.
8+
/// </summary>
9+
public enum DescribeModelVersion
10+
{
11+
/// <summary>
12+
///
13+
/// </summary>
14+
V2,
15+
/// <summary>
16+
///
17+
/// </summary>
18+
V3,
19+
}
20+
21+
/// <summary>
22+
/// Enum extensions to do fast conversions without the reflection.
23+
/// </summary>
24+
public static class DescribeModelVersionExtensions
25+
{
26+
/// <summary>
27+
/// Converts an enum to a string.
28+
/// </summary>
29+
public static string ToValueString(this DescribeModelVersion value)
30+
{
31+
return value switch
32+
{
33+
DescribeModelVersion.V2 => "V_2",
34+
DescribeModelVersion.V3 => "V_3",
35+
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
36+
};
37+
}
38+
/// <summary>
39+
/// Converts an string to a enum.
40+
/// </summary>
41+
public static DescribeModelVersion? ToEnum(string value)
42+
{
43+
return value switch
44+
{
45+
"V_2" => DescribeModelVersion.V2,
46+
"V_3" => DescribeModelVersion.V3,
47+
_ => null,
48+
};
49+
}
50+
}
51+
}

src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequest.g.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ public sealed partial class DescribeRequest
2222
[global::System.Text.Json.Serialization.JsonRequired]
2323
public required string ImageFilename { get; set; }
2424

25+
/// <summary>
26+
/// The model version to use for describing images. V_2 uses the current describe model, V_3 uses the new captioner model.
27+
/// </summary>
28+
[global::System.Text.Json.Serialization.JsonPropertyName("describe_model_version")]
29+
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.DescribeModelVersionJsonConverter))]
30+
public global::Ideogram.DescribeModelVersion? DescribeModelVersion { get; set; }
31+
2532
/// <summary>
2633
/// Additional properties that are not explicitly defined in the schema
2734
/// </summary>
@@ -37,15 +44,20 @@ public sealed partial class DescribeRequest
3744
/// <param name="imageFilename">
3845
/// An image binary (max size 10MB); only JPEG, WebP and PNG formats are supported at this time.
3946
/// </param>
47+
/// <param name="describeModelVersion">
48+
/// The model version to use for describing images. V_2 uses the current describe model, V_3 uses the new captioner model.
49+
/// </param>
4050
#if NET7_0_OR_GREATER
4151
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
4252
#endif
4353
public DescribeRequest(
4454
byte[] imageFile,
45-
string imageFilename)
55+
string imageFilename,
56+
global::Ideogram.DescribeModelVersion? describeModelVersion)
4657
{
4758
this.ImageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile));
4859
this.ImageFilename = imageFilename ?? throw new global::System.ArgumentNullException(nameof(imageFilename));
60+
this.DescribeModelVersion = describeModelVersion;
4961
}
5062

5163
/// <summary>

src/libs/Ideogram/Generated/Ideogram.Models.RenderingSpeed.g.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ namespace Ideogram
99
/// </summary>
1010
public enum RenderingSpeed
1111
{
12+
/// <summary>
13+
///
14+
/// </summary>
15+
FLASH,
1216
/// <summary>
1317
///
1418
/// </summary>
@@ -39,6 +43,7 @@ public static string ToValueString(this RenderingSpeed value)
3943
{
4044
return value switch
4145
{
46+
RenderingSpeed.FLASH => "FLASH",
4247
RenderingSpeed.TURBO => "TURBO",
4348
RenderingSpeed.BALANCED => "BALANCED",
4449
RenderingSpeed.DEFAULT => "DEFAULT",
@@ -53,6 +58,7 @@ public static string ToValueString(this RenderingSpeed value)
5358
{
5459
return value switch
5560
{
61+
"FLASH" => RenderingSpeed.FLASH,
5662
"TURBO" => RenderingSpeed.TURBO,
5763
"BALANCED" => RenderingSpeed.BALANCED,
5864
"DEFAULT" => RenderingSpeed.DEFAULT,

src/libs/Ideogram/Generated/Ideogram.VisionClient.PostDescribe.g.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ partial void ProcessPostDescribeResponseContent(
7373
content: new global::System.Net.Http.ByteArrayContent(request.ImageFile ?? global::System.Array.Empty<byte>()),
7474
name: "image_file",
7575
fileName: request.ImageFilename ?? string.Empty);
76+
if (request.DescribeModelVersion != default)
77+
{
78+
__httpRequestContent.Add(
79+
content: new global::System.Net.Http.StringContent($"{request.DescribeModelVersion?.ToValueString()}"),
80+
name: "describe_model_version");
81+
}
7682
__httpRequest.Content = __httpRequestContent;
7783

7884
PrepareRequest(
@@ -254,17 +260,22 @@ partial void ProcessPostDescribeResponseContent(
254260
/// <param name="imageFilename">
255261
/// An image binary (max size 10MB); only JPEG, WebP and PNG formats are supported at this time.
256262
/// </param>
263+
/// <param name="describeModelVersion">
264+
/// The model version to use for describing images. V_2 uses the current describe model, V_3 uses the new captioner model.
265+
/// </param>
257266
/// <param name="cancellationToken">The token to cancel the operation with</param>
258267
/// <exception cref="global::System.InvalidOperationException"></exception>
259268
public async global::System.Threading.Tasks.Task<global::Ideogram.DescribeResponse> PostDescribeAsync(
260269
byte[] imageFile,
261270
string imageFilename,
271+
global::Ideogram.DescribeModelVersion? describeModelVersion = default,
262272
global::System.Threading.CancellationToken cancellationToken = default)
263273
{
264274
var __request = new global::Ideogram.DescribeRequest
265275
{
266276
ImageFile = imageFile,
267277
ImageFilename = imageFilename,
278+
DescribeModelVersion = describeModelVersion,
268279
};
269280

270281
return await PostDescribeAsync(
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#nullable enable
2+
3+
namespace Ideogram.JsonConverters
4+
{
5+
/// <inheritdoc />
6+
public sealed class DescribeModelVersionJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Ideogram.DescribeModelVersion>
7+
{
8+
/// <inheritdoc />
9+
public override global::Ideogram.DescribeModelVersion Read(
10+
ref global::System.Text.Json.Utf8JsonReader reader,
11+
global::System.Type typeToConvert,
12+
global::System.Text.Json.JsonSerializerOptions options)
13+
{
14+
switch (reader.TokenType)
15+
{
16+
case global::System.Text.Json.JsonTokenType.String:
17+
{
18+
var stringValue = reader.GetString();
19+
if (stringValue != null)
20+
{
21+
return global::Ideogram.DescribeModelVersionExtensions.ToEnum(stringValue) ?? default;
22+
}
23+
24+
break;
25+
}
26+
case global::System.Text.Json.JsonTokenType.Number:
27+
{
28+
var numValue = reader.GetInt32();
29+
return (global::Ideogram.DescribeModelVersion)numValue;
30+
}
31+
case global::System.Text.Json.JsonTokenType.Null:
32+
{
33+
return default(global::Ideogram.DescribeModelVersion);
34+
}
35+
default:
36+
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
37+
}
38+
39+
return default;
40+
}
41+
42+
/// <inheritdoc />
43+
public override void Write(
44+
global::System.Text.Json.Utf8JsonWriter writer,
45+
global::Ideogram.DescribeModelVersion value,
46+
global::System.Text.Json.JsonSerializerOptions options)
47+
{
48+
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
49+
50+
writer.WriteStringValue(global::Ideogram.DescribeModelVersionExtensions.ToValueString(value));
51+
}
52+
}
53+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#nullable enable
2+
3+
namespace Ideogram.JsonConverters
4+
{
5+
/// <inheritdoc />
6+
public sealed class DescribeModelVersionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Ideogram.DescribeModelVersion?>
7+
{
8+
/// <inheritdoc />
9+
public override global::Ideogram.DescribeModelVersion? Read(
10+
ref global::System.Text.Json.Utf8JsonReader reader,
11+
global::System.Type typeToConvert,
12+
global::System.Text.Json.JsonSerializerOptions options)
13+
{
14+
switch (reader.TokenType)
15+
{
16+
case global::System.Text.Json.JsonTokenType.String:
17+
{
18+
var stringValue = reader.GetString();
19+
if (stringValue != null)
20+
{
21+
return global::Ideogram.DescribeModelVersionExtensions.ToEnum(stringValue);
22+
}
23+
24+
break;
25+
}
26+
case global::System.Text.Json.JsonTokenType.Number:
27+
{
28+
var numValue = reader.GetInt32();
29+
return (global::Ideogram.DescribeModelVersion)numValue;
30+
}
31+
case global::System.Text.Json.JsonTokenType.Null:
32+
{
33+
return default(global::Ideogram.DescribeModelVersion?);
34+
}
35+
default:
36+
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
37+
}
38+
39+
return default;
40+
}
41+
42+
/// <inheritdoc />
43+
public override void Write(
44+
global::System.Text.Json.Utf8JsonWriter writer,
45+
global::Ideogram.DescribeModelVersion? value,
46+
global::System.Text.Json.JsonSerializerOptions options)
47+
{
48+
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
49+
50+
if (value == null)
51+
{
52+
writer.WriteNullValue();
53+
}
54+
else
55+
{
56+
writer.WriteStringValue(global::Ideogram.DescribeModelVersionExtensions.ToValueString(value.Value));
57+
}
58+
}
59+
}
60+
}

src/libs/Ideogram/Generated/JsonSerializerContext.g.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ namespace Ideogram
1313
DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull,
1414
Converters = new global::System.Type[]
1515
{
16+
typeof(global::Ideogram.JsonConverters.DescribeModelVersionJsonConverter),
17+
typeof(global::Ideogram.JsonConverters.DescribeModelVersionNullableJsonConverter),
1618
typeof(global::Ideogram.JsonConverters.ModelEnumJsonConverter),
1719
typeof(global::Ideogram.JsonConverters.ModelEnumNullableJsonConverter),
1820
typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter),

0 commit comments

Comments
 (0)