Add support for URL mode elicitation (#1021)
This commit is contained in:
parent
c447973972
commit
ae17ba0b4b
1 changed files with 1241 additions and 92 deletions
|
|
@ -104,7 +104,19 @@ internal sealed partial class McpClientImpl : McpClient
|
|||
McpJsonUtilities.JsonContext.Default.ElicitResult);
|
||||
|
||||
_options.Capabilities ??= new();
|
||||
_options.Capabilities.Elicitation ??= new();
|
||||
if (_options.Capabilities.Elicitation is null)
|
||||
{
|
||||
// Default to supporting only form mode if not explicitly configured
|
||||
_options.Capabilities.Elicitation = new()
|
||||
{
|
||||
Form = new(),
|
||||
};
|
||||
}
|
||||
else if (_options.Capabilities.Elicitation.Form is null && _options.Capabilities.Elicitation.Url is null)
|
||||
{
|
||||
// If ElicitationCapability is set but both modes are null, default to form mode for backward compatibility
|
||||
_options.Capabilities.Elicitation.Form = new();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue