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 @@ -22,7 +22,7 @@ public partial interface IInterns2Client
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::OpenRouter.ApiException"></exception>
global::System.Threading.Tasks.Task<global::OpenRouter.InternChatCompletionChunk> ChatAsync(
global::System.Threading.Tasks.Task<global::OpenRouter.InternChatSteeredResponse> ChatAsync(
string internId,

global::OpenRouter.InternChatCompletionRequest request,
Expand All @@ -46,7 +46,7 @@ public partial interface IInterns2Client
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::OpenRouter.ApiException"></exception>
global::System.Threading.Tasks.Task<global::OpenRouter.AutoSDKHttpResponse<global::OpenRouter.InternChatCompletionChunk>> ChatAsResponseAsync(
global::System.Threading.Tasks.Task<global::OpenRouter.AutoSDKHttpResponse<global::OpenRouter.InternChatSteeredResponse>> ChatAsResponseAsync(
string internId,

global::OpenRouter.InternChatCompletionRequest request,
Expand Down Expand Up @@ -84,7 +84,7 @@ public partial interface IInterns2Client
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::OpenRouter.InternChatCompletionChunk> ChatAsync(
global::System.Threading.Tasks.Task<global::OpenRouter.InternChatSteeredResponse> ChatAsync(
string internId,
global::System.Collections.Generic.IList<global::OpenRouter.InternChatMessage> messages,
global::OpenRouter.InternApprovalMode? approvalMode = default,
Expand Down
58 changes: 58 additions & 0 deletions src/libs/OpenRouter/Generated/OpenRouter.IModelsClient.GetV2.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#nullable enable

namespace OpenRouter
{
public partial interface IModelsClient
{
/// <summary>
/// Get a model with its V2 endpoint documents<br/>
/// Returns a single model identified by its author and slug (e.g. openai/gpt-4) together with each of its published endpoints in the Models API V2 document format. Known slug aliases are resolved. A variant suffix (e.g. openai/gpt-4:free) selects the record of that variant; a variant no endpoint serves is reported as not found. Routers (openrouter/auto) and `~author/family-latest` aliases are records too. `region` narrows the endpoints the same way it does on the list route; a model left without an endpoint is reported as not found. With an API key the record comes from that key's catalog, as on the list route, so a model the key cannot route to is not found.
/// </summary>
/// <param name="author">
/// The author/organization of the model<br/>
/// Example: openai
/// </param>
/// <param name="slug">
/// The model slug, optionally including a variant suffix (e.g. gpt-4 or gpt-4:free)<br/>
/// Example: gpt-4
/// </param>
/// <param name="region">
/// Only return endpoints in the given data region ("eu" or "us"); a model left without an endpoint is reported as not found. With an API key the record comes from that key's catalog, as on the list route, so a model the key cannot route to is not found.<br/>
/// Example: eu
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::OpenRouter.ApiException"></exception>
global::System.Threading.Tasks.Task<global::OpenRouter.ModelV2Response> GetV2Async(
string author,
string slug,
global::OpenRouter.GetModelV2Region? region = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Get a model with its V2 endpoint documents<br/>
/// Returns a single model identified by its author and slug (e.g. openai/gpt-4) together with each of its published endpoints in the Models API V2 document format. Known slug aliases are resolved. A variant suffix (e.g. openai/gpt-4:free) selects the record of that variant; a variant no endpoint serves is reported as not found. Routers (openrouter/auto) and `~author/family-latest` aliases are records too. `region` narrows the endpoints the same way it does on the list route; a model left without an endpoint is reported as not found. With an API key the record comes from that key's catalog, as on the list route, so a model the key cannot route to is not found.
/// </summary>
/// <param name="author">
/// The author/organization of the model<br/>
/// Example: openai
/// </param>
/// <param name="slug">
/// The model slug, optionally including a variant suffix (e.g. gpt-4 or gpt-4:free)<br/>
/// Example: gpt-4
/// </param>
/// <param name="region">
/// Only return endpoints in the given data region ("eu" or "us"); a model left without an endpoint is reported as not found. With an API key the record comes from that key's catalog, as on the list route, so a model the key cannot route to is not found.<br/>
/// Example: eu
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::OpenRouter.ApiException"></exception>
global::System.Threading.Tasks.Task<global::OpenRouter.AutoSDKHttpResponse<global::OpenRouter.ModelV2Response>> GetV2AsResponseAsync(
string author,
string slug,
global::OpenRouter.GetModelV2Region? region = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
4,036 changes: 4,036 additions & 0 deletions src/libs/OpenRouter/Generated/OpenRouter.IModelsClient.ListV2.g.cs

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions src/libs/OpenRouter/Generated/OpenRouter.IModelsClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@ public partial interface IModelsClient : global::System.IDisposable
/// </summary>
public System.Uri? BaseUri { get; }


/// <summary>
/// The server options available for this client.
/// </summary>
public global::System.Collections.Generic.IReadOnlyList<global::OpenRouter.AutoSDKServer> AvailableServers { get; }

/// <summary>
/// The currently selected server for this client, if any.
/// </summary>
public global::OpenRouter.AutoSDKServer? SelectedServer { get; set; }

/// <summary>
/// Selects one of the generated server options by id.
/// </summary>
public bool TrySelectServer(string serverId);

/// <summary>
/// Clears the currently selected server.
/// </summary>
public void ClearSelectedServer();

/// <summary>
/// The authorizations to use for the requests.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public partial interface ISttClient
/// Example: openai/whisper-large-v3
/// </param>
/// <param name="provider">
/// Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
/// Provider-specific passthrough configuration
/// </param>
/// <param name="responseFormat">
/// Output format. "json" (default) returns { text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers.<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public partial interface ITtsClient
/// Example: mistralai/voxtral-mini-tts-2603
/// </param>
/// <param name="provider">
/// Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
/// Provider-specific passthrough configuration
/// </param>
/// <param name="responseFormat">
/// Audio output format<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ partial void ProcessChatResponseContent(
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::OpenRouter.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::OpenRouter.InternChatCompletionChunk> ChatAsync(
public async global::System.Threading.Tasks.Task<global::OpenRouter.InternChatSteeredResponse> ChatAsync(
string internId,

global::OpenRouter.InternChatCompletionRequest request,
Expand Down Expand Up @@ -96,7 +96,7 @@ partial void ProcessChatResponseContent(
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::OpenRouter.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::OpenRouter.AutoSDKHttpResponse<global::OpenRouter.InternChatCompletionChunk>> ChatAsResponseAsync(
public async global::System.Threading.Tasks.Task<global::OpenRouter.AutoSDKHttpResponse<global::OpenRouter.InternChatSteeredResponse>> ChatAsResponseAsync(
string internId,

global::OpenRouter.InternChatCompletionRequest request,
Expand Down Expand Up @@ -844,9 +844,9 @@ partial void ProcessChatResponseContent(
{
__response.EnsureSuccessStatusCode();

var __value = global::OpenRouter.InternChatCompletionChunk.FromJson(__content, JsonSerializerContext) ??
var __value = global::OpenRouter.InternChatSteeredResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return new global::OpenRouter.AutoSDKHttpResponse<global::OpenRouter.InternChatCompletionChunk>(
return new global::OpenRouter.AutoSDKHttpResponse<global::OpenRouter.InternChatSteeredResponse>(
statusCode: __response.StatusCode,
headers: global::OpenRouter.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri,
Expand Down Expand Up @@ -876,9 +876,9 @@ partial void ProcessChatResponseContent(
#endif
).ConfigureAwait(false);

var __value = await global::OpenRouter.InternChatCompletionChunk.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
var __value = await global::OpenRouter.InternChatSteeredResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
return new global::OpenRouter.AutoSDKHttpResponse<global::OpenRouter.InternChatCompletionChunk>(
return new global::OpenRouter.AutoSDKHttpResponse<global::OpenRouter.InternChatSteeredResponse>(
statusCode: __response.StatusCode,
headers: global::OpenRouter.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri,
Expand Down Expand Up @@ -950,7 +950,7 @@ partial void ProcessChatResponseContent(
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::OpenRouter.InternChatCompletionChunk> ChatAsync(
public async global::System.Threading.Tasks.Task<global::OpenRouter.InternChatSteeredResponse> ChatAsync(
string internId,
global::System.Collections.Generic.IList<global::OpenRouter.InternChatMessage> messages,
global::OpenRouter.InternApprovalMode? approvalMode = default,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#nullable enable

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

break;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::OpenRouter.DescriptorUnitV2);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

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

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

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

break;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::OpenRouter.DescriptorUnitV2?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::OpenRouter.DescriptorUnitV2? 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.DescriptorUnitV2Extensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#nullable enable

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

break;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::OpenRouter.EndpointDocumentV2Quantization);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

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

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