Merge pull request #22 from koic/fix_incorrect_capabilities_handling_for_completion_complete
Fix incorrect capabilities handling for `completion/complete`
This commit is contained in:
commit
6b49222edb
2 changed files with 13 additions and 1 deletions
|
|
@ -36,7 +36,7 @@ module ModelContextProtocol
|
|||
|
||||
def ensure_capability!(method, capabilities)
|
||||
case method
|
||||
when PROMPTS_GET, PROMPTS_LIST, COMPLETION_COMPLETE
|
||||
when PROMPTS_GET, PROMPTS_LIST
|
||||
unless capabilities[:prompts]
|
||||
raise MissingRequiredCapabilityError.new(method, :prompts)
|
||||
end
|
||||
|
|
@ -56,6 +56,10 @@ module ModelContextProtocol
|
|||
unless capabilities[:sampling]
|
||||
raise MissingRequiredCapabilityError.new(method, :sampling)
|
||||
end
|
||||
when COMPLETION_COMPLETE
|
||||
unless capabilities[:completions]
|
||||
raise MissingRequiredCapabilityError.new(method, :completions)
|
||||
end
|
||||
when LOGGING_SET_LEVEL
|
||||
# Logging is unsupported by the Server
|
||||
unless capabilities[:logging]
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ module ModelContextProtocol
|
|||
# No op handlers for currently unsupported methods
|
||||
Methods::RESOURCES_SUBSCRIBE => ->(_) {},
|
||||
Methods::RESOURCES_UNSUBSCRIBE => ->(_) {},
|
||||
Methods::COMPLETION_COMPLETE => ->(_) {},
|
||||
Methods::LOGGING_SET_LEVEL => ->(_) {},
|
||||
}
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue