Nomad changes
All checks were successful
Deploy fil (kreuzberg) / deploy (push) Successful in 49s

This commit is contained in:
Henrik Jess Nielsen
2026-06-01 23:40:55 +02:00
parent 72b1a0a6ed
commit b4c07d3693
5723 changed files with 1130655 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
// This file is auto-generated by alef. DO NOT EDIT.
// alef:hash:4e15143f4af1ae8bafbdb1506ef057da924484c66a19483966333558ad437e75
#nullable enable
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Kreuzberg;
/// <summary>
/// How the extracted text was produced.
/// </summary>
[JsonConverter(typeof(ExtractionMethodJsonConverter))]
public enum ExtractionMethod
{
[JsonPropertyName("native")]
Native,
[JsonPropertyName("ocr")]
Ocr,
[JsonPropertyName("mixed")]
Mixed,
}
/// <summary>
/// Custom JSON converter for <see cref="ExtractionMethod"/> that respects explicit variant names.
/// </summary>
internal sealed class ExtractionMethodJsonConverter : JsonConverter<ExtractionMethod>
{
public override ExtractionMethod Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
return value switch
{
"native" => ExtractionMethod.Native,
"ocr" => ExtractionMethod.Ocr,
"mixed" => ExtractionMethod.Mixed,
_ => throw new JsonException($"Unknown ExtractionMethod value: {value}")
};
}
public override void Write(Utf8JsonWriter writer, ExtractionMethod value, JsonSerializerOptions options)
{
var str = value switch
{
ExtractionMethod.Native => "native",
ExtractionMethod.Ocr => "ocr",
ExtractionMethod.Mixed => "mixed",
_ => throw new JsonException($"Unknown ExtractionMethod value: {value}")
};
writer.WriteStringValue(str);
}
}