Skip to content

Commit ffcb51d

Browse files
Merge pull request #13 from wisedev-code/feat/infer-command-chat-and-improvements
Feat/infer command chat and improvements
2 parents 376a9ff + 6c3c8d8 commit ffcb51d

File tree

125 files changed

+1748
-708
lines changed

Some content is hidden

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

125 files changed

+1748
-708
lines changed

Examples/Examples/Chat/ChatWithImageGenExample.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
using Examples.Utils;
22
using MaIN.Core.Hub;
3-
using SixLabors.ImageSharp;
4-
using SixLabors.ImageSharp.PixelFormats;
5-
using SixLabors.ImageSharp.Processing;
63

74
namespace Examples;
85

Examples/Examples/Chat/ChatWithImageGenOpenAiExample.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
using Examples.Utils;
22
using MaIN.Core.Hub;
3-
using SixLabors.ImageSharp;
4-
using SixLabors.ImageSharp.PixelFormats;
5-
using SixLabors.ImageSharp.Processing;
63

74
namespace Examples;
85

Examples/Examples/Examples.csproj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,4 @@
3838
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
3939
</None>
4040
</ItemGroup>
41-
42-
<ItemGroup>
43-
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.6" />
44-
</ItemGroup>
45-
4641
</Project>

Examples/Examples/Program.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Examples.Agents;
33
using Examples.Agents.Flows;
44
using MaIN.Core;
5-
using MaIN.Domain.Configuration;
65
using Microsoft.Extensions.Configuration;
76
using Microsoft.Extensions.DependencyInjection;
87

@@ -29,11 +28,7 @@
2928

3029
var services = new ServiceCollection();
3130
services.AddSingleton<IConfiguration>(configuration);
32-
services.AddMaIN(configuration, (options) =>
33-
{
34-
options.BackendType = BackendType.OpenAi;
35-
options.OpenAiKey = "<YOUR_OPENAI_KEY>";
36-
});
31+
services.AddMaIN(configuration);
3732

3833
RegisterExamples(services);
3934

Examples/Examples/Utils/ConsoleRenderer.cs

Lines changed: 0 additions & 65 deletions
This file was deleted.

Examples/Examples/Utils/ImagePreviewer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Examples.Utils;
99

1010
public static class ImagePreview
1111
{
12-
public static void ShowImage(byte[] imageData, string extension = "png")
12+
public static void ShowImage(byte[]? imageData, string extension = "png")
1313
{
1414
// Validate extension
1515
if (string.IsNullOrWhiteSpace(extension) || extension.Contains("."))
@@ -21,7 +21,7 @@ public static void ShowImage(byte[] imageData, string extension = "png")
2121
$"{Guid.NewGuid()}.{extension}"
2222
);
2323

24-
File.WriteAllBytes(tempFile, imageData);
24+
File.WriteAllBytes(tempFile, imageData!);
2525

2626
try
2727
{

MaIN.Server/Program.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using MaIN.Domain.Entities;
22
using MaIN.Services;
3+
using MaIN.Services.Services.Abstract;
34
using Microsoft.AspNetCore.Mvc;
45
using Microsoft.OpenApi.Models;
56

@@ -45,7 +46,7 @@
4546
return Results.Ok(models);
4647
});
4748

48-
app.MapDelete("/api/llm/session/{chatId}", async ([FromServices] ILLMService llmService, string chatId) =>
49+
app.MapDelete("/api/llm/session/{chatId}", async ([FromServices] ILLMService llmService, string? chatId) =>
4950
{
5051
await llmService.CleanSessionCache(chatId);
5152
return Results.Ok($"Session chat {chatId} has been cleared.");
@@ -66,6 +67,6 @@
6667
app.Run();
6768

6869
// Request DTOs
69-
record ChatRequest(Chat? Chat, bool InteractiveUpdates = false, bool NewSession = false);
70+
record ChatRequest(Chat Chat, bool InteractiveUpdates = false, bool NewSession = false);
7071

71-
record AskMemoryRequest(Chat? Chat, Dictionary<string,string>? TextData = null, Dictionary<string,string>? FileData = null, List<string>? Memory = null);
72+
record AskMemoryRequest(Chat Chat, Dictionary<string,string>? TextData = null, Dictionary<string,string>? FileData = null, List<string>? Memory = null);

MaIN.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MaIN.Core.UnitTests", "src\
2424
EndProject
2525
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Examples.SimpleConsole", "Examples\Examples.SimpleConsole\Examples.SimpleConsole.csproj", "{75DEBB8A-75CD-44BA-9369-3916950428EF}"
2626
EndProject
27+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MaIN.InferPage", "src\MaIN.InferPage\MaIN.InferPage.csproj", "{B691188A-1170-489D-8729-A13108C12C57}"
28+
EndProject
2729
Global
2830
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2931
Debug|Any CPU = Debug|Any CPU
@@ -70,6 +72,10 @@ Global
7072
{75DEBB8A-75CD-44BA-9369-3916950428EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
7173
{75DEBB8A-75CD-44BA-9369-3916950428EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
7274
{75DEBB8A-75CD-44BA-9369-3916950428EF}.Release|Any CPU.Build.0 = Release|Any CPU
75+
{B691188A-1170-489D-8729-A13108C12C57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
76+
{B691188A-1170-489D-8729-A13108C12C57}.Debug|Any CPU.Build.0 = Debug|Any CPU
77+
{B691188A-1170-489D-8729-A13108C12C57}.Release|Any CPU.ActiveCfg = Release|Any CPU
78+
{B691188A-1170-489D-8729-A13108C12C57}.Release|Any CPU.Build.0 = Release|Any CPU
7379
EndGlobalSection
7480
GlobalSection(NestedProjects) = preSolution
7581
{781BDD20-65BA-4C5D-815B-D8A15931570A} = {28851935-517F-438D-BF7C-02FEB1A37A68}

Releases/0.0.8-pre.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# 0.0.8 pre-release
2+
3+
- Project cleanup
4+
- New version of CLI (introduced infer and config commands)
5+
- name of model **breaking change**
6+
7+
In order to align with new breaking change, align your already downloaded models to this names (and ofc .gguf extension)
8+
-- DeepSeekR1-8b
9+
-- Fox-1.6b
10+
-- gemma2-2b
11+
-- Llama3.1-8b
12+
-- Llama3.2-3b
13+
-- Llava
14+
-- Nomic
15+
-- phi3.5
16+
-- Qwen2.5

0 commit comments

Comments
 (0)