-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Updated to latest LangChain.Databases.
- Loading branch information
Showing
8 changed files
with
309 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using DotNet.Testcontainers.Containers; | ||
using LangChain.Providers; | ||
|
||
namespace LangChain.Databases.IntegrationTests; | ||
|
||
public sealed class DatabaseTestEnvironment : IAsyncDisposable | ||
{ | ||
public required IVectorDatabase VectorDatabase { get; set; } | ||
public IEmbeddingModel? EmbeddingModel { get; set; } | ||
public int Port { get; set; } | ||
public string CollectionName { get; set; } = "test" + Guid.NewGuid().ToString("N"); | ||
public int Dimensions { get; set; } = 1536; | ||
public IContainer? Container { get; set; } | ||
|
||
public async ValueTask DisposeAsync() | ||
{ | ||
if (Container != null) | ||
{ | ||
await Container.DisposeAsync(); | ||
} | ||
if (VectorDatabase is IDisposable disposable) | ||
{ | ||
disposable.Dispose(); | ||
} | ||
} | ||
} |
Oops, something went wrong.