Skip to content

Commit dd008b0

Browse files
committed
Merge branch 'main' of https://github.com/tryAGI/OpenAI
2 parents fcb0a48 + a650b77 commit dd008b0

156 files changed

Lines changed: 14402 additions & 3565 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"Slug": "getinputtokencounts",
4040
"Description": "Generated from OpenAPI examples.",
4141
"Language": "http",
42-
"Code": "### Returns input token counts of the request.\n\nReturns an object with \u0060object\u0060 set to \u0060response.input_tokens\u0060 and an \u0060input_tokens\u0060 count.\n# @name Getinputtokencounts\nPOST {{host}}/responses/input_tokens\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022model\u0022: \u0022string\u0022,\n \u0022input\u0022: \u0022string\u0022,\n \u0022previous_response_id\u0022: \u0022resp_123\u0022,\n \u0022tools\u0022: [\n {\n \u0022type\u0022: \u0022function\u0022,\n \u0022name\u0022: \u0022string\u0022,\n \u0022description\u0022: \u0022string\u0022,\n \u0022parameters\u0022: {},\n \u0022strict\u0022: true,\n \u0022defer_loading\u0022: true\n }\n ],\n \u0022text\u0022: {\n \u0022format\u0022: {\n \u0022type\u0022: \u0022text\u0022\n },\n \u0022verbosity\u0022: \u0022medium\u0022\n },\n \u0022reasoning\u0022: {\n \u0022effort\u0022: \u0022medium\u0022,\n \u0022summary\u0022: \u0022auto\u0022,\n \u0022generate_summary\u0022: \u0022auto\u0022\n },\n \u0022truncation\u0022: \u0022auto\u0022,\n \u0022instructions\u0022: \u0022string\u0022,\n \u0022conversation\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n \u0022tool_choice\u0022: \u0022none\u0022,\n \u0022parallel_tool_calls\u0022: true\n}\n\n## Responses\n# 200\n# Description: Success\n# Content-Type: application/json",
42+
"Code": "### Returns input token counts of the request.\n\nReturns an object with \u0060object\u0060 set to \u0060response.input_tokens\u0060 and an \u0060input_tokens\u0060 count.\n# @name Getinputtokencounts\nPOST {{host}}/responses/input_tokens\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022model\u0022: \u0022string\u0022,\n \u0022input\u0022: \u0022string\u0022,\n \u0022previous_response_id\u0022: \u0022resp_123\u0022,\n \u0022tools\u0022: [\n {\n \u0022type\u0022: \u0022function\u0022,\n \u0022name\u0022: \u0022string\u0022,\n \u0022description\u0022: \u0022string\u0022,\n \u0022parameters\u0022: {},\n \u0022strict\u0022: true,\n \u0022defer_loading\u0022: true\n }\n ],\n \u0022text\u0022: {\n \u0022format\u0022: {\n \u0022type\u0022: \u0022text\u0022\n },\n \u0022verbosity\u0022: \u0022medium\u0022\n },\n \u0022reasoning\u0022: {\n \u0022effort\u0022: \u0022medium\u0022,\n \u0022summary\u0022: \u0022auto\u0022,\n \u0022generate_summary\u0022: \u0022auto\u0022\n },\n \u0022truncation\u0022: \u0022auto\u0022,\n \u0022instructions\u0022: \u0022string\u0022,\n \u0022personality\u0022: \u0022string\u0022,\n \u0022conversation\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n \u0022tool_choice\u0022: \u0022none\u0022,\n \u0022parallel_tool_calls\u0022: true\n}\n\n## Responses\n# 200\n# Description: Success\n# Content-Type: application/json",
4343
"Format": "http",
4444
"OperationId": "Getinputtokencounts",
4545
"Setup": null
@@ -83,7 +83,7 @@
8383
"Slug": "createresponse",
8484
"Description": "Generated from OpenAPI examples.",
8585
"Language": "http",
86-
"Code": "### Creates a model response. Provide [text](/docs/guides/text) or\n[image](/docs/guides/images) inputs to generate [text](/docs/guides/text)\nor [JSON](/docs/guides/structured-outputs) outputs. Have the model call\nyour own [custom code](/docs/guides/function-calling) or use built-in\n[tools](/docs/guides/tools) like [web search](/docs/guides/tools-web-search)\nor [file search](/docs/guides/tools-file-search) to use your own data\nas input for the model\u0027s response.\n\n# @name createResponse\nPOST {{host}}/responses\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json, text/event-stream\n\n{\n \u0022previous_response_id\u0022: \u0022string\u0022,\n \u0022model\u0022: \u0022gpt-5.1\u0022,\n \u0022reasoning\u0022: {\n \u0022effort\u0022: \u0022medium\u0022,\n \u0022summary\u0022: \u0022auto\u0022,\n \u0022generate_summary\u0022: \u0022auto\u0022\n },\n \u0022background\u0022: false,\n \u0022max_tool_calls\u0022: 0,\n \u0022text\u0022: {\n \u0022format\u0022: {\n \u0022type\u0022: \u0022text\u0022\n },\n \u0022verbosity\u0022: \u0022medium\u0022\n },\n \u0022tools\u0022: [\n {\n \u0022type\u0022: \u0022function\u0022,\n \u0022name\u0022: \u0022string\u0022,\n \u0022description\u0022: \u0022string\u0022,\n \u0022parameters\u0022: {},\n \u0022strict\u0022: true,\n \u0022defer_loading\u0022: true\n }\n ],\n \u0022tool_choice\u0022: \u0022none\u0022,\n \u0022prompt\u0022: {\n \u0022id\u0022: \u0022string\u0022,\n \u0022version\u0022: \u0022string\u0022,\n \u0022variables\u0022: {}\n },\n \u0022truncation\u0022: \u0022disabled\u0022,\n \u0022input\u0022: \u0022string\u0022,\n \u0022include\u0022: [\n \u0022file_search_call.results\u0022\n ],\n \u0022parallel_tool_calls\u0022: true,\n \u0022store\u0022: true,\n \u0022instructions\u0022: \u0022string\u0022,\n \u0022stream\u0022: false,\n \u0022stream_options\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n \u0022conversation\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n \u0022context_management\u0022: [\n {\n \u0022type\u0022: \u0022string\u0022,\n \u0022compact_threshold\u0022: 0\n }\n ],\n \u0022max_output_tokens\u0022: 0\n}\n\n## Responses\n# 200\n# Description: OK\n# Content-Type: application/json, text/event-stream",
86+
"Code": "### Creates a model response. Provide [text](/docs/guides/text) or\n[image](/docs/guides/images) inputs to generate [text](/docs/guides/text)\nor [JSON](/docs/guides/structured-outputs) outputs. Have the model call\nyour own [custom code](/docs/guides/function-calling) or use built-in\n[tools](/docs/guides/tools) like [web search](/docs/guides/tools-web-search)\nor [file search](/docs/guides/tools-file-search) to use your own data\nas input for the model\u0027s response.\n\n# @name createResponse\nPOST {{host}}/responses\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json, text/event-stream\n\n{\n \u0022previous_response_id\u0022: \u0022string\u0022,\n \u0022model\u0022: \u0022gpt-5.1\u0022,\n \u0022reasoning\u0022: {\n \u0022effort\u0022: \u0022medium\u0022,\n \u0022summary\u0022: \u0022auto\u0022,\n \u0022generate_summary\u0022: \u0022auto\u0022\n },\n \u0022background\u0022: false,\n \u0022max_tool_calls\u0022: 0,\n \u0022text\u0022: {\n \u0022format\u0022: {\n \u0022type\u0022: \u0022text\u0022\n },\n \u0022verbosity\u0022: \u0022medium\u0022\n },\n \u0022tools\u0022: [\n {\n \u0022type\u0022: \u0022function\u0022,\n \u0022name\u0022: \u0022string\u0022,\n \u0022description\u0022: \u0022string\u0022,\n \u0022parameters\u0022: {},\n \u0022strict\u0022: true,\n \u0022defer_loading\u0022: true\n }\n ],\n \u0022tool_choice\u0022: \u0022none\u0022,\n \u0022prompt\u0022: {\n \u0022id\u0022: \u0022string\u0022,\n \u0022version\u0022: \u0022string\u0022,\n \u0022variables\u0022: {}\n },\n \u0022truncation\u0022: \u0022disabled\u0022,\n \u0022input\u0022: \u0022string\u0022,\n \u0022include\u0022: [\n \u0022file_search_call.results\u0022\n ],\n \u0022parallel_tool_calls\u0022: true,\n \u0022store\u0022: true,\n \u0022instructions\u0022: \u0022string\u0022,\n \u0022moderation\u0022: {\n \u0022model\u0022: \u0022string\u0022\n },\n \u0022stream\u0022: false,\n \u0022stream_options\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n \u0022conversation\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n \u0022context_management\u0022: [\n {\n \u0022type\u0022: \u0022string\u0022,\n \u0022compact_threshold\u0022: 0\n }\n ],\n \u0022max_output_tokens\u0022: 0\n}\n\n## Responses\n# 200\n# Description: OK\n# Content-Type: application/json, text/event-stream",
8787
"Format": "http",
8888
"OperationId": "createResponse",
8989
"Setup": null

