forked from modelcontextprotocol/csharp-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreateMessageResult.cs
More file actions
53 lines (48 loc) · 1.99 KB
/
CreateMessageResult.cs
File metadata and controls
53 lines (48 loc) · 1.99 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
53
using System.Text.Json.Serialization;
namespace ModelContextProtocol.Protocol;
/// <summary>
/// Represents a client's response to a <see cref="RequestMethods.SamplingCreateMessage"/> from the server.
/// </summary>
/// <remarks>
/// See the <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/">schema</see> for details.
/// </remarks>
public class CreateMessageResult
{
/// <summary>
/// Gets or sets the content of the message.
/// </summary>
[JsonPropertyName("content")]
public required Content Content { get; init; }
/// <summary>
/// Gets or sets the name of the model that generated the message.
/// </summary>
/// <remarks>
/// <para>
/// This should contain the specific model identifier such as "claude-3-5-sonnet-20241022" or "o3-mini".
/// </para>
/// <para>
/// This property allows the server to know which model was used to generate the response,
/// enabling appropriate handling based on the model's capabilities and characteristics.
/// </para>
/// </remarks>
[JsonPropertyName("model")]
public required string Model { get; init; }
/// <summary>
/// Gets or sets the reason why message generation (sampling) stopped, if known.
/// </summary>
/// <remarks>
/// Common values include:
/// <list type="bullet">
/// <item><term>endTurn</term><description>The model naturally completed its response.</description></item>
/// <item><term>maxTokens</term><description>The response was truncated due to reaching token limits.</description></item>
/// <item><term>stopSequence</term><description>A specific stop sequence was encountered during generation.</description></item>
/// </list>
/// </remarks>
[JsonPropertyName("stopReason")]
public string? StopReason { get; init; }
/// <summary>
/// Gets or sets the role of the user who generated the message.
/// </summary>
[JsonPropertyName("role")]
public required Role Role { get; init; }
}