diff --git a/examples/LangChain.Samples.LocalRAG/Program.cs b/examples/LangChain.Samples.LocalRAG/Program.cs index 18d31685..6d72adb0 100644 --- a/examples/LangChain.Samples.LocalRAG/Program.cs +++ b/examples/LangChain.Samples.LocalRAG/Program.cs @@ -21,7 +21,7 @@ collectionName: "harrypotter", // Can be omitted, use if you want to have multiple collections textSplitter: null, behavior: AddDocumentsToDatabaseBehavior.JustReturnCollectionIfCollectionIsAlreadyExists); - + const string question = "What is Harry's Address?"; var similarDocuments = await vectorCollection.GetSimilarDocuments(embeddingModel, question, amount: 5); diff --git a/src/Core/src/Extensions/AddDocumentsToDatabaseBehavior.cs b/src/Core/src/Extensions/AddDocumentsToDatabaseBehavior.cs index 254f4d39..294e1762 100644 --- a/src/Core/src/Extensions/AddDocumentsToDatabaseBehavior.cs +++ b/src/Core/src/Extensions/AddDocumentsToDatabaseBehavior.cs @@ -6,12 +6,12 @@ public enum AddDocumentsToDatabaseBehavior /// If the collection already exists, it will be returned without any changes. /// JustReturnCollectionIfCollectionIsAlreadyExists, - + /// /// If the collection already exists, it will be deleted and recreated. /// OverwriteExistingCollection, - + /// /// If the collection already exists, all documents will be added to the existing collection. /// diff --git a/src/Core/src/Extensions/VectorDatabaseExtensions.cs b/src/Core/src/Extensions/VectorDatabaseExtensions.cs index ada3a3b6..3a6ce588 100644 --- a/src/Core/src/Extensions/VectorDatabaseExtensions.cs +++ b/src/Core/src/Extensions/VectorDatabaseExtensions.cs @@ -53,7 +53,7 @@ await vectorDatabase.DeleteCollectionAsync( collectionName: collectionName, cancellationToken: cancellationToken).ConfigureAwait(false); } - + var vectorCollection = await vectorDatabase.GetOrCreateCollectionAsync( collectionName: collectionName, dimensions: dimensions, diff --git a/src/Serve/OpenAI/ServeController.cs b/src/Serve/OpenAI/ServeController.cs index 9e73592a..9d3042b5 100644 --- a/src/Serve/OpenAI/ServeController.cs +++ b/src/Serve/OpenAI/ServeController.cs @@ -13,7 +13,7 @@ public ModelsList GetModel() Models = options.ListModels().Select(static x => new Model(x, ownedBy: "OpenAI")).ToList() }; } - + public ModelsList ListModels() { return new ModelsList diff --git a/src/Serve/OpenAI/ServeExtensions.cs b/src/Serve/OpenAI/ServeExtensions.cs index 405c13a9..520a0373 100644 --- a/src/Serve/OpenAI/ServeExtensions.cs +++ b/src/Serve/OpenAI/ServeExtensions.cs @@ -32,7 +32,7 @@ public static WebApplication UseLangChainServeOpenAi(this WebApplication app, Ac app.MapPost("/v1/chat/completions", async (ChatRequest request) => { var llm = serveMiddlewareOptions.GetModel(request.Model); - + var response = await llm.GenerateAsync(new LangChain.Providers.ChatRequest { Messages = request.Messages.Select(x => new LangChain.Providers.Message @@ -47,7 +47,7 @@ public static WebApplication UseLangChainServeOpenAi(this WebApplication app, Ac } }).ToList(), }).ConfigureAwait(false); - + return Results.Ok(new ChatResponse()); });