Skip to content

Commit

Permalink
style: Run dotnet format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed May 13, 2024
1 parent 9ecb3f6 commit b6ad352
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/LangChain.Samples.LocalRAG/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/Core/src/Extensions/AddDocumentsToDatabaseBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ public enum AddDocumentsToDatabaseBehavior
/// If the collection already exists, it will be returned without any changes.
/// </summary>
JustReturnCollectionIfCollectionIsAlreadyExists,

/// <summary>
/// If the collection already exists, it will be deleted and recreated.
/// </summary>
OverwriteExistingCollection,

/// <summary>
/// If the collection already exists, all documents will be added to the existing collection.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Extensions/VectorDatabaseExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ await vectorDatabase.DeleteCollectionAsync(
collectionName: collectionName,
cancellationToken: cancellationToken).ConfigureAwait(false);
}

var vectorCollection = await vectorDatabase.GetOrCreateCollectionAsync(
collectionName: collectionName,
dimensions: dimensions,
Expand Down
2 changes: 1 addition & 1 deletion src/Serve/OpenAI/ServeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Serve/OpenAI/ServeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -47,7 +47,7 @@ public static WebApplication UseLangChainServeOpenAi(this WebApplication app, Ac
}
}).ToList(),
}).ConfigureAwait(false);
return Results.Ok(new ChatResponse());
});

Expand Down

0 comments on commit b6ad352

Please sign in to comment.