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 @@ -53,6 +53,13 @@ public partial interface ISimulationScenariosClient
/// <param name="toolMocks">
/// Scenario-level tool call mocks to use during simulations.
/// </param>
/// <param name="latencyExpectations">
/// Latency ceilings for voice simulations. Each expectation aggregates the<br/>
/// target call's per-turn latencies and fails the simulation (when required)<br/>
/// if the aggregated value exceeds its threshold. Skipped for chat simulations<br/>
/// and GPT Live targets; on any other voice simulation, a metric that no turn<br/>
/// measured fails.
/// </param>
/// <param name="path">
/// Optional folder path for organizing scenarios.<br/>
/// Supports up to 3 levels (e.g., "dept/feature/variant").<br/>
Expand All @@ -68,6 +75,7 @@ public partial interface ISimulationScenariosClient
global::System.Collections.Generic.IList<global::Vapi.OneOf<global::Vapi.SimulationHookCallStarted, global::Vapi.SimulationHookCallEnded>>? hooks = default,
global::Vapi.AssistantOverrides? targetOverrides = default,
global::System.Collections.Generic.IList<global::Vapi.ScenarioToolMock>? toolMocks = default,
global::System.Collections.Generic.IList<global::Vapi.LatencyExpectation>? latencyExpectations = default,
string? path = default,
global::Vapi.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public partial interface ISimulationScenariosClient
/// Example: {"variableValues":{"customerName":"Alice","orderId":"12345"}}
/// </param>
/// <param name="toolMocks"></param>
/// <param name="latencyExpectations">
/// Latency ceilings for voice simulations. Omit to leave unchanged; send an<br/>
/// empty array to remove all latency expectations.
/// </param>
/// <param name="path">
/// Optional folder path for organizing scenarios.<br/>
/// Supports up to 3 levels (e.g., "dept/feature/variant").<br/>
Expand All @@ -70,6 +74,7 @@ public partial interface ISimulationScenariosClient
global::System.Collections.Generic.IList<global::Vapi.OneOf<global::Vapi.SimulationHookCallStarted, global::Vapi.SimulationHookCallEnded>>? hooks = default,
global::Vapi.AssistantOverrides? targetOverrides = default,
global::System.Collections.Generic.IList<global::Vapi.ScenarioToolMock>? toolMocks = default,
global::System.Collections.Generic.IList<global::Vapi.LatencyExpectation>? latencyExpectations = default,
string? path = default,
global::Vapi.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 Vapi.JsonConverters
{
/// <inheritdoc />
public sealed class LatencyEvaluationResultAggregationJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Vapi.LatencyEvaluationResultAggregation>
{
/// <inheritdoc />
public override global::Vapi.LatencyEvaluationResultAggregation 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::Vapi.LatencyEvaluationResultAggregationExtensions.ToEnum(stringValue) ?? default;
}

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

return default;
}

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

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

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

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

return default;
}

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

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

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

return default;
}

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

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

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

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

return default;
}

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

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

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

return default;
}

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

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

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

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

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Vapi.LatencyExpectationAggregation? 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::Vapi.LatencyExpectationAggregationExtensions.ToValueString(value.Value));
}
}
}
}
Loading
Loading