Skip to content

Commit

Permalink
feat: Updated OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and HavenDV committed Dec 3, 2024
1 parent 98a0448 commit 7e9b419
Show file tree
Hide file tree
Showing 74 changed files with 6,576 additions and 395 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#nullable enable

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

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

return default;
}

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

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

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

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

return default;
}

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

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

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

return default;
}

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

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

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

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

return default;
}

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

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

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

return default;
}

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

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

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

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

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::LangSmith.EPromptOptimizationJobStatus? 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::LangSmith.EPromptOptimizationJobStatusExtensions.ToValueString(value.Value));
}
}
}
}
10 changes: 10 additions & 0 deletions src/libs/LangSmith/Generated/JsonSerializerContext.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ namespace LangSmith
typeof(global::LangSmith.JsonConverters.PaymentPlanTierNullableJsonConverter),
typeof(global::LangSmith.JsonConverters.DatasetTransformationTypeJsonConverter),
typeof(global::LangSmith.JsonConverters.DatasetTransformationTypeNullableJsonConverter),
typeof(global::LangSmith.JsonConverters.EPromptOptimizationAlgorithmJsonConverter),
typeof(global::LangSmith.JsonConverters.EPromptOptimizationAlgorithmNullableJsonConverter),
typeof(global::LangSmith.JsonConverters.EPromptOptimizationJobLogTypeJsonConverter),
typeof(global::LangSmith.JsonConverters.EPromptOptimizationJobLogTypeNullableJsonConverter),
typeof(global::LangSmith.JsonConverters.EPromptOptimizationJobStatusJsonConverter),
typeof(global::LangSmith.JsonConverters.EPromptOptimizationJobStatusNullableJsonConverter),
typeof(global::LangSmith.JsonConverters.ExampleListOrderJsonConverter),
typeof(global::LangSmith.JsonConverters.ExampleListOrderNullableJsonConverter),
typeof(global::LangSmith.JsonConverters.ExampleSelectJsonConverter),
Expand Down Expand Up @@ -223,6 +229,7 @@ namespace LangSmith
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<double?, string>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<double?, string>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<double?, string>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<global::LangSmith.PromptimConfig, global::LangSmith.DemoConfig>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<string, global::System.Collections.Generic.IList<global::LangSmith.AnyOf<string, object>>>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<string, object>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<string, global::System.Collections.Generic.IList<global::LangSmith.AnyOf<string, object>>>),
Expand All @@ -232,6 +239,9 @@ namespace LangSmith
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<string, global::System.Collections.Generic.IList<global::LangSmith.AnyOf<string, object>>>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<string, object>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<global::System.Collections.Generic.IList<object>, object>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<global::LangSmith.PromptimConfig, global::LangSmith.DemoConfig>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<global::LangSmith.PromptimConfig, global::LangSmith.DemoConfig>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<global::LangSmith.PromptimConfig, global::LangSmith.DemoConfig>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<global::System.DateTime?, string>),
typeof(global::LangSmith.JsonConverters.OneOfJsonConverter<string, double?>),
typeof(global::LangSmith.JsonConverters.OneOfJsonConverter<string, double?>),
Expand Down
Loading

0 comments on commit 7e9b419

Please sign in to comment.