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

Large diffs are not rendered by default.

644 changes: 644 additions & 0 deletions src/libs/OpenRouter/Generated/OpenRouter.FilesClient.Download.g.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,27 @@ public partial interface IContainersClient
/// Container file id (`cfile_` + base64url of the file path).<br/>
/// Example: cfile_b3V0L3JlcG9ydC5jc3Y
/// </param>
/// <returns>The response metadata and an unbuffered body stream. The caller must dispose Body to release the HTTP response.</returns>
/// <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::System.IO.Stream>> DownloadContainerFileContentAsStreamAsResponseAsync(
string containerId,
string fileId,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Download container file content<br/>
/// Streams the raw bytes of a file in a container.
/// </summary>
/// <param name="containerId">
/// The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r&lt;nonce&gt;`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.<br/>
/// Example: sess_abc123
/// </param>
/// <param name="fileId">
/// Container file id (`cfile_` + base64url of the file path).<br/>
/// Example: cfile_b3V0L3JlcG9ydC5jc3Y
/// </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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,31 @@ public partial interface IFilesClient
/// Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.<br/>
/// Example: openai
/// </param>
/// <returns>The response metadata and an unbuffered body stream. The caller must dispose Body to release the HTTP response.</returns>
/// <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::System.IO.Stream>> DownloadAsStreamAsResponseAsync(
string fileId,
global::System.Guid? workspaceId = default,
global::OpenRouter.FileProvider? provider = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Download file content<br/>
/// Downloads the raw bytes of a file. Only files created server-side are downloadable; uploaded files return 400.
/// </summary>
/// <param name="fileId">
/// Example: or_file_011CNha8iCJcU1wXNR6q4V8w
/// </param>
/// <param name="workspaceId">
/// Workspace to scope the request to. Defaults to the caller’s default workspace.<br/>
/// Example: a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7
/// </param>
/// <param name="provider">
/// Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.<br/>
/// Example: openai
/// </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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ public partial interface ITtsClient
/// Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).
/// </summary>
/// <param name="request"></param>
/// <returns>The response metadata and an unbuffered body stream. The caller must dispose Body to release the HTTP response.</returns>
/// <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::System.IO.Stream>> CreateSpeechAsStreamAsResponseAsync(

global::OpenRouter.SpeechRequest request,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Create speech<br/>
/// Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).
/// </summary>
/// <param name="request"></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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@ public partial interface IVideoGenerationClient
/// Default Value: 0<br/>
/// Example: 0
/// </param>
/// <returns>The response metadata and an unbuffered body stream. The caller must dispose Body to release the HTTP response.</returns>
/// <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::System.IO.Stream>> GetVideoContentAsStreamAsResponseAsync(
string jobId,
int? index = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Download generated video content<br/>
/// Streams the generated video content from the upstream provider
/// </summary>
/// <param name="jobId">
/// Example: job-abc123
/// </param>
/// <param name="index">
/// Default Value: 0<br/>
/// Example: 0
/// </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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@ public class AnthropicToolSearchContentJsonConverter : global::System.Text.Json.
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenRouter.AnthropicToolSearchContentDiscriminator)}");
var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);

global::OpenRouter.AnthropicToolSearchResultError? toolSearchToolResultError1 = default;
global::OpenRouter.AnthropicToolSearchResultError? toolSearchToolResultError = default;
if (discriminator?.Type == global::OpenRouter.AnthropicToolSearchContentDiscriminatorType.ToolSearchToolResultError)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AnthropicToolSearchResultError), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.AnthropicToolSearchResultError> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenRouter.AnthropicToolSearchResultError)}");
toolSearchToolResultError1 = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
toolSearchToolResultError = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
global::OpenRouter.AnthropicToolSearchResult? toolSearchToolResultError2 = default;
if (discriminator?.Type == global::OpenRouter.AnthropicToolSearchContentDiscriminatorType.ToolSearchToolResultError)
global::OpenRouter.AnthropicToolSearchResult? toolSearchToolSearchResult = default;
if (discriminator?.Type == global::OpenRouter.AnthropicToolSearchContentDiscriminatorType.ToolSearchToolSearchResult)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AnthropicToolSearchResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.AnthropicToolSearchResult> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenRouter.AnthropicToolSearchResult)}");
toolSearchToolResultError2 = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
toolSearchToolSearchResult = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}

var __value = new global::OpenRouter.AnthropicToolSearchContent(
discriminator?.Type,
toolSearchToolResultError1,
toolSearchToolResultError,

toolSearchToolResultError2
toolSearchToolSearchResult
);

return __value;
Expand All @@ -55,17 +55,17 @@ public override void Write(
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");

if (value.IsToolSearchToolResultError1)
if (value.IsToolSearchToolResultError)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AnthropicToolSearchResultError), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.AnthropicToolSearchResultError?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.AnthropicToolSearchResultError).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickToolSearchToolResultError1(), typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickToolSearchToolResultError(), typeInfo);
}
else if (value.IsToolSearchToolResultError2)
else if (value.IsToolSearchToolSearchResult)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AnthropicToolSearchResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.AnthropicToolSearchResult?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.AnthropicToolSearchResult).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickToolSearchToolResultError2(), typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickToolSearchToolSearchResult(), typeInfo);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ public class ChatContentItemsJsonConverter : global::System.Text.Json.Serializat
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenRouter.ChatContentAudio)}");
inputAudio = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
global::OpenRouter.LegacyChatContentVideo? inputVideo1 = default;
global::OpenRouter.LegacyChatContentVideo? inputVideo = default;
if (discriminator?.Type == global::OpenRouter.ChatContentItemsDiscriminatorType.InputVideo)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.LegacyChatContentVideo), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.LegacyChatContentVideo> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenRouter.LegacyChatContentVideo)}");
inputVideo1 = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
inputVideo = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
global::OpenRouter.ChatContentVideo? inputVideo2 = default;
if (discriminator?.Type == global::OpenRouter.ChatContentItemsDiscriminatorType.InputVideo)
global::OpenRouter.ChatContentVideo? videoUrl = default;
if (discriminator?.Type == global::OpenRouter.ChatContentItemsDiscriminatorType.VideoUrl)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ChatContentVideo), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.ChatContentVideo> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenRouter.ChatContentVideo)}");
inputVideo2 = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
videoUrl = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
global::OpenRouter.ChatContentFile? file = default;
if (discriminator?.Type == global::OpenRouter.ChatContentItemsDiscriminatorType.File)
Expand All @@ -72,9 +72,9 @@ public class ChatContentItemsJsonConverter : global::System.Text.Json.Serializat

inputAudio,

inputVideo1,
inputVideo,

inputVideo2,
videoUrl,

file
);
Expand Down Expand Up @@ -109,17 +109,17 @@ public override void Write(
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ChatContentAudio).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickInputAudio(), typeInfo);
}
else if (value.IsInputVideo1)
else if (value.IsInputVideo)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.LegacyChatContentVideo), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.LegacyChatContentVideo?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.LegacyChatContentVideo).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickInputVideo1(), typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickInputVideo(), typeInfo);
}
else if (value.IsInputVideo2)
else if (value.IsVideoUrl)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ChatContentVideo), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::OpenRouter.ChatContentVideo?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ChatContentVideo).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickInputVideo2(), typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickVideoUrl(), typeInfo);
}
else if (value.IsFile)
{
Expand Down
Loading
Loading