You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e91023d
Browse filesBrowse the repository at this point in the historyBrowse files
#pragma warning disable SKEXP0130// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
11
+
12
+
/// <summary>
13
+
/// Demonstrate creation of <see cref="ChatCompletionAgent"/> and
14
+
/// adding whiteboarding capabilities, where the most relevant information from the conversation is captured on a whiteboard.
15
+
/// This is useful for long running conversations where the conversation history may need to be truncated
16
+
/// over time, but you do not want to agent to lose context.
awaitthis.InvokeWithConsoleWriteLine(agent,agentThread,whiteboardBehavior,chatHistoryReducer,"I'd like to create a VM?");
59
+
awaitthis.InvokeWithConsoleWriteLine(agent,agentThread,whiteboardBehavior,chatHistoryReducer,"I want it to have 3 cores.");
60
+
awaitthis.InvokeWithConsoleWriteLine(agent,agentThread,whiteboardBehavior,chatHistoryReducer,"I want it to have 48GB of RAM.");
61
+
awaitthis.InvokeWithConsoleWriteLine(agent,agentThread,whiteboardBehavior,chatHistoryReducer,"I want it to have a 500GB Harddrive.");
62
+
awaitthis.InvokeWithConsoleWriteLine(agent,agentThread,whiteboardBehavior,chatHistoryReducer,"I want it in Europe.");
63
+
awaitthis.InvokeWithConsoleWriteLine(agent,agentThread,whiteboardBehavior,chatHistoryReducer,"Can you make it Linux and call it 'ContosoVM'.");
64
+
awaitthis.InvokeWithConsoleWriteLine(agent,agentThread,whiteboardBehavior,chatHistoryReducer,"OK, let's call it `ContosoFinanceVM_Europe` instead.");
65
+
awaitthis.InvokeWithConsoleWriteLine(agent,agentThread,whiteboardBehavior,chatHistoryReducer,"Thanks, now I want to create another VM.");
66
+
awaitthis.InvokeWithConsoleWriteLine(agent,agentThread,whiteboardBehavior,chatHistoryReducer,"Make all the options the same as the last one, except for the region, which should be North America, and the name, which should be 'ContosoFinanceVM_NorthAmerica'.");
-[ChatCompletion_Rag: Shows how to easily add RAG to an agent](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/Concepts/Agents/ChatCompletion_Rag.cs)
27
27
-[ChatCompletion_Mem0: Shows how to add memory to an agent using mem0](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/Concepts/Agents/ChatCompletion_Mem0.cs)
28
+
-[ChatCompletion_Whiteboard: Shows how to add short term Whiteboarding memory to an agent](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/Concepts/Agents/ChatCompletion_Whiteboard.cs)
28
29
29
30
### AudioToText - Different ways of using [`AudioToText`](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/SemanticKernel.Abstractions/AI/AudioToText/IAudioToTextService.cs) services to extract text from audio
/// Gets or sets the prompt template to use for extracting user facts and merging them with existing facts.
151
+
/// Gets the prompt template to use for maintaining the whiteboard.
135
152
/// </summary>
136
153
privateconststringMaintenancePromptTemplate=
137
154
"""
@@ -143,57 +160,59 @@ Decisions should contain all information about the decision made.
143
160
When a decision is made, the proposals and requirements that led to the decision should be removed from the whiteboard.
144
161
Whiteboard entries should be concise and to the point.
145
162
The whiteboard can contain more than one piece of information for each category.
146
-
The maximum number of messages allowed on the whiteboard at one time is {{$maxWhiteboardMessages}}. Combine messages or remove the least important messages from the list if the maximum number of messages is reached.
163
+
The maximum number of messages allowed on the whiteboard at one time is {{$maxWhiteboardMessages}}.
164
+
Combine messages or remove the least important messages from the list if the maximum number of messages is reached.
165
+
Prioritize keeping detailed decisions for longer than requirements and proposals.
147
166
Categorize whiteboard entries with a prefix of REQUIREMENT, PROPOSAL or DECISION.
148
167
149
168
Here are 7 few shot examples:
150
169
151
170
EXAMPLES START
152
171
153
172
New Message:
154
-
[{"AuthorName":"Mary","Role":"user","Contents":[{"$type":"text","Text":"I want the colour scheme to be green and brown."}]}]
173
+
[{"AuthorName":"Mary","Role":"user","Text":"I want the colour scheme to be green and brown."}]
155
174
Current Whiteboard:
156
175
["REQUIREMENT - Mary wants to create a presentation."]
157
176
New Whiteboard:
158
177
["REQUIREMENT - Mary wants to create a presentation.", "REQUIREMENT - The presentation colour schema should be green and brown."]
159
178
160
179
New Message:
161
-
[{"AuthorName":"John","Role":"user","Contents":[{"$type":"text","Text":"I need you to help me with my homework."}]}]
180
+
[{"AuthorName":"John","Role":"user","Text":"I need you to help me with my homework."}]
[{"AuthorName":"Mary","Role":"user","Contents":[{"$type":"text","Text":"I've changed my mind, I want to go to London instead."}]}]
194
+
[{"AuthorName":"Mary","Role":"user","Text":"I've changed my mind, I want to go to London instead."}]
176
195
Current Whiteboard:
177
196
["REQUIREMENT - Mary wants to book a flight.", "REQUIREMENT - The flight should be to Paris."]
178
197
New Whiteboard:
179
198
["REQUIREMENT - Mary wants to book a flight.", "REQUIREMENT - The flight should be to London."]
180
199
181
200
New Message:
182
-
[{"AuthorName":"TravelAgent","Role":"assistant","Contents":[{"$type":"text","Text":"Here is an itinerary for your trip to Paris. Departing on the 17th of June at 10:00 AM and returning on the 20th of June at 5:00 PM with direct flights to Paris Charles de Gaul airport on NotsocheapoAir. The cost of the flights are EUR 243."}]}]
201
+
[{"AuthorName":"TravelAgent","Role":"assistant","Text":"Here is an itinerary for your trip to Paris. Departing on the 17th of June at 10:00 AM and returning on the 20th of June at 5:00 PM with direct flights to Paris Charles de Gaul airport on NotsocheapoAir. The cost of the flights are EUR 243."}]
183
202
Current Whiteboard:
184
203
["REQUIREMENT - Mary wants to book a flight.", "REQUIREMENT - The flight should be to Paris during the week of 16th of June 2025."]
185
204
New Whiteboard:
186
205
["REQUIREMENT - Mary wants to book a flight.", "REQUIREMENT - The flight should be to Paris during the week of 16th of June 2025.", "PROPOSAL - The current proposed itinerary by the TravelAgent Assistant is to depart on the 17th of June at 10:00 AM and return on the 20th of June at 5:00 PM with direct flights to Paris Charles de Gaul airport on NotsocheapoAir. The cost of the flights are EUR 243."]
187
206
188
207
New Message:
189
-
[{"AuthorName":"Mary","Role":"user","Contents":[{"$type":"text","Text":"That sounds good, let's book that."}]}]
208
+
[{"AuthorName":"Mary","Role":"user","Text":"That sounds good, let's book that."}]
190
209
Current Whiteboard:
191
210
["REQUIREMENT - Mary wants to book a flight.", "REQUIREMENT - The flight should be to Paris during the week of 16th of June 2025.", "PROPOSAL - The current proposed itinerary by the TravelAgent Assistant is to depart on the 17th of June at 10:00 AM and return on the 20th of June at 5:00 PM with direct flights to Paris Charles de Gaul airport on NotsocheapoAir. The cost of the flights are EUR 243."]
192
211
New Whiteboard:
193
212
[""DECISION - Mary decided to book the flight departing on the 17th of June at 10:00 AM and returning on the 20th of June at 5:00 PM with direct flights to Paris Charles de Gaul airport on NotsocheapoAir. The cost of the flights are EUR 243."]
194
213
195
214
New Message:
196
-
[{"AuthorName":"Mary","Role":"user","Contents":[{"$type":"text","Text":"I don't like the suggested option. Can I leave a day earlier and fly with anyone but NotsocheapoAir?"}]}]
215
+
[{"AuthorName":"Mary","Role":"user","Text":"I don't like the suggested option. Can I leave a day earlier and fly with anyone but NotsocheapoAir?"}]
197
216
Current Whiteboard:
198
217
["REQUIREMENT - Mary wants to book a flight.", "REQUIREMENT - The flight should be to Paris during the week of 16th of June 2025.", "PROPOSAL - The current proposed itinerary by the TravelAgent Assistant is to depart on the 17th of June at 10:00 AM and return on the 20th of June at 5:00 PM with direct flights to Paris Charles de Gaul airport on NotsocheapoAir. The cost of the flights are EUR 243."]
199
218
New Whiteboard:
@@ -209,17 +228,30 @@ EXAMPLES END
209
228
{{$currentWhiteboard}}
210
229
New Whiteboard:
211
230
""";
231
+
232
+
/// <summary>
233
+
/// A simple message class that contains just the most basic msessage information
234
+
/// that is required to pass to the LLM.
235
+
/// </summary>
236
+
internalclassBasicMessage
237
+
{
238
+
publicstring?AuthorName{get;set;}
239
+
publicstringRole{get;set;}=string.Empty;
240
+
publicstringText{get;set;}=string.Empty;
241
+
}
212
242
}
213
243
244
+
/// <summary>
245
+
/// Source generated json serializer for <see cref="WhiteboardBehavior"/>.
0 commit comments