Use JsonElement.Parse for string-to-JsonElement deserialization (#1002)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
This commit is contained in:
parent
9395394c1b
commit
a559bfb891
1 changed files with 48 additions and 48 deletions
|
|
@ -107,7 +107,7 @@ public class Program
|
|||
{
|
||||
Name = "echo",
|
||||
Description = "Echoes the input back to the client.",
|
||||
InputSchema = JsonSerializer.Deserialize<JsonElement>("""
|
||||
InputSchema = JsonElement.Parse("""
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
@ -118,23 +118,23 @@ public class Program
|
|||
},
|
||||
"required": ["message"]
|
||||
}
|
||||
""", McpJsonUtilities.DefaultOptions),
|
||||
"""),
|
||||
},
|
||||
new Tool
|
||||
{
|
||||
Name = "echoSessionId",
|
||||
Description = "Echoes the session id back to the client.",
|
||||
InputSchema = JsonSerializer.Deserialize<JsonElement>("""
|
||||
InputSchema = JsonElement.Parse("""
|
||||
{
|
||||
"type": "object"
|
||||
}
|
||||
""", McpJsonUtilities.DefaultOptions),
|
||||
"""),
|
||||
},
|
||||
new Tool
|
||||
{
|
||||
Name = "sampleLLM",
|
||||
Description = "Samples from an LLM using MCP's sampling feature.",
|
||||
InputSchema = JsonSerializer.Deserialize<JsonElement>("""
|
||||
InputSchema = JsonElement.Parse("""
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
@ -149,7 +149,7 @@ public class Program
|
|||
},
|
||||
"required": ["prompt", "maxTokens"]
|
||||
}
|
||||
""", McpJsonUtilities.DefaultOptions),
|
||||
"""),
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue