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
/// <para>if the message is a <see cref="Message"/> or <see cref="TextMessage"/>, return the content</para>
160
-
/// <para>if the message is a <see cref="ToolCallResultMessage"/> and only contains one function call, return the result of that function call</para>
166
+
/// <para>if the message implements <see cref="ICanGetTextContent"/>, return the content from the message by calling <see cref="ICanGetTextContent.GetContent()"/></para>
161
167
/// <para>if the message is a <see cref="AggregateMessage{ToolCallMessage, ToolCallResultMessage}"/> where TMessage1 is <see cref="ToolCallMessage"/> and TMessage2 is <see cref="ToolCallResultMessage"/> and the second message only contains one function call, return the result of that function call</para>
162
168
/// <para>for all other situation, return null.</para>
163
169
/// </summary>
@@ -166,10 +172,11 @@ public static bool IsSystemMessage(this IMessage message)
AggregateMessage<ToolCallMessage,ToolCallResultMessage>aggregateMessage=>string.Join("\n",aggregateMessage.Message2.ToolCalls.Where(x =>x.Resultis not null).Select(x =>x.Result)),
177
+
#pragma warning disable CS0618// deprecated
178
+
Messagemsg=>msg.Content,
179
+
#pragma warning restore CS0618// deprecated
173
180
_ =>null,
174
181
};
175
182
}
@@ -182,7 +189,9 @@ public static bool IsSystemMessage(this IMessage message)
182
189
returnmessageswitch
183
190
{
184
191
TextMessagetextMessage=>textMessage.Role,
192
+
#pragma warning disable CS0618// deprecated
185
193
Messagemsg=>msg.Role,
194
+
#pragma warning restore CS0618// deprecated
186
195
ImageMessageimg=>img.Role,
187
196
MultiModalMessagemultiModal=>multiModal.Role,
188
197
_ =>null,
@@ -191,8 +200,7 @@ public static bool IsSystemMessage(this IMessage message)
191
200
192
201
/// <summary>
193
202
/// Return the tool calls from the message if it's available.
194
-
/// <para>if the message is a <see cref="ToolCallMessage"/>, return its tool calls</para>
195
-
/// <para>if the message is a <see cref="Message"/> and the function name and function arguments are available, return a list of tool call with one item</para>
203
+
/// <para>if the message implements <see cref="ICanGetToolCalls"/>, return the tool calls from the message by calling <see cref="ICanGetToolCalls.GetToolCalls()"/></para>
196
204
/// <para>if the message is a <see cref="AggregateMessage{ToolCallMessage, ToolCallResultMessage}"/> where TMessage1 is <see cref="ToolCallMessage"/> and TMessage2 is <see cref="ToolCallResultMessage"/>, return the tool calls from the first message</para>
197
205
/// </summary>
198
206
/// <param name="message"></param>
@@ -201,11 +209,13 @@ public static bool IsSystemMessage(this IMessage message)
Copy file name to clipboardExpand all lines: dotnet/src/AutoGen.Core/Message/IMessage.cs
+21-1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
// Copyright (c) Microsoft Corporation. All rights reserved.
2
2
// IMessage.cs
3
3
4
+
usingSystem.Collections.Generic;
5
+
4
6
namespaceAutoGen.Core;
5
7
6
8
/// <summary>
@@ -29,7 +31,7 @@ namespace AutoGen.Core;
29
31
/// <item>
30
32
/// <see cref="AggregateMessage{TMessage1, TMessage2}"/>: an aggregate message type that contains two message types.
31
33
/// This type is useful when you want to combine two message types into one unique message type. One example is when invoking a tool call and you want to return both <see cref="ToolCallMessage"/> and <see cref="ToolCallResultMessage"/>.
32
-
/// One example of how this type is used in AutoGen is <see cref="FunctionCallMiddleware"/>
34
+
/// One example of how this type is used in AutoGen is <see cref="FunctionCallMiddleware"/> and its return message <see cref="ToolCallAggregateMessage"/>
Copy file name to clipboardExpand all lines: dotnet/src/AutoGen.Core/Message/Message.cs
+2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,12 @@
1
1
// Copyright (c) Microsoft Corporation. All rights reserved.
2
2
// Message.cs
3
3
4
+
usingSystem;
4
5
usingSystem.Collections.Generic;
5
6
6
7
namespaceAutoGen.Core;
7
8
9
+
[Obsolete("This message class is deprecated, please use a specific AutoGen built-in message type instead. For more information, please visit https://microsoft.github.io/autogen-for-net/articles/Built-in-messages.html")]
// Copyright (c) Microsoft Corporation. All rights reserved.
2
+
// FunctionCallAggregateMessage.cs
3
+
4
+
usingSystem.Collections.Generic;
5
+
6
+
namespaceAutoGen.Core;
7
+
8
+
/// <summary>
9
+
/// An aggregate message that contains a tool call message and a tool call result message.
10
+
/// This message type is used by <see cref="FunctionCallMiddleware"/> to return both <see cref="ToolCallMessage"/> and <see cref="ToolCallResultMessage"/>.
0 commit comments