‎src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IOpenAiClient.GetInputTokenCounts.g.cs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ public partial interface IOpenAiClient
4444
/// The truncation strategy to use for the model response. - `auto`: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. - `disabled` (default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
4545
/// </param>
4646
/// <param name="instructions"></param>
47+
/// <param name="personality">
48+
/// A model-owned style preset to apply to this request. Omit this parameter to use the model's default style. Supported values may expand over time. Values must be at most 64 characters.
49+
/// </param>
4750
/// <param name="conversation"></param>
4851
/// <param name="toolChoice"></param>
4952
/// <param name="parallelToolCalls"></param>
@@ -59,6 +62,7 @@ public partial interface IOpenAiClient
5962
global::tryAGI.OpenAI.Reasoning? reasoning = default,
6063
global::tryAGI.OpenAI.TruncationEnum? truncation = default,
6164
string? instructions = default,
65+
global::tryAGI.OpenAI.PersonalityEnum? personality = default,
6266
global::tryAGI.OpenAI.ConversationParam? conversation = default,
6367
global::tryAGI.OpenAI.ToolChoiceParam? toolChoice = default,
6468
bool? parallelToolCalls = default,
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 AdditionalToolsItemParamRoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.AdditionalToolsItemParamRole>
7+
{
8+
/// <inheritdoc />
9+
public override global::tryAGI.OpenAI.AdditionalToolsItemParamRole 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.AdditionalToolsItemParamRoleExtensions.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.AdditionalToolsItemParamRole)numValue;
30+
}
31+
case global::System.Text.Json.JsonTokenType.Null:
32+
{
33+
return default(global::tryAGI.OpenAI.AdditionalToolsItemParamRole);
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.AdditionalToolsItemParamRole 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.AdditionalToolsItemParamRoleExtensions.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 AdditionalToolsItemParamRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.AdditionalToolsItemParamRole?>
7+
{
8+
/// <inheritdoc />
9+
public override global::tryAGI.OpenAI.AdditionalToolsItemParamRole? 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.AdditionalToolsItemParamRoleExtensions.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.AdditionalToolsItemParamRole)numValue;
30+
}
31+
case global::System.Text.Json.JsonTokenType.Null:
32+
{
33+
return default(global::tryAGI.OpenAI.AdditionalToolsItemParamRole?);
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.AdditionalToolsItemParamRole? 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.AdditionalToolsItemParamRoleExtensions.ToValueString(value.Value));
57+
}
58+
}
59+
}
60+
}
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 AdditionalToolsItemParamTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.AdditionalToolsItemParamType>
7+
{
8+
/// <inheritdoc />
9+
public override global::tryAGI.OpenAI.AdditionalToolsItemParamType 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.AdditionalToolsItemParamTypeExtensions.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.AdditionalToolsItemParamType)numValue;
30+
}
31+
case global::System.Text.Json.JsonTokenType.Null:
32+
{
33+
return default(global::tryAGI.OpenAI.AdditionalToolsItemParamType);
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.AdditionalToolsItemParamType 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.AdditionalToolsItemParamTypeExtensions.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 AdditionalToolsItemParamTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.AdditionalToolsItemParamType?>
7+
{
8+
/// <inheritdoc />
9+
public override global::tryAGI.OpenAI.AdditionalToolsItemParamType? 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.AdditionalToolsItemParamTypeExtensions.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.AdditionalToolsItemParamType)numValue;
30+
}
31+
case global::System.Text.Json.JsonTokenType.Null:
32+
{
33+
return default(global::tryAGI.OpenAI.AdditionalToolsItemParamType?);
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.AdditionalToolsItemParamType? 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.AdditionalToolsItemParamTypeExtensions.ToValueString(value.Value));
57+
}
58+
}
59+
}
60+
}

0 commit comments

Comments
 (0)