Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public partial interface ISubpackageTtsClient
/// <exception cref="global::OpenRouter.ApiException"></exception>
global::System.Threading.Tasks.Task<byte[]> CreateAudioSpeechAsync(

global::OpenRouter.CreateAudioSpeechRequest request,
global::OpenRouter.SpeechRequest request,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
Expand Down Expand Up @@ -47,8 +47,8 @@ public partial interface ISubpackageTtsClient
string input,
string model,
string voice,
global::OpenRouter.AudioSpeechPostRequestBodyContentApplicationJsonSchemaProvider? provider = default,
global::OpenRouter.AudioSpeechPostRequestBodyContentApplicationJsonSchemaResponseFormat? responseFormat = default,
global::OpenRouter.SpeechRequestProvider? provider = default,
global::OpenRouter.SpeechRequestResponseFormat? responseFormat = default,
double? speed = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public class ChatRequestPluginsItemsJsonConverter : global::System.Text.Json.Ser
if (__jsonProps.Contains("enabled")) __score5++;
if (__jsonProps.Contains("engine")) __score5++;
if (__jsonProps.Contains("id")) __score5++;
var __score6 = 0;
if (__jsonProps.Contains("enabled")) __score6++;
if (__jsonProps.Contains("id")) __score6++;
if (__jsonProps.Contains("min_coding_score")) __score6++;
var __bestScore = 0;
var __bestIndex = -1;
if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
Expand All @@ -68,13 +72,15 @@ public class ChatRequestPluginsItemsJsonConverter : global::System.Text.Json.Ser
if (__score3 > __bestScore) { __bestScore = __score3; __bestIndex = 3; }
if (__score4 > __bestScore) { __bestScore = __score4; __bestIndex = 4; }
if (__score5 > __bestScore) { __bestScore = __score5; __bestIndex = 5; }
if (__score6 > __bestScore) { __bestScore = __score6; __bestIndex = 6; }

global::OpenRouter.AutoRouterPlugin? autoRouterPlugin = default;
global::OpenRouter.ModerationPlugin? moderationPlugin = default;
global::OpenRouter.WebSearchPlugin? webSearchPlugin = default;
global::OpenRouter.FileParserPlugin? fileParserPlugin = default;
global::OpenRouter.ResponseHealingPlugin? responseHealingPlugin = default;
global::OpenRouter.ContextCompressionPlugin? contextCompressionPlugin = default;
global::OpenRouter.ParetoRouterPlugin? paretoRouterPlugin = default;
if (__bestIndex >= 0)
{
if (__bestIndex == 0)
Expand Down Expand Up @@ -167,9 +173,24 @@ public class ChatRequestPluginsItemsJsonConverter : global::System.Text.Json.Ser
{
}
}
else if (__bestIndex == 6)
{
try
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ParetoRouterPlugin), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.ParetoRouterPlugin> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ParetoRouterPlugin).Name}");
paretoRouterPlugin = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
}
catch (global::System.InvalidOperationException)
{
}
}
}

if (autoRouterPlugin == null && moderationPlugin == null && webSearchPlugin == null && fileParserPlugin == null && responseHealingPlugin == null && contextCompressionPlugin == null)
if (autoRouterPlugin == null && moderationPlugin == null && webSearchPlugin == null && fileParserPlugin == null && responseHealingPlugin == null && contextCompressionPlugin == null && paretoRouterPlugin == null)
{
try
{
Expand Down Expand Up @@ -248,6 +269,19 @@ public class ChatRequestPluginsItemsJsonConverter : global::System.Text.Json.Ser
catch (global::System.InvalidOperationException)
{
}

try
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ParetoRouterPlugin), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.ParetoRouterPlugin> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ParetoRouterPlugin).Name}");
paretoRouterPlugin = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
}
catch (global::System.InvalidOperationException)
{
}
}

var __value = new global::OpenRouter.ChatRequestPluginsItems(
Expand All @@ -261,7 +295,9 @@ public class ChatRequestPluginsItemsJsonConverter : global::System.Text.Json.Ser

responseHealingPlugin,

contextCompressionPlugin
contextCompressionPlugin,

paretoRouterPlugin
);

