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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ public partial interface ISubpackageAnthropicMessagesClient
/// </param>
/// <param name="speed"></param>
/// <param name="stopSequences"></param>
/// <param name="stopServerToolsWhen">
/// Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`.
/// </param>
/// <param name="stream"></param>
/// <param name="system"></param>
/// <param name="temperature"></param>
Expand Down Expand Up @@ -106,6 +109,7 @@ public partial interface ISubpackageAnthropicMessagesClient
string? sessionId = default,
global::OpenRouter.AnthropicSpeed? speed = default,
global::System.Collections.Generic.IList<string>? stopSequences = default,
global::System.Collections.Generic.IList<global::OpenRouter.StopServerToolsWhenCondition>? stopServerToolsWhen = default,
bool? stream = default,
global::OpenRouter.MessagesRequestSystem? system = default,
double? temperature = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ public partial interface ISubpackageBetaResponsesClient
/// <param name="sessionId">
/// A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.
/// </param>
/// <param name="stopServerToolsWhen">
/// Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`.
/// </param>
/// <param name="store"></param>
/// <param name="stream">
/// Default Value: false
Expand Down Expand Up @@ -138,6 +141,7 @@ public partial interface ISubpackageBetaResponsesClient
string? safetyIdentifier = default,
global::OpenRouter.OneOf<global::OpenRouter.ResponsesRequestServiceTier?, object>? serviceTier = default,
string? sessionId = default,
global::System.Collections.Generic.IList<global::OpenRouter.StopServerToolsWhenCondition>? stopServerToolsWhen = default,
bool? store = default,
bool? stream = default,
double? temperature = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ public partial interface ISubpackageChatClient
/// <param name="stop">
/// Stop sequences (up to 4)
/// </param>
/// <param name="stopServerToolsWhen">
/// Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`.
/// </param>
/// <param name="stream">
/// Enable streaming response<br/>
/// Default Value: false
Expand Down Expand Up @@ -172,6 +175,7 @@ public partial interface ISubpackageChatClient
global::OpenRouter.OneOf<global::OpenRouter.ChatRequestServiceTier?, object>? serviceTier = default,
string? sessionId = default,
global::OpenRouter.ChatRequestStop? stop = default,
global::System.Collections.Generic.IList<global::OpenRouter.StopServerToolsWhenCondition>? stopServerToolsWhen = default,
bool? stream = default,
global::OpenRouter.ChatStreamOptions? streamOptions = default,
double? temperature = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ public class ChatRequestPluginsItemsJsonConverter : global::System.Text.Json.Ser
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenRouter.ChatRequestPluginsItemsVariant8)}");
web = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
global::OpenRouter.ChatRequestPluginsItemsVariant9? webFetch = default;
if (discriminator?.Id == global::OpenRouter.ChatRequestPluginsItemsDiscriminatorId.WebFetch)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ChatRequestPluginsItemsVariant9), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.ChatRequestPluginsItemsVariant9> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenRouter.ChatRequestPluginsItemsVariant9)}");
webFetch = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}

var __value = new global::OpenRouter.ChatRequestPluginsItems(
discriminator?.Id,
Expand All @@ -94,7 +101,9 @@ public class ChatRequestPluginsItemsJsonConverter : global::System.Text.Json.Ser

responseHealing,

web
web,

webFetch
);

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

namespace OpenRouter.JsonConverters
{
/// <inheritdoc />
public sealed class FusionServerToolConfigReasoningEffortJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenRouter.FusionServerToolConfigReasoningEffort>
{
/// <inheritdoc />
public override global::OpenRouter.FusionServerToolConfigReasoningEffort 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.FusionServerToolConfigReasoningEffortExtensions.ToEnum(stringValue) ?? default;
}

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

return default;
}

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

writer.WriteStringValue(global::OpenRouter.FusionServerToolConfigReasoningEffortExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace OpenRouter.JsonConverters
{
/// <inheritdoc />
public sealed class FusionServerToolConfigReasoningEffortNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenRouter.FusionServerToolConfigReasoningEffort?>
{
/// <inheritdoc />
public override global::OpenRouter.FusionServerToolConfigReasoningEffort? 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.FusionServerToolConfigReasoningEffortExtensions.ToEnum(stringValue);
}

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

return default;
}

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

if (value == null)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(global::OpenRouter.FusionServerToolConfigReasoningEffortExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ public class MessagesRequestPluginsItemsJsonConverter : global::System.Text.Json
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenRouter.MessagesRequestPluginsItemsVariant8)}");
web = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
global::OpenRouter.MessagesRequestPluginsItemsVariant9? webFetch = default;
if (discriminator?.Id == global::OpenRouter.MessagesRequestPluginsItemsDiscriminatorId.WebFetch)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.MessagesRequestPluginsItemsVariant9), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.MessagesRequestPluginsItemsVariant9> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenRouter.MessagesRequestPluginsItemsVariant9)}");
webFetch = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}

var __value = new global::OpenRouter.MessagesRequestPluginsItems(
discriminator?.Id,
Expand All @@ -94,7 +101,9 @@ public class MessagesRequestPluginsItemsJsonConverter : global::System.Text.Json

responseHealing,

web
web,

webFetch
);

return __value;
Expand Down Expand Up @@ -157,6 +166,12 @@ public override void Write(
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.MessagesRequestPluginsItemsVariant8).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Web!, typeInfo);
}
else if (value.IsWebFetch)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.MessagesRequestPluginsItemsVariant9), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.MessagesRequestPluginsItemsVariant9?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.MessagesRequestPluginsItemsVariant9).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.WebFetch!, typeInfo);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ public class ResponsesRequestPluginsItemsJsonConverter : global::System.Text.Jso
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenRouter.ResponsesRequestPluginsItemsVariant8)}");
web = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
global::OpenRouter.ResponsesRequestPluginsItemsVariant9? webFetch = default;
if (discriminator?.Id == global::OpenRouter.ResponsesRequestPluginsItemsDiscriminatorId.WebFetch)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ResponsesRequestPluginsItemsVariant9), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.ResponsesRequestPluginsItemsVariant9> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenRouter.ResponsesRequestPluginsItemsVariant9)}");
webFetch = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}

var __value = new global::OpenRouter.ResponsesRequestPluginsItems(
discriminator?.Id,
Expand All @@ -94,7 +101,9 @@ public class ResponsesRequestPluginsItemsJsonConverter : global::System.Text.Jso

responseHealing,

web
web,

webFetch
);

return __value;
Expand Down Expand Up @@ -157,6 +166,12 @@ public override void Write(
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ResponsesRequestPluginsItemsVariant8).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Web!, typeInfo);
}
else if (value.IsWebFetch)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ResponsesRequestPluginsItemsVariant9), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.ResponsesRequestPluginsItemsVariant9?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ResponsesRequestPluginsItemsVariant9).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.WebFetch!, typeInfo);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,11 @@ public class ResponsesRequestToolsItemsJsonConverter : global::System.Text.Json.
var __score15 = 0;
if (__jsonProps.Contains("parameters")) __score15++;
if (__jsonProps.Contains("parameters.analysis_models")) __score15++;
if (__jsonProps.Contains("parameters.max_completion_tokens")) __score15++;
if (__jsonProps.Contains("parameters.max_tool_calls")) __score15++;
if (__jsonProps.Contains("parameters.model")) __score15++;
if (__jsonProps.Contains("parameters.reasoning")) __score15++;
if (__jsonProps.Contains("parameters.temperature")) __score15++;
if (__jsonProps.Contains("type")) __score15++;
var __score16 = 0;
if (__jsonProps.Contains("parameters")) __score16++;
Expand Down
Loading