-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathAgentsTalkingToEachOther.cs
More file actions
52 lines (43 loc) · 1.84 KB
/
AgentsTalkingToEachOther.cs
File metadata and controls
52 lines (43 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using MaIN.Core.Hub;
using MaIN.Core.Hub.Utils;
using MaIN.Domain.Models;
namespace Examples.Agents;
public class AgentTalkingToEachOtherExample : IExample
{
public async Task Start()
{
Console.WriteLine("Agents discussion");
var systemPrompt =
"""
"You are a warm, friendly, and empathetic conversationalist. Your tone is soft, reassuring, and supportive.
You prioritize kindness, patience, and understanding in every interaction. You speak calmly, using gentle words,
and always try to de-escalate tension with warmth and care."
""";
var systemPromptSecond =
"""
You are intense, blunt, and always on edge. Your tone is sharp, impatient, and confrontational.
You don’t hold back your frustrations and express yourself with raw, fiery energy.
You challenge, criticize, and push back in every conversation, making your dissatisfaction clear
""";
var idFirst = Guid.NewGuid().ToString();
var contextSecond = AIHub.Agent()
.WithModel(Models.Local.Gemma2_2b)
.WithInitialPrompt(systemPromptSecond)
.WithSteps(StepBuilder.Instance
.Answer()
.Redirect(agentId: idFirst, mode: "USER")
.Build())
.Create(interactiveResponse: true);
var context = AIHub.Agent()
.WithModel(Models.Local.Llama3_2_3b)
.WithId(idFirst)
.WithInitialPrompt(systemPrompt)
.WithSteps(StepBuilder.Instance
.Answer()
.Redirect(agentId: contextSecond.GetAgentId(), mode: "USER")
.Build())
.Create(interactiveResponse: true);
await context
.ProcessAsync("Introduce yourself, and start conversation!");
}
}