forked from modelcontextprotocol/csharp-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGetPromptResult.cs
More file actions
42 lines (39 loc) · 1.57 KB
/
GetPromptResult.cs
File metadata and controls
42 lines (39 loc) · 1.57 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
using Microsoft.Extensions.AI;
using System.Text.Json.Serialization;
namespace ModelContextProtocol.Protocol;
/// <summary>
/// Represents a server's response to a <see cref="RequestMethods.PromptsGet"/> request from the client.
/// </summary>
/// <remarks>
/// <para>
/// For integration with AI client libraries, <see cref="GetPromptResult"/> can be converted to
/// a collection of <see cref="ChatMessage"/> objects using the <see cref="AIContentExtensions.ToChatMessages"/> extension method.
/// </para>
/// <para>
/// See the <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/">schema</see> for details.
/// </para>
/// </remarks>
public class GetPromptResult
{
/// <summary>
/// Gets or sets an optional description for the prompt.
/// </summary>
/// <remarks>
/// <para>
/// This description provides contextual information about the prompt's purpose and use cases.
/// It helps developers understand what the prompt is designed for and how it should be used.
/// </para>
/// <para>
/// When returned from a server in response to a <see cref="RequestMethods.PromptsGet"/> request,
/// this description can be used by client applications to provide context about the prompt or to
/// display in user interfaces.
/// </para>
/// </remarks>
[JsonPropertyName("description")]
public string? Description { get; set; }
/// <summary>
/// Gets or sets the prompt that the server offers.
/// </summary>
[JsonPropertyName("messages")]
public List<PromptMessage> Messages { get; set; } = [];
}