Skip to content

Commit d17fa45

Browse files
committed
[#19] Reorganize the FluentApi aproach for ChatContext, AgentContext and ensure validation
1 parent 916bc21 commit d17fa45

File tree

74 files changed

+608
-284
lines changed

Some content is hidden

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

74 files changed

+608
-284
lines changed

Examples/Examples.SimpleConsole/Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using MaIN.Core;
22
using MaIN.Core.Hub;
3-
using MaIN.Domain.Entities;
4-
using OpenAI.Models;
53

64
MaINBootstrapper.Initialize();
75

Examples/Examples/Agents/AgentExample.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using MaIN.Core.Hub;
2-
using MaIN.Core.Hub.Utils;
3-
using MaIN.Domain.Entities.Agents.Knowledge;
42

53
namespace Examples.Agents;
64

Examples/Examples/Agents/AgentWithApiDataSourceExample.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using MaIN.Core.Hub;
22
using MaIN.Core.Hub.Utils;
33
using MaIN.Domain.Entities.Agents.AgentSource;
4-
using MaIN.Services.Services.Models.Commands;
54

65
namespace Examples.Agents;
76

Examples/Examples/Agents/AgentWithKnowledgeFileExample.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
using Examples.Utils;
21
using MaIN.Core.Hub;
32
using MaIN.Core.Hub.Utils;
4-
using MaIN.Domain.Entities.Agents.AgentSource;
5-
using Microsoft.Identity.Client;
63

74
namespace Examples.Agents;
85

Examples/Examples/Agents/AgentWithKnowledgeWebExample.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
using Examples.Utils;
21
using MaIN.Core.Hub;
32
using MaIN.Core.Hub.Utils;
43
using MaIN.Domain.Entities;
5-
using MaIN.Domain.Entities.Agents.AgentSource;
6-
using Microsoft.Identity.Client;
74

85
namespace Examples.Agents;
96

Examples/Examples/Agents/AgentWithWebDataSourceOpenAiExample.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Examples.Utils;
22
using MaIN.Core.Hub;
33
using MaIN.Core.Hub.Utils;
4-
using MaIN.Domain.Configuration;
54
using MaIN.Domain.Entities.Agents.AgentSource;
65

76
namespace Examples.Agents;

Examples/Examples/Agents/MultiBackendAgentsWithRedirectExample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ You need to use a lot of it. Imagine you are the voice of youth.
2626
""";
2727

2828
var contextSecond = await AIHub.Agent()
29-
.WithBackend(BackendType.OpenAi)
3029
.WithModel("gpt-4o")
3130
.WithInitialPrompt(systemPromptSecond)
31+
.WithBackend(BackendType.OpenAi)
3232
.CreateAsync(interactiveResponse: true);
3333

3434
var context = await AIHub.Agent()

Examples/Examples/Chat/ChatCustomGrammarExample.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ public async Task Start()
2121
""", GrammarFormat.GBNF);
2222

2323
await AIHub.Chat()
24+
.WithModel("gemma2:2b")
25+
.WithMessage("Generate random person")
2426
.WithInferenceParams(new InferenceParams
2527
{
2628
Grammar = personGrammar
2729
})
28-
.WithModel("gemma2:2b")
29-
.WithMessage("Generate random person")
3030
.CompleteAsync(interactive: true);
3131
}
3232
}

Examples/Examples/Chat/ChatExampleAnthropic.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Examples.Utils;
22
using MaIN.Core.Hub;
3-
using MaIN.Domain.Configuration;
43

54
namespace Examples.Chat;
65

Examples/Examples/Chat/ChatExampleToolsSimple.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Examples.Utils;
22
using MaIN.Core.Hub;
33
using MaIN.Core.Hub.Utils;
4-
using MaIN.Domain.Configuration;
54

65
namespace Examples.Chat;
76

0 commit comments

Comments
 (0)