return __value;
Expand Down Expand Up @@ -312,6 +348,12 @@ public override void Write(
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ContextCompressionPlugin).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.ContextCompressionPlugin!, typeInfo);
}
else if (value.IsParetoRouterPlugin)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ParetoRouterPlugin), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.ParetoRouterPlugin?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ParetoRouterPlugin).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.ParetoRouterPlugin!, typeInfo);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public class MessagesRequestPluginsItemsJsonConverter : global::System.Text.Json
if (__jsonProps.Contains("enabled")) __score5++;
if (__jsonProps.Contains("engine")) __score5++;
if (__jsonProps.Contains("id")) __score5++;
var __score6 = 0;
if (__jsonProps.Contains("enabled")) __score6++;
if (__jsonProps.Contains("id")) __score6++;
if (__jsonProps.Contains("min_coding_score")) __score6++;
var __bestScore = 0;
var __bestIndex = -1;
if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
Expand All @@ -68,13 +72,15 @@ public class MessagesRequestPluginsItemsJsonConverter : global::System.Text.Json
if (__score3 > __bestScore) { __bestScore = __score3; __bestIndex = 3; }
if (__score4 > __bestScore) { __bestScore = __score4; __bestIndex = 4; }
if (__score5 > __bestScore) { __bestScore = __score5; __bestIndex = 5; }
if (__score6 > __bestScore) { __bestScore = __score6; __bestIndex = 6; }

global::OpenRouter.AutoRouterPlugin? autoRouterPlugin = default;
global::OpenRouter.ModerationPlugin? moderationPlugin = default;
global::OpenRouter.WebSearchPlugin? webSearchPlugin = default;
global::OpenRouter.FileParserPlugin? fileParserPlugin = default;
global::OpenRouter.ResponseHealingPlugin? responseHealingPlugin = default;
global::OpenRouter.ContextCompressionPlugin? contextCompressionPlugin = default;
global::OpenRouter.ParetoRouterPlugin? paretoRouterPlugin = default;
if (__bestIndex >= 0)
{
if (__bestIndex == 0)
Expand Down Expand Up @@ -167,9 +173,24 @@ public class MessagesRequestPluginsItemsJsonConverter : global::System.Text.Json
{
}
}
else if (__bestIndex == 6)
{
try
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ParetoRouterPlugin), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.ParetoRouterPlugin> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ParetoRouterPlugin).Name}");
paretoRouterPlugin = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
}
catch (global::System.InvalidOperationException)
{
}
}
}

if (autoRouterPlugin == null && moderationPlugin == null && webSearchPlugin == null && fileParserPlugin == null && responseHealingPlugin == null && contextCompressionPlugin == null)
if (autoRouterPlugin == null && moderationPlugin == null && webSearchPlugin == null && fileParserPlugin == null && responseHealingPlugin == null && contextCompressionPlugin == null && paretoRouterPlugin == null)
{
try
{
Expand Down Expand Up @@ -248,6 +269,19 @@ public class MessagesRequestPluginsItemsJsonConverter : global::System.Text.Json
catch (global::System.InvalidOperationException)
{
}

try
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ParetoRouterPlugin), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.ParetoRouterPlugin> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ParetoRouterPlugin).Name}");
paretoRouterPlugin = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
}
catch (global::System.InvalidOperationException)
{
}
}

var __value = new global::OpenRouter.MessagesRequestPluginsItems(
Expand All @@ -261,7 +295,9 @@ public class MessagesRequestPluginsItemsJsonConverter : global::System.Text.Json

responseHealingPlugin,

contextCompressionPlugin
contextCompressionPlugin,

paretoRouterPlugin
);

return __value;
Expand Down Expand Up @@ -312,6 +348,12 @@ public override void Write(
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ContextCompressionPlugin).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.ContextCompressionPlugin!, typeInfo);
}
else if (value.IsParetoRouterPlugin)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ParetoRouterPlugin), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.ParetoRouterPlugin?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ParetoRouterPlugin).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.ParetoRouterPlugin!, typeInfo);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace OpenRouter.JsonConverters
{
/// <inheritdoc />
public sealed class ParetoRouterPluginIdJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenRouter.ParetoRouterPluginId>
{
/// <inheritdoc />
public override global::OpenRouter.ParetoRouterPluginId Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::OpenRouter.ParetoRouterPluginIdExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::OpenRouter.ParetoRouterPluginId)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::OpenRouter.ParetoRouterPluginId);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::OpenRouter.ParetoRouterPluginId value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::OpenRouter.ParetoRouterPluginIdExtensions.ToValueString(value));
}
}
}
Loading
Loading