diff --git a/src/Helpers/TrimmingHelper/TrimmingHelper.csproj b/src/Helpers/TrimmingHelper/TrimmingHelper.csproj index be8ba3c..e1eca19 100644 --- a/src/Helpers/TrimmingHelper/TrimmingHelper.csproj +++ b/src/Helpers/TrimmingHelper/TrimmingHelper.csproj @@ -10,10 +10,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Sqlite/src/SourceGenerationContext.cs b/src/Sqlite/src/SourceGenerationContext.cs new file mode 100644 index 0000000..ecbff15 --- /dev/null +++ b/src/Sqlite/src/SourceGenerationContext.cs @@ -0,0 +1,13 @@ +using System.Text.Json.Serialization; +using LangChain.Databases.JsonConverters; +using LangChain.DocumentLoaders; + +namespace LangChain.Databases.Sqlite; + +[JsonSourceGenerationOptions(WriteIndented = true, Converters = [typeof(ObjectAsPrimitiveConverter)])] +[JsonSerializable(typeof(Document))] +[JsonSerializable(typeof(float[]))] +[JsonSerializable(typeof(int))] +[JsonSerializable(typeof(double))] +[JsonSerializable(typeof(float))] +internal sealed partial class SourceGenerationContext : JsonSerializerContext; \ No newline at end of file diff --git a/src/Sqlite/src/SqLiteVectorCollection.cs b/src/Sqlite/src/SqLiteVectorCollection.cs index de83f4c..4568b57 100644 --- a/src/Sqlite/src/SqLiteVectorCollection.cs +++ b/src/Sqlite/src/SqLiteVectorCollection.cs @@ -1,7 +1,5 @@ using System.Globalization; using System.Text.Json; -using System.Text.Json.Serialization; -using LangChain.Databases.JsonConverters; using LangChain.DocumentLoaders; using Microsoft.Data.Sqlite; @@ -173,12 +171,4 @@ public async Task SearchAsync( }).ToArray(), }; } -} - -[JsonSourceGenerationOptions(WriteIndented = true, Converters = [typeof(ObjectAsPrimitiveConverter)])] -[JsonSerializable(typeof(Document))] -[JsonSerializable(typeof(float[]))] -[JsonSerializable(typeof(int))] -[JsonSerializable(typeof(double))] -[JsonSerializable(typeof(float))] -internal sealed partial class SourceGenerationContext : JsonSerializerContext; \ No newline at end of file +} \ No newline at end of file