Skip to content

Commit 8379620

Browse files
Do not register factory.
1 parent 3ef5ac7 commit 8379620

File tree

107 files changed

+361
-366
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+361
-366
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ dotnet_diagnostic.MA0004.severity = none
5555
dotnet_diagnostic.MA0006.severity = none
5656

5757
# MA0007: Add a comma after the last value
58-
dotnet_diagnostic.MA0007.severity = none
58+
dotnet_diagnostic.MA0007.severity = warning
5959

6060
# MA0008: Add StructLayoutAttribute
6161
dotnet_diagnostic.MA0008.severity = none

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<PackageProjectUrl>https://github.com/squidex/squidex</PackageProjectUrl>
1212
<PublishRepositoryUrl>true</PublishRepositoryUrl>
1313
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
14-
<Version>6.28.0</Version>
14+
<Version>6.29.0</Version>
1515
</PropertyGroup>
1616

1717
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">

ai/Squidex.AI.EntityFramework/EFChatServiceExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ public static AIBuilder AddEntityFrameworkChatStore<T>(this AIBuilder builder)
2020
builder.Services.AddSingletonAs<EFChatStore<T>>()
2121
.As<IChatStore>();
2222

23-
builder.Services.AddDbContextFactory<T>();
24-
2523
return builder;
2624
}
2725
}

ai/Squidex.AI.EntityFramework/EFChatStore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public async Task StoreAsync(string conversationId, Conversation conversation, D
6969
Id = conversationId,
7070
LastUpdated = now,
7171
Version = Guid.NewGuid(),
72-
Value = json
72+
Value = json,
7373
};
7474

7575
await context.Set<EFChatEntity>().AddAsync(entity, ct);

ai/Squidex.AI.Mongo/MongoChatStore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public Task StoreAsync(string conversationId, Conversation conversation, DateTim
6868
.Set(x => x.LastUpdated, now),
6969
new UpdateOptions
7070
{
71-
IsUpsert = true
71+
IsUpsert = true,
7272
},
7373
ct);
7474
}

ai/Squidex.AI.Tests/ChatCleanerTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public async Task Should_delete_conversations()
6464
new[]
6565
{
6666
(conversationId1, conversation1),
67-
(conversationId2, conversation2)
67+
(conversationId2, conversation2),
6868
}.ToAsyncEnumerable());
6969

7070
await sut.CleanupAsync(default);
@@ -91,7 +91,7 @@ public async Task Should_call_tools_conversations()
9191
new[]
9292
{
9393
(conversationId1, conversation1),
94-
(conversationId2, conversation2)
94+
(conversationId2, conversation2),
9595
}.ToAsyncEnumerable());
9696

9797
await sut.CleanupAsync(default);

ai/Squidex.AI.Tests/ChatStoreTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public async Task Should_insert_conversation()
5050
],
5151
ToolData = new Dictionary<string, string>
5252
{
53-
["Key"] = "Value"
54-
}
53+
["Key"] = "Value",
54+
},
5555
};
5656

5757
await sut.StoreAsync(conversationId, conversation, DateTime.UtcNow, default);
@@ -87,8 +87,8 @@ public async Task Should_update_conversation()
8787
],
8888
ToolData = new Dictionary<string, string>
8989
{
90-
["Key"] = "Value"
91-
}
90+
["Key"] = "Value",
91+
},
9292
};
9393

9494
await sut.StoreAsync(conversationId, conversation0, DateTime.UtcNow, default);

ai/Squidex.AI.Tests/DallEPipeTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public async Task Should_create_article_with_image()
6060
SystemMessages =
6161
[
6262
"You are a fiendly agent. Always use the result from the tool if you have called one.",
63-
"When you are asked to generate content such as articles, add placeholders for image, describe and use the following pattern: <IMG>{description}</IMG>. {description} is the generated image description."
63+
"When you are asked to generate content such as articles, add placeholders for image, describe and use the following pattern: <IMG>{description}</IMG>. {description} is the generated image description.",
6464
],
6565
};
6666
})

ai/Squidex.AI.Tests/DallETests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public async Task Should_generate_image()
4141
},
4242
ChatAgent = null!,
4343
Context = new ChatContext(),
44-
ToolData = []
44+
ToolData = [],
4545
};
4646

4747
var result = await sut.ExecuteAsync(ctx, default);
@@ -129,7 +129,7 @@ private static void AssertImageFromTool(ChatResult result)
129129
SystemMessages =
130130
[
131131
"You are a fiendly agent. Always use the result from the tool if you have called one.",
132-
"Say hello to the user."
132+
"Say hello to the user.",
133133
],
134134
};
135135
})

ai/Squidex.AI.Tests/EFChatStoreFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public async Task InitializeAsync()
4343
await postgresSql.StartAsync();
4444

4545
Services = new ServiceCollection()
46-
.AddDbContext<AppDbContext>(b =>
46+
.AddDbContextFactory<AppDbContext>(b =>
4747
{
4848
b.UseNpgsql(postgresSql.GetConnectionString());
4949
})

0 commit comments

Comments
 (0)