Skip to content

Commit 6c3c8d8

Browse files
author
Piotr Stachaczynski
committed
refactor: resolved pr comments
1 parent c9e0a91 commit 6c3c8d8

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

src/MaIN.Core/Hub/Utils/StepBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public StepBuilder Redirect(string agentId, string output = "AS_Output", string
3535
return this;
3636
}
3737

38-
public List<string>? Build()
38+
public List<string> Build()
3939
{
4040
return Steps;
4141
}

src/MaIN.Domain/Entities/Agents/Agent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public class Agent
44
{
55
public required string Id { get; set; }
66
public string Name { get; set; } = null!;
7-
public string? Model { get; set; } = null!;
7+
public string? Model { get; set; }
88
public string? Description { get; init; }
99
public bool Started { get; set; }
1010
public bool Flow { get; set; }

src/MaIN.Domain/Entities/Chat.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ namespace MaIN.Domain.Entities;
22

33
public class Chat
44
{
5-
public string? Id { get; init; } = null!;
6-
public string? Name { get; init; } = null!;
7-
public string? Model { get; set; } = null!;
5+
public string Id { get; init; } = null!;
6+
public string? Name { get; init; }
7+
public string? Model { get; set; }
88
public List<Message> Messages { get; set; } = [];
99
public ChatType Type { get; set; } = ChatType.Conversation;
10-
public bool Visual { get; set; } = false;
10+
public bool Visual { get; set; }
1111
public InferenceParams InterferenceParams { get; set; } = new();
1212
public Dictionary<string, string>? Properties { get; init; } = [];
1313
public List<string> Memory { get; } = [];

src/MaIN.Infrastructure/Repositories/FileSystem/FileSystemAgentFlowRepository.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace MaIN.Infrastructure.Repositories.FileSystem;
77
public class FileSystemAgentFlowRepository : IAgentFlowRepository
88
{
99
private readonly string _directoryPath;
10-
private static readonly JsonSerializerOptions? _jsonOptions = new() { WriteIndented = true };
10+
private static readonly JsonSerializerOptions? JsonOptions = new() { WriteIndented = true };
1111

1212
public FileSystemAgentFlowRepository(string basePath)
1313
{
@@ -47,7 +47,7 @@ public async Task AddFlow(AgentFlowDocument flow)
4747
if (File.Exists(filePath))
4848
throw new InvalidOperationException($"Flow with ID {flow.Id} already exists.");
4949

50-
var json = JsonSerializer.Serialize(flow, _jsonOptions);
50+
var json = JsonSerializer.Serialize(flow, JsonOptions);
5151
await File.WriteAllTextAsync(filePath, json);
5252
}
5353

@@ -57,7 +57,7 @@ public async Task UpdateFlow(string id, AgentFlowDocument flow)
5757
if (!File.Exists(filePath))
5858
throw new KeyNotFoundException($"Flow with ID {id} not found.");
5959

60-
var json = JsonSerializer.Serialize(flow, _jsonOptions);
60+
var json = JsonSerializer.Serialize(flow, JsonOptions);
6161
await File.WriteAllTextAsync(filePath, json);
6262
}
6363

src/MaIN.Infrastructure/Repositories/FileSystem/FileSystemAgentRepository.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace MaIN.Infrastructure.Repositories.FileSystem;
77
public class FileSystemAgentRepository : IAgentRepository
88
{
99
private readonly string _directoryPath;
10-
private static readonly JsonSerializerOptions? _jsonOptions = new() { WriteIndented = true };
10+
private static readonly JsonSerializerOptions? JsonOptions = new() { WriteIndented = true };
1111

1212
public FileSystemAgentRepository(string basePath)
1313
{
@@ -50,7 +50,7 @@ public async Task AddAgent(AgentDocument agent)
5050
if (File.Exists(filePath))
5151
throw new InvalidOperationException($"Agent with ID {agent.Id} already exists.");
5252

53-
var json = JsonSerializer.Serialize(agent, _jsonOptions);
53+
var json = JsonSerializer.Serialize(agent, JsonOptions);
5454
await File.WriteAllTextAsync(filePath, json);
5555
}
5656

@@ -60,7 +60,7 @@ public async Task UpdateAgent(string id, AgentDocument agent)
6060
if (!File.Exists(filePath))
6161
throw new KeyNotFoundException($"Agent with ID {id} not found.");
6262

63-
var json = JsonSerializer.Serialize(agent, _jsonOptions);
63+
var json = JsonSerializer.Serialize(agent, JsonOptions);
6464
await File.WriteAllTextAsync(filePath, json);
6565
}
6666

src/MaIN.Infrastructure/Repositories/FileSystem/FileSystemChatRepository.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace MaIN.Infrastructure.Repositories.FileSystem;
77
public class FileSystemChatRepository : IChatRepository
88
{
99
private readonly string _directoryPath;
10-
private static readonly JsonSerializerOptions? _jsonOptions = new() { WriteIndented = true };
10+
private static readonly JsonSerializerOptions? JsonOptions = new() { WriteIndented = true };
1111

1212
public FileSystemChatRepository(string basePath)
1313
{
@@ -47,7 +47,7 @@ public async Task AddChat(ChatDocument chat)
4747
if (File.Exists(filePath))
4848
throw new InvalidOperationException($"Chat with ID {chat.Id} already exists.");
4949

50-
var json = JsonSerializer.Serialize(chat, _jsonOptions);
50+
var json = JsonSerializer.Serialize(chat, JsonOptions);
5151
await File.WriteAllTextAsync(filePath, json);
5252
}
5353

@@ -57,7 +57,7 @@ public async Task UpdateChat(string? id, ChatDocument chat)
5757
if (!File.Exists(filePath))
5858
throw new KeyNotFoundException($"Chat with ID {id} not found.");
5959

60-
var json = JsonSerializer.Serialize(chat, _jsonOptions);
60+
var json = JsonSerializer.Serialize(chat, JsonOptions);
6161
await File.WriteAllTextAsync(filePath, json);
6262
}
6363

0 commit comments

Comments
 (0)