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
342 changes: 342 additions & 0 deletions src/libs/Speechify/Generated/Speechify.AudioAssetsClient.GetBytes.g.cs

Large diffs are not rendered by default.

731 changes: 731 additions & 0 deletions src/libs/Speechify/Generated/Speechify.AudioClient.Stream.g.cs

Large diffs are not rendered by default.

Large diffs are not rendered by default.

489 changes: 489 additions & 0 deletions src/libs/Speechify/Generated/Speechify.FilesClient.GetContent.g.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,25 @@ public partial interface IAudioAssetsClient
/// </summary>
/// <param name="audioAssetId"></param>
/// <param name="speechifyVersion"></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::Speechify.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Speechify.AutoSDKHttpResponse<global::System.IO.Stream>> GetBytesAsStreamAsResponseAsync(
string audioAssetId,
string? speechifyVersion = default,
global::Speechify.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Get Audio Asset Bytes<br/>
/// Stream the raw WAV bytes for an audio asset. Byte-stream<br/>
/// sibling of the metadata endpoint at /v1/agents/audio-assets/{audio_asset_id}.<br/>
/// The agent runtime fetches through here for the play_audio<br/>
/// builtin; SDK consumers can also download originals. Returns 404<br/>
/// for missing / soft-deleted / foreign-tenant assets.
/// </summary>
/// <param name="audioAssetId"></param>
/// <param name="speechifyVersion"></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::Speechify.ApiException"></exception>
Expand Down
24 changes: 24 additions & 0 deletions src/libs/Speechify/Generated/Speechify.IAudioClient.Stream.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,30 @@ public partial interface IAudioClient
/// <param name="speechifyVersion"></param>
/// <param name="accept"></param>
/// <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::Speechify.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Speechify.AutoSDKHttpResponse<global::System.IO.Stream>> StreamAsStreamAsResponseAsync(

global::Speechify.GetStreamRequest request,
string? speechifyVersion = default,
global::Speechify.V1AudioStreamPostParametersAccept? accept = default,
global::Speechify.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Stream Speech<br/>
/// Synthesize speech and stream the audio back as it is generated, for<br/>
/// low-latency playback. Set `output_format` in the body for explicit<br/>
/// codec/sample-rate/bitrate control (e.g. `pcm_16000` or `ulaw_8000` for<br/>
/// telephony), or fall back to the Accept header for the container; the<br/>
/// response is raw audio bytes (HTTP chunked). For Base64-encoded audio<br/>
/// with speech-mark metadata in a single JSON response, use<br/>
/// POST /v1/audio/speech.
/// </summary>
/// <param name="speechifyVersion"></param>
/// <param name="accept"></param>
/// <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::Speechify.ApiException"></exception>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@ public partial interface IConversationsClient
/// </summary>
/// <param name="conversationId"></param>
/// <param name="speechifyVersion"></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::Speechify.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Speechify.AutoSDKHttpResponse<global::System.IO.Stream>> StreamRecordingAsStreamAsResponseAsync(
string conversationId,
string? speechifyVersion = default,
global::Speechify.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Stream Recording<br/>
/// Proxy the GCS-stored audio recording for a conversation through<br/>
/// the Cloud Run service identity. Returns OGG/Opus bytes (LiveKit<br/>
/// room-composite egress default). The response is streamed so a<br/>
/// long recording does not buffer in memory; `&lt;audio src&gt;` consumers<br/>
/// can seek directly. Only present when the agent had<br/>
/// `save_audio_recording` enabled at session start.
/// </summary>
/// <param name="conversationId"></param>
/// <param name="speechifyVersion"></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::Speechify.ApiException"></exception>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ public partial interface IFilesClient
/// </summary>
/// <param name="fileId"></param>
/// <param name="speechifyVersion"></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::Speechify.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Speechify.AutoSDKHttpResponse<global::System.IO.Stream>> GetContentAsStreamAsResponseAsync(
string fileId,
string? speechifyVersion = default,
global::Speechify.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Get File Content<br/>
/// Download the file's bytes. Private, uncacheable, and always served as<br/>
/// an `application/octet-stream` attachment whatever the file's own type -<br/>
/// read `content_type` from the file object for what it actually is.<br/>
/// Dark launch: requires the `durable_runs_access` entitlement (402 `durable_runs_not_in_plan` otherwise).
/// </summary>
/// <param name="fileId"></param>
/// <param name="speechifyVersion"></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::Speechify.ApiException"></exception>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ public partial interface IVoicesClient
/// </summary>
/// <param name="voiceId"></param>
/// <param name="speechifyVersion"></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::Speechify.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Speechify.AutoSDKHttpResponse<global::System.IO.Stream>> DownloadSampleAsStreamAsResponseAsync(
string voiceId,
string? speechifyVersion = default,
global::Speechify.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Download Voice Sample<br/>
/// Download a personal (cloned) voice sample
/// </summary>
/// <param name="voiceId"></param>
/// <param name="speechifyVersion"></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::Speechify.ApiException"></exception>
Expand Down
66 changes: 44 additions & 22 deletions src/libs/Speechify/Generated/Speechify.ResponseStream.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ internal sealed class ResponseStream : global::System.IO.Stream
{
private readonly global::System.Net.Http.HttpResponseMessage _response;
private readonly global::System.IO.Stream _stream;
private bool _disposed;
private int _disposed;

public ResponseStream(
global::System.Net.Http.HttpResponseMessage response,
Expand Down Expand Up @@ -47,21 +47,51 @@ public override int WriteTimeout
global::System.Threading.CancellationToken cancellationToken) =>
_stream.FlushAsync(cancellationToken);

public override int Read(byte[] buffer, int offset, int count) =>
_stream.Read(buffer, offset, count);
public override int Read(byte[] buffer, int offset, int count)
{
try
{
return _stream.Read(buffer, offset, count);
}
catch
{
Dispose();
throw;
}
}

public override global::System.Threading.Tasks.Task<int> ReadAsync(
public override async global::System.Threading.Tasks.Task<int> ReadAsync(
byte[] buffer,
int offset,
int count,
global::System.Threading.CancellationToken cancellationToken) =>
_stream.ReadAsync(buffer, offset, count, cancellationToken);
global::System.Threading.CancellationToken cancellationToken)
{
try
{
return await _stream.ReadAsync(buffer, offset, count, cancellationToken).ConfigureAwait(false);
}
catch
{
Dispose();
throw;
}
}

#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER
public override global::System.Threading.Tasks.ValueTask<int> ReadAsync(
public override async global::System.Threading.Tasks.ValueTask<int> ReadAsync(
global::System.Memory<byte> buffer,
global::System.Threading.CancellationToken cancellationToken = default) =>
_stream.ReadAsync(buffer, cancellationToken);
global::System.Threading.CancellationToken cancellationToken = default)
{
try
{
return await _stream.ReadAsync(buffer, cancellationToken).ConfigureAwait(false);
}
catch
{
Dispose();
throw;
}
}
#endif

public override long Seek(long offset, global::System.IO.SeekOrigin origin) =>
Expand Down Expand Up @@ -89,28 +119,20 @@ public override void Write(byte[] buffer, int offset, int count) =>

protected override void Dispose(bool disposing)
{
if (!_disposed && disposing)
if (disposing && global::System.Threading.Interlocked.Exchange(ref _disposed, 1) == 0)
{
_disposed = true;
_stream.Dispose();
// The response content owns the underlying stream; disposing both would close it twice.
_response.Dispose();
}

base.Dispose(disposing);
}

#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER
public override async global::System.Threading.Tasks.ValueTask DisposeAsync()
public override global::System.Threading.Tasks.ValueTask DisposeAsync()
{
if (_disposed)
{
return;
}

_disposed = true;
await _stream.DisposeAsync().ConfigureAwait(false);
_response.Dispose();
await base.DisposeAsync().ConfigureAwait(false);
Dispose();
return default;
}
#endif
}
Expand Down
Loading
Loading