forked from modelcontextprotocol/csharp-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConformancePrompts.cs
More file actions
67 lines (61 loc) · 2.41 KB
/
ConformancePrompts.cs
File metadata and controls
67 lines (61 loc) · 2.41 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using ModelContextProtocol.Server;
using ModelContextProtocol.Protocol;
using Microsoft.Extensions.AI;
using System.ComponentModel;
namespace ConformanceServer.Prompts;
public class ConformancePrompts
{
// Sample base64 encoded 1x1 red PNG pixel for testing
private const string TestImageBase64 =
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8DwHwAFBQIAX8jx0gAAAABJRU5ErkJggg==";
[McpServerPrompt(Name = "test_simple_prompt"), Description("Simple prompt without arguments")]
public static string SimplePrompt() => "This is a simple prompt without arguments";
[McpServerPrompt(Name = "test_prompt_with_arguments"), Description("Parameterized prompt")]
public static string ParameterizedPrompt(
[Description("First test argument")] string arg1,
[Description("Second test argument")] string arg2)
{
return $"Prompt with arguments: arg1={arg1}, arg2={arg2}";
}
[McpServerPrompt(Name = "test_prompt_with_embedded_resource"), Description("Prompt with embedded resource")]
public static IEnumerable<PromptMessage> PromptWithEmbeddedResource(
[Description("URI of the resource to embed")] string resourceUri)
{
return [
new PromptMessage
{
Role = Role.User,
Content = new EmbeddedResourceBlock
{
Resource = new TextResourceContents
{
Uri = resourceUri,
Text = "Embedded resource content for testing.",
MimeType = "text/plain"
}
}
},
new PromptMessage { Role = Role.User, Content = new TextContentBlock { Text = "Please process the embedded resource above." } },
];
}
[McpServerPrompt(Name = "test_prompt_with_image"), Description("Prompt with image")]
public static IEnumerable<PromptMessage> PromptWithImage()
{
return [
new PromptMessage
{
Role = Role.User,
Content = new ImageContentBlock
{
MimeType = "image/png",
Data = TestImageBase64
}
},
new PromptMessage
{
Role = Role.User,
Content = new TextContentBlock { Text = "Please analyze the image above." }
},
];
}
}