Skip to content

Commit cd34dcf

Browse files
HavenDVgithub-actions[bot]
andauthored
feat: Updated OpenAPI spec (#310)
Co-authored-by: github-actions[bot] <dependabot@bot.com>
1 parent 9cf4d8e commit cd34dcf

12 files changed

Lines changed: 510 additions & 203 deletions

src/libs/tryAGI.OpenAI/Generated/autosdk.generated-examples.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"Slug": "compactconversation",
1818
"Description": "Generated from OpenAPI examples.",
1919
"Language": "http",
20-
"Code": "### Compact a conversation. Returns a compacted response object.\n\nLearn when and how to compact long-running conversations in the [conversation state guide](/docs/guides/conversation-state#managing-the-context-window). For ZDR-compatible compaction details, see [Compaction (advanced)](/docs/guides/conversation-state#compaction-advanced).\n# @name Compactconversation\nPOST {{host}}/responses/compact\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022model\u0022: \u0022gpt-5.1\u0022,\n \u0022input\u0022: \u0022string\u0022,\n \u0022previous_response_id\u0022: \u0022resp_123\u0022,\n \u0022instructions\u0022: \u0022string\u0022,\n \u0022prompt_cache_key\u0022: \u0022string\u0022\n}\n\n## Responses\n# 200\n# Description: Success\n# Content-Type: application/json",
20+
"Code": "### Compact a conversation. Returns a compacted response object.\n\nLearn when and how to compact long-running conversations in the [conversation state guide](/docs/guides/conversation-state#managing-the-context-window). For ZDR-compatible compaction details, see [Compaction (advanced)](/docs/guides/conversation-state#compaction-advanced).\n# @name Compactconversation\nPOST {{host}}/responses/compact\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022model\u0022: \u0022gpt-5.1\u0022,\n \u0022input\u0022: \u0022string\u0022,\n \u0022previous_response_id\u0022: \u0022resp_123\u0022,\n \u0022instructions\u0022: \u0022string\u0022,\n \u0022prompt_cache_key\u0022: \u0022string\u0022,\n \u0022prompt_cache_retention\u0022: \u0022in_memory\u0022\n}\n\n## Responses\n# 200\n# Description: Success\n# Content-Type: application/json",
2121
"Format": "http",
2222
"OperationId": "Compactconversation",
2323
"Setup": null

src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IOpenAiClient.CompactAResponse.g.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public partial interface IOpenAiClient
2828
/// <param name="previousResponseId"></param>
2929
/// <param name="instructions"></param>
3030
/// <param name="promptCacheKey"></param>
31+
/// <param name="promptCacheRetention"></param>
3132
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
3233
/// <param name="cancellationToken">The token to cancel the operation with</param>
3334
/// <exception cref="global::System.InvalidOperationException"></exception>
@@ -37,6 +38,7 @@ public partial interface IOpenAiClient
3738
string? previousResponseId = default,
3839
string? instructions = default,
3940
string? promptCacheKey = default,
41+
global::tryAGI.OpenAI.PromptCacheRetentionEnum? promptCacheRetention = default,
4042
global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default,
4143
global::System.Threading.CancellationToken cancellationToken = default);
4244
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#nullable enable
2+
3+
namespace tryAGI.OpenAI.JsonConverters
4+
{
5+
/// <inheritdoc />
6+
public sealed class PromptCacheRetentionEnumJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.PromptCacheRetentionEnum>
7+
{
8+
/// <inheritdoc />
9+
public override global::tryAGI.OpenAI.PromptCacheRetentionEnum 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::tryAGI.OpenAI.PromptCacheRetentionEnumExtensions.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::tryAGI.OpenAI.PromptCacheRetentionEnum)numValue;
30+
}
31+
case global::System.Text.Json.JsonTokenType.Null:
32+
{
33+
return default(global::tryAGI.OpenAI.PromptCacheRetentionEnum);
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::tryAGI.OpenAI.PromptCacheRetentionEnum value,
46+
global::System.Text.Json.JsonSerializerOptions options)
47+
{
48+
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
49+
50+
writer.WriteStringValue(global::tryAGI.OpenAI.PromptCacheRetentionEnumExtensions.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 tryAGI.OpenAI.JsonConverters
4+
{
5+
/// <inheritdoc />
6+
public sealed class PromptCacheRetentionEnumNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.PromptCacheRetentionEnum?>
7+
{
8+
/// <inheritdoc />
9+
public override global::tryAGI.OpenAI.PromptCacheRetentionEnum? 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::tryAGI.OpenAI.PromptCacheRetentionEnumExtensions.ToEnum(stringValue);
22+
}
23+
24+
break;
25+
}
26+
case global::System.Text.Json.JsonTokenType.Number:
27+
{
28+
var numValue = reader.GetInt32();
29+
return (global::tryAGI.OpenAI.PromptCacheRetentionEnum)numValue;
30+
}
31+
case global::System.Text.Json.JsonTokenType.Null:
32+
{
33+
return default(global::tryAGI.OpenAI.PromptCacheRetentionEnum?);
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::tryAGI.OpenAI.PromptCacheRetentionEnum? 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::tryAGI.OpenAI.PromptCacheRetentionEnumExtensions.ToValueString(value.Value));
57+
}
58+
}
59+
}
60+
}

src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonSerializerContext.g.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3781,6 +3781,10 @@ namespace tryAGI.OpenAI
37813781

37823782
typeof(global::tryAGI.OpenAI.JsonConverters.TokenCountsResourceObjectNullableJsonConverter),
37833783

3784+
typeof(global::tryAGI.OpenAI.JsonConverters.PromptCacheRetentionEnumJsonConverter),
3785+
3786+
typeof(global::tryAGI.OpenAI.JsonConverters.PromptCacheRetentionEnumNullableJsonConverter),
3787+
37843788
typeof(global::tryAGI.OpenAI.JsonConverters.CompactResourceObjectJsonConverter),
37853789

37863790
typeof(global::tryAGI.OpenAI.JsonConverters.CompactResourceObjectNullableJsonConverter),
@@ -7246,6 +7250,7 @@ namespace tryAGI.OpenAI
72467250
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.TokenCountsBody))]
72477251
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.TokenCountsResource))]
72487252
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.TokenCountsResourceObject), TypeInfoPropertyName = "TokenCountsResourceObject2")]
7253+
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.PromptCacheRetentionEnum), TypeInfoPropertyName = "PromptCacheRetentionEnum2")]
72497254
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.CompactResponseMethodPublicBody))]
72507255
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.ItemField), TypeInfoPropertyName = "ItemField2")]
72517256
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.OpenAI.ItemFieldDiscriminator))]

0 commit comments

Comments
 (0)