Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
PromptMessage.cs
3
5{
9 public class PromptMessage
10 {
17 {
18 this.Role = Role;
19 this.Content = Content;
20
21 if (Content is Dictionary<string, object> Encoded)
22 {
23 this.Encoded = Encoded;
24 this.IsEncoded = true;
25 }
26 else
27 {
28 this.Encoded = null;
29 this.IsEncoded = false;
30 }
31 }
32
38 public PromptMessage(McpRole Role, Dictionary<string, object> Content)
39 {
40 this.Role = Role;
41 this.Content = Content;
42 this.Encoded = Content;
43 this.IsEncoded = true;
44 }
45
49 [McpParameter("Role", "Role of recipient of message.")]
50 [McpEnumValue(McpRole.Assistant, "Message is for the assistant.")]
51 [McpEnumValue(McpRole.User, "Message is from the user.")]
52 public McpRole Role { get; }
53
57 [McpParameter("Content", "Content of message.")]
58 public object Content { get; }
59
63 [McpParameter("IsEncoded", "If the content has been encoded.")]
64 public bool IsEncoded { get; }
65
69 [McpParameter("Encoded", "Encoded content.")]
70 public Dictionary<string, object>? Encoded { get; }
71 }
72}
Describes a message returned as part of a prompt.
Dictionary< string, object >? Encoded
Encoded content.
PromptMessage(McpRole Role, object Content)
Describes a message returned as part of a prompt.
McpRole Role
Role of recipient of message.
bool IsEncoded
If the content has been encoded.
PromptMessage(McpRole Role, Dictionary< string, object > Content)
Describes a message returned as part of a prompt.
McpRole
Identifies a Role in a Model Context Protocol (MCP) context.
Definition: McpRole.cs:7