Skip to content

Commit

Permalink
Merge pull request #184 from tryAGI/bot/update-openapi_202502190325
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Feb 19, 2025
2 parents a5b231e + a84e79d commit bbdee1d
Show file tree
Hide file tree
Showing 23 changed files with 1,957 additions and 465 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#nullable enable

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

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

return default;
}

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

writer.WriteStringValue(global::LangSmith.GroupExampleRunsByFieldExtensions.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 GroupExampleRunsByFieldNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::LangSmith.GroupExampleRunsByField?>
{
/// <inheritdoc />
public override global::LangSmith.GroupExampleRunsByField? 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.GroupExampleRunsByFieldExtensions.ToEnum(stringValue);
}

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

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::LangSmith.GroupExampleRunsByField? 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.GroupExampleRunsByFieldExtensions.ToValueString(value.Value));
}
}
}
}
3 changes: 3 additions & 0 deletions src/libs/LangSmith/Generated/JsonSerializerContext.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ namespace LangSmith
typeof(global::LangSmith.JsonConverters.FunctionMessageTypeNullableJsonConverter),
typeof(global::LangSmith.JsonConverters.FunctionMessageChunkTypeJsonConverter),
typeof(global::LangSmith.JsonConverters.FunctionMessageChunkTypeNullableJsonConverter),
typeof(global::LangSmith.JsonConverters.GroupExampleRunsByFieldJsonConverter),
typeof(global::LangSmith.JsonConverters.GroupExampleRunsByFieldNullableJsonConverter),
typeof(global::LangSmith.JsonConverters.HumanMessageTypeJsonConverter),
typeof(global::LangSmith.JsonConverters.HumanMessageTypeNullableJsonConverter),
typeof(global::LangSmith.JsonConverters.HumanMessageChunkTypeJsonConverter),
Expand Down Expand Up @@ -203,6 +205,7 @@ namespace LangSmith
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<global::System.Collections.Generic.IList<global::LangSmith.DatasetTransformation>, global::LangSmith.Missing>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<global::System.Collections.Generic.IList<string>, string>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<global::System.Collections.Generic.IList<string>, string>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<global::System.Collections.Generic.IList<global::LangSmith.ExampleWithRuns>, global::System.Collections.Generic.IList<global::LangSmith.ExampleWithRunsCH>>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<double?, int?, bool?>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<double?, int?, bool?, string, object>),
typeof(global::LangSmith.JsonConverters.AnyOfJsonConverter<object, string>),
Expand Down
Loading

0 comments on commit bbdee1d

Please sign in to comment.