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,45 @@
```csharp title="C#"
using System.Net.Http;
using System.Net.Http.Json;
using System.Text.Json.Serialization;
public record ChunkRequest(
[property: JsonPropertyName("text")] string Text,
[property: JsonPropertyName("max_characters")] int? MaxCharacters = null,
[property: JsonPropertyName("overlap")] int? Overlap = null,
[property: JsonPropertyName("chunker_type")] string? ChunkerType = null
);
public record ChunkResponse(
[property: JsonPropertyName("chunks")] List<ChunkItem> Chunks,
[property: JsonPropertyName("chunk_count")] int ChunkCount
);
public record ChunkItem(
[property: JsonPropertyName("content")] string Content,
[property: JsonPropertyName("chunk_index")] int ChunkIndex
);
class Program
{
static async Task Main()
{
var client = new HttpClient();
var request = new ChunkRequest(
Text: "Your long text content here...",
MaxCharacters: 1000,
Overlap: 50,
ChunkerType: "text"
);
var response = await client.PostAsJsonAsync("http://localhost:8000/chunk", request);
var result = await response.Content.ReadFromJsonAsync<ChunkResponse>();
Console.WriteLine($"Created {result?.ChunkCount} chunks");
foreach (var chunk in result?.Chunks ?? [])
{
Console.WriteLine($"Chunk {chunk.ChunkIndex}: {chunk.Content[..Math.Min(50, chunk.Content.Length)]}...");
}
}
}
```