Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ClientCapabilities.cs
2
4{
8 public class ClientCapabilities
9 {
13 public Dictionary<string, object>? Experimental { get; internal set; }
14
18 public RootsCapabilities? Roots { get; internal set; }
19
23 public SamplingCapabilities? Sampling { get; internal set; }
24
28 public ElicitationCapabilities? Elicitation { get; internal set; }
29
33 public TasksCapabilities? Tasks { get; internal set; }
34
41 public static bool TryParse(Dictionary<string, object> Generic,
42 out ClientCapabilities Typed)
43 {
45
46 if (Generic.TryGetValue("experimental", out object? Obj) &&
47 Obj is Dictionary<string, object> Experimental)
48 {
49 Result.Experimental = Experimental;
50 }
51
52 if (Generic.TryGetValue("roots", out Obj) &&
53 Obj is Dictionary<string, object> Roots &&
55 {
56 Result.Roots = RootsParsed;
57 }
58
59 if (Generic.TryGetValue("sampling", out Obj) &&
60 Obj is Dictionary<string, object> Sampling &&
62 {
63 Result.Sampling = SamplingParsed;
64 }
65
66 if (Generic.TryGetValue("elicitation", out Obj) &&
67 Obj is Dictionary<string, object> Elicitation &&
69 {
70 Result.Elicitation = ElicitationParsed;
71 }
72
73 if (Generic.TryGetValue("tasks", out Obj) &&
74 Obj is Dictionary<string, object> Tasks &&
76 {
77 Result.Tasks = TasksParsed;
78 }
79
80 Typed = Result;
81 return true;
82 }
83 }
84}
SamplingCapabilities? Sampling
Present if the client supports sampling from an LLM.
static bool TryParse(Dictionary< string, object > Generic, out ClientCapabilities Typed)
Tries to parse a generic structure into a typed structure.
ElicitationCapabilities? Elicitation
Present if the client supports elicitation from the server.
Dictionary< string, object >? Experimental
Experimental, non-standard capabilities that the client supports.
RootsCapabilities? Roots
Present if the client supports listing roots.
TasksCapabilities? Tasks
Present if the client supports task-augmented requests.
static bool TryParse(Dictionary< string, object > Generic, out ElicitationCapabilities Typed)
Tries to parse a generic structure into a typed structure.
static bool TryParse(Dictionary< string, object > Generic, out RootsCapabilities Typed)
Tries to parse a generic structure into a typed structure.
static bool TryParse(Dictionary< string, object > Generic, out SamplingCapabilities Typed)
Tries to parse a generic structure into a typed structure.
static bool TryParse(Dictionary< string, object > Generic, out TasksCapabilities Typed)
Tries to parse a generic structure into a typed structure.