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 @@ -483,6 +483,9 @@ partial void ProcessCreateChatCompletionResponseContent(
/// <param name="fallbackConfig">
/// Configuration for fallback behavior, including retry and depth settings. See [Specify fallback models](https://www.assemblyai.com/docs/llm-gateway/fallback) for more details.
/// </param>
/// <param name="postProcessingSteps">
/// An ordered list of post-processing steps to apply to the model's response after generation. Currently supports `json-repair`, which automatically fixes malformed JSON in LLM Gateway content responses. See [Post-processing](https://www.assemblyai.com/docs/llm-gateway/post-processing) for details.
/// </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::System.InvalidOperationException"></exception>
Expand All @@ -499,6 +502,7 @@ partial void ProcessCreateChatCompletionResponseContent(
global::AssemblyAI.ResponseFormat? responseFormat = default,
global::System.Collections.Generic.IList<global::AssemblyAI.FallbackObject>? fallbacks = default,
global::AssemblyAI.FallbackConfig? fallbackConfig = default,
global::System.Collections.Generic.IList<global::AssemblyAI.PostProcessingStep>? postProcessingSteps = default,
global::AssemblyAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand All @@ -515,6 +519,7 @@ partial void ProcessCreateChatCompletionResponseContent(
ResponseFormat = responseFormat,
Fallbacks = fallbacks,
FallbackConfig = fallbackConfig,
PostProcessingSteps = postProcessingSteps,
};

return await CreateChatCompletionAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ public partial interface IAssemblyAIClient
/// <param name="fallbackConfig">
/// Configuration for fallback behavior, including retry and depth settings. See [Specify fallback models](https://www.assemblyai.com/docs/llm-gateway/fallback) for more details.
/// </param>
/// <param name="postProcessingSteps">
/// An ordered list of post-processing steps to apply to the model's response after generation. Currently supports `json-repair`, which automatically fixes malformed JSON in LLM Gateway content responses. See [Post-processing](https://www.assemblyai.com/docs/llm-gateway/post-processing) for details.
/// </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::System.InvalidOperationException"></exception>
Expand All @@ -102,6 +105,7 @@ public partial interface IAssemblyAIClient
global::AssemblyAI.ResponseFormat? responseFormat = default,
global::System.Collections.Generic.IList<global::AssemblyAI.FallbackObject>? fallbacks = default,
global::AssemblyAI.FallbackConfig? fallbackConfig = default,
global::System.Collections.Generic.IList<global::AssemblyAI.PostProcessingStep>? postProcessingSteps = default,
global::AssemblyAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

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

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

return default;
}

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

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

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

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

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::AssemblyAI.PostProcessingStepType? 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::AssemblyAI.PostProcessingStepTypeExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ namespace AssemblyAI

typeof(global::AssemblyAI.JsonConverters.ResponseFormatTypeNullableJsonConverter),

typeof(global::AssemblyAI.JsonConverters.PostProcessingStepTypeJsonConverter),

typeof(global::AssemblyAI.JsonConverters.PostProcessingStepTypeNullableJsonConverter),

typeof(global::AssemblyAI.JsonConverters.FunctionToolCallTypeJsonConverter),

typeof(global::AssemblyAI.JsonConverters.FunctionToolCallTypeNullableJsonConverter),
Expand Down Expand Up @@ -286,9 +290,12 @@ namespace AssemblyAI
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AssemblyAI.FallbackObject))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::AssemblyAI.Message>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AssemblyAI.FallbackConfig))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AssemblyAI.PostProcessingStepType), TypeInfoPropertyName = "PostProcessingStepType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AssemblyAI.PostProcessingStep))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AssemblyAI.LLMGatewayRequest))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::AssemblyAI.Tool>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::AssemblyAI.FallbackObject>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::AssemblyAI.PostProcessingStep>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AssemblyAI.ResponseMessage))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AssemblyAI.FunctionToolCallType), TypeInfoPropertyName = "FunctionToolCallType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AssemblyAI.FunctionCall))]
Expand Down Expand Up @@ -357,6 +364,7 @@ namespace AssemblyAI
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::AssemblyAI.Message>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::AssemblyAI.Tool>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::AssemblyAI.FallbackObject>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::AssemblyAI.PostProcessingStep>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::AssemblyAI.FunctionToolCall>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::AssemblyAI.Choice>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::AssemblyAI.LlmGatewayTranslationResponseUtterancesItems>))]
Expand Down
Loading
Loading