Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Abstractions/src/MessageHistory/FileChatMessageHistory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
private List<ChatMessage> _messages = new List<ChatMessage>();

/// <inheritdoc/>
public override IReadOnlyList<ChatMessage> Messages => _messages;

Check warning on line 22 in src/Abstractions/src/MessageHistory/FileChatMessageHistory.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

Type of 'FileChatMessageHistory.Messages' is not CLS-compliant

/// <summary>
/// Initializes new history instance with provided file path
Expand All @@ -36,6 +36,8 @@
/// </summary>
/// <param name="path">path of the local file to store the messages</param>
/// <param name="cancellationToken"></param>
[RequiresUnreferencedCode()]

Check failure on line 39 in src/Abstractions/src/MessageHistory/FileChatMessageHistory.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

There is no argument given that corresponds to the required parameter 'message' of 'RequiresUnreferencedCodeAttribute.RequiresUnreferencedCodeAttribute(string)'
[RequiresDynamicCode()]

Check failure on line 40 in src/Abstractions/src/MessageHistory/FileChatMessageHistory.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

There is no argument given that corresponds to the required parameter 'message' of 'RequiresDynamicCodeAttribute.RequiresDynamicCodeAttribute(string)'
public static async Task<FileChatMessageHistory> CreateAsync(string path, CancellationToken cancellationToken = default)
{
FileChatMessageHistory chatHistory = new FileChatMessageHistory(path);
Expand All @@ -45,7 +47,9 @@
}

/// <inheritdoc/>
[RequiresUnreferencedCode()]

Check failure on line 50 in src/Abstractions/src/MessageHistory/FileChatMessageHistory.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

There is no argument given that corresponds to the required parameter 'message' of 'RequiresUnreferencedCodeAttribute.RequiresUnreferencedCodeAttribute(string)'

Check failure on line 50 in src/Abstractions/src/MessageHistory/FileChatMessageHistory.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

There is no argument given that corresponds to the required parameter 'message' of 'RequiresUnreferencedCodeAttribute.RequiresUnreferencedCodeAttribute(string)'
[RequiresDynamicCode()]

Check failure on line 51 in src/Abstractions/src/MessageHistory/FileChatMessageHistory.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

There is no argument given that corresponds to the required parameter 'message' of 'RequiresDynamicCodeAttribute.RequiresDynamicCodeAttribute(string)'
public override Task AddMessage(ChatMessage message)

Check warning on line 52 in src/Abstractions/src/MessageHistory/FileChatMessageHistory.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

Argument type 'ChatMessage' is not CLS-compliant
{
_messages.Add(message);
SaveMessages();
Expand All @@ -54,6 +58,8 @@
}

/// <inheritdoc/>
[RequiresUnreferencedCode()]

Check failure on line 61 in src/Abstractions/src/MessageHistory/FileChatMessageHistory.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

There is no argument given that corresponds to the required parameter 'message' of 'RequiresUnreferencedCodeAttribute.RequiresUnreferencedCodeAttribute(string)'
[RequiresDynamicCode()]

Check failure on line 62 in src/Abstractions/src/MessageHistory/FileChatMessageHistory.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

There is no argument given that corresponds to the required parameter 'message' of 'RequiresDynamicCodeAttribute.RequiresDynamicCodeAttribute(string)'
public override Task Clear()
{
_messages.Clear();
Expand Down
7 changes: 7 additions & 0 deletions src/IntegrationTests/DatabaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public partial class DatabaseTests
[TestCase(SupportedDatabase.InMemory)]
[TestCase(SupportedDatabase.Postgres)]
[TestCase(SupportedDatabase.OpenSearch)]
[Obsolete]
public async Task CreateAndDeleteCollection_Ok(SupportedDatabase database)
{
await using var environment = await StartEnvironmentForAsync(database);
Expand Down Expand Up @@ -38,6 +39,7 @@ public async Task CreateAndDeleteCollection_Ok(SupportedDatabase database)
[TestCase(SupportedDatabase.InMemory)]
[TestCase(SupportedDatabase.Postgres)]
[TestCase(SupportedDatabase.OpenSearch)]
[Obsolete]
public async Task UpsertAndGet_Ok(SupportedDatabase database)
{
await using var environment = await StartEnvironmentForAsync(database);
Expand Down Expand Up @@ -72,6 +74,7 @@ public async Task UpsertAndGet_Ok(SupportedDatabase database)
[TestCase(SupportedDatabase.InMemory)]
[TestCase(SupportedDatabase.Postgres)]
[TestCase(SupportedDatabase.OpenSearch)]
[Obsolete]
public async Task BatchUpsertAndGet_Ok(SupportedDatabase database)
{
await using var environment = await StartEnvironmentForAsync(database);
Expand All @@ -98,6 +101,7 @@ public async Task BatchUpsertAndGet_Ok(SupportedDatabase database)
[TestCase(SupportedDatabase.InMemory)]
[TestCase(SupportedDatabase.Postgres)]
[TestCase(SupportedDatabase.OpenSearch)]
[Obsolete]
public async Task DeleteRecord_Ok(SupportedDatabase database)
{
await using var environment = await StartEnvironmentForAsync(database);
Expand Down Expand Up @@ -125,6 +129,7 @@ public async Task DeleteRecord_Ok(SupportedDatabase database)
[TestCase(SupportedDatabase.InMemory)]
[TestCase(SupportedDatabase.Postgres)]
[TestCase(SupportedDatabase.OpenSearch)]
[Obsolete]
public async Task BatchDelete_Ok(SupportedDatabase database)
{
await using var environment = await StartEnvironmentForAsync(database);
Expand Down Expand Up @@ -169,6 +174,7 @@ public async Task BatchDelete_Ok(SupportedDatabase database)
[TestCase(SupportedDatabase.InMemory)]
[TestCase(SupportedDatabase.Postgres)]
[TestCase(SupportedDatabase.OpenSearch)]
[Obsolete]
public async Task GetServiceMetadata_Ok(SupportedDatabase database)
{
await using var environment = await StartEnvironmentForAsync(database);
Expand All @@ -190,6 +196,7 @@ public async Task GetServiceMetadata_Ok(SupportedDatabase database)
[TestCase(SupportedDatabase.InMemory)]
[TestCase(SupportedDatabase.Postgres)]
[TestCase(SupportedDatabase.OpenSearch)]
[Obsolete]
public async Task SimilaritySearch_Ok(SupportedDatabase database)
{
await using var environment = await StartEnvironmentForAsync(database);
Expand Down
1 change: 1 addition & 0 deletions src/IntegrationTests/HistoryTests.Redis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace LangChain.Databases.IntegrationTests;
public partial class HistoryTests
{
[Test]
[Obsolete]
public async Task Redis_Ttl_Ok()
{
await using var environment = await StartEnvironmentForAsync(SupportedDatabase.Redis);
Expand Down
1 change: 1 addition & 0 deletions src/IntegrationTests/HistoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public partial class HistoryTests
[TestCase(SupportedDatabase.File)]
[TestCase(SupportedDatabase.Mongo)]
[TestCase(SupportedDatabase.Redis)]
[Obsolete]
public async Task FillAndClear_Ok(SupportedDatabase database)
{
await using var environment = await StartEnvironmentForAsync(database);
Expand Down
2 changes: 1 addition & 1 deletion src/Postgres/src/PostgresDbClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@

await using (connection)
{
await using var transaction = await connection.BeginTransactionAsync(cancellationToken).ConfigureAwait(false);
await using var transaction = (await connection.BeginTransactionAsync(cancellationToken).ConfigureAwait(false)).ConfigureAwait(false);

try
{
Expand All @@ -219,7 +219,7 @@
var (id, content, metadata, embedding, timestamp) = records[i];

using var cmd = connection.CreateCommand();
cmd.Transaction = transaction;

Check failure on line 222 in src/Postgres/src/PostgresDbClient.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

Cannot implicitly convert type 'System.Runtime.CompilerServices.ConfiguredAsyncDisposable' to 'Npgsql.NpgsqlTransaction'

cmd.CommandText = $@"
INSERT INTO {fullTableName} (id, content, metadata, embedding, timestamp)
Expand All @@ -242,11 +242,11 @@
await cmd.ExecuteNonQueryAsync(cancellationToken).ConfigureAwait(false);
}

await transaction.CommitAsync(cancellationToken).ConfigureAwait(false);

Check failure on line 245 in src/Postgres/src/PostgresDbClient.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

'ConfiguredAsyncDisposable' does not contain a definition for 'CommitAsync' and no accessible extension method 'CommitAsync' accepting a first argument of type 'ConfiguredAsyncDisposable' could be found (are you missing a using directive or an assembly reference?)
}
catch
{
await transaction.RollbackAsync(cancellationToken).ConfigureAwait(false);

Check failure on line 249 in src/Postgres/src/PostgresDbClient.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

'ConfiguredAsyncDisposable' does not contain a definition for 'RollbackAsync' and no accessible extension method 'RollbackAsync' accepting a first argument of type 'ConfiguredAsyncDisposable' could be found (are you missing a using directive or an assembly reference?)
throw;
}
}
Expand Down
Loading