Skip to content

Commit 503c740

Browse files
authored
Merge pull request #17 from devgopher/release/0.8
Release/0.8
2 parents 44a628c + 2561427 commit 503c740

File tree

409 files changed

+4243
-6191
lines changed

Some content is hidden

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

409 files changed

+4243
-6191
lines changed

.idea/.idea.Botticelli/.idea/vcs.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Botticelli.AI.ChatGpt/Provider/ChatGptProvider.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected override async Task ProcessGptResponse(AiMessage message,
5454
text.AppendJoin(' ',
5555
part?.Choices?
5656
.Select(c => (c.Message ?? c.Delta)?.Content) ??
57-
Array.Empty<string>());
57+
[]);
5858

5959
var responseMessage = new SendMessageResponse(message.Uid)
6060
{
@@ -99,14 +99,14 @@ protected override async Task<HttpResponseMessage> GetGptResponse(AiMessage mess
9999
var content = JsonContent.Create(new ChatGptInputMessage
100100
{
101101
Model = Settings.Value.Model,
102-
Messages = new List<ChatGptMessage>
103-
{
102+
Messages =
103+
[
104104
new()
105105
{
106106
Role = "user",
107107
Content = message.Body
108108
}
109-
},
109+
],
110110
Temperature = Settings.Value.Temperature,
111111
Stream = Settings.Value.StreamGeneration
112112
});

Botticelli.AI.DeepSeekGpt/Extensions/ServiceCollectionExtensions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ public static IServiceCollection AddDeepSeekProvider(this IServiceCollection ser
3333
s.Instruction = deepSeekGptSettings.Instruction;
3434
});
3535

36-
services.AddSingleton<IAiProvider, DeepSeekGptProvider>();
36+
services.AddSingleton<IAiProvider, DeepSeekGptProvider>()
37+
.AddHttpClient();
3738

3839
return services;
3940
}

Botticelli.AI.DeepSeekGpt/Provider/DeepSeekGptProvider.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,20 @@ protected override async Task<HttpResponseMessage> GetGptResponse(AiMessage mess
6767
{
6868
Model = Settings.Value.Model,
6969
MaxTokens = Settings.Value.MaxTokens,
70-
Messages = new List<DeepSeekInnerInputMessage>
71-
{
70+
Messages =
71+
[
7272
new()
7373
{
7474
Role = SystemRole,
7575
Content = Settings.Value.Instruction
7676
},
77+
7778
new()
7879
{
7980
Role = UserRole,
8081
Content = message.Body
8182
}
82-
}
83+
]
8384
};
8485

8586
deepSeekGptMessage.Messages.AddRange(message.AdditionalMessages?.Select(m => new DeepSeekInnerInputMessage
@@ -91,7 +92,7 @@ protected override async Task<HttpResponseMessage> GetGptResponse(AiMessage mess
9192

9293
var content = JsonContent.Create(deepSeekGptMessage);
9394

94-
Logger.LogDebug($"{nameof(SendAsync)}({message.ChatIds}) content: {content.Value}");
95+
Logger.LogDebug("{SendAsyncName}({MessageChatIds}) content: {ContentValue}", nameof(SendAsync), message.ChatIds, content.Value);
9596

9697
return await client.PostAsync(Completion,
9798
content,

Botticelli.AI.GptJ/Provider/GptJProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected override async Task<HttpResponseMessage> GetGptResponse(AiMessage mess
7171
Temperature = Settings.Value.Temperature
7272
});
7373

74-
Logger.LogDebug($"{nameof(SendAsync)}({message.ChatIds}) content: {content.Value}");
74+
Logger.LogDebug("{SendAsyncName}({MessageChatIds}) content: {ContentValue}", nameof(SendAsync), message.ChatIds, content.Value);
7575

7676
return await client.PostAsync(Url.Combine($"{Settings.Value.Url}", "generate"),
7777
content,

Botticelli.AI.Test/AIProvider/BaseAiProviderTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
using FluentAssertions;
1313
using FluentValidation;
1414
using NUnit.Framework;
15-
using Shared;
15+
using Mocks;
1616
using WireMock.Server;
1717

1818
namespace Botticelli.AI.Test.AIProvider;

Botticelli.AI.Test/AIProvider/ChatGptProviderTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using Botticelli.AI.ChatGpt.Provider;
66
using Botticelli.AI.ChatGpt.Settings;
77
using NUnit.Framework;
8-
using Shared;
8+
using Mocks;
99
using WireMock.RequestBuilders;
1010
using WireMock.ResponseBuilders;
1111
using Usage = Botticelli.AI.ChatGpt.Message.ChatGpt.Usage;

Botticelli.AI.Test/AIProvider/DeepSeekGptProviderTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using Botticelli.AI.DeepSeekGpt.Provider;
66
using Botticelli.AI.DeepSeekGpt.Settings;
77
using NUnit.Framework;
8-
using Shared;
8+
using Mocks;
99
using WireMock.RequestBuilders;
1010
using WireMock.ResponseBuilders;
1111
using Usage = Botticelli.AI.DeepSeekGpt.Message.DeepSeek.Usage;

Botticelli.AI.Test/AIProvider/YaGptProviderTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using Botticelli.AI.YaGpt.Provider;
55
using Botticelli.AI.YaGpt.Settings;
66
using NUnit.Framework;
7-
using Shared;
7+
using Mocks;
88
using WireMock.RequestBuilders;
99
using WireMock.ResponseBuilders;
1010

Botticelli.AI.Test/Botticelli.AI.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<ProjectReference Include="..\Botticelli.AI.DeepSeekGpt\Botticelli.AI.DeepSeekGpt.csproj"/>
2525
<ProjectReference Include="..\Botticelli.AI.YaGpt\Botticelli.AI.YaGpt.csproj"/>
2626
<ProjectReference Include="..\Botticelli.AI\Botticelli.AI.csproj"/>
27-
<ProjectReference Include="..\Tests\Shared\Shared.csproj"/>
27+
<ProjectReference Include="..\Tests\Mocks\Mocks.csproj" />
2828
</ItemGroup>
2929

3030
</Project>

0 commit comments

Comments
 (0)