Internal Release 0.5.2
Added - Added stdio transport functionality. Changed - Added stdio details to the README.
This commit is contained in:
parent
d2b6a33788
commit
6da8bfab1a
1 changed files with 289 additions and 3 deletions
|
|
@ -28,7 +28,7 @@ module ModelContextProtocol
|
|||
@tools = tools.to_h { |t| [t.name_value, t] }
|
||||
@prompts = prompts.to_h { |p| [p.name_value, p] }
|
||||
@resources = resources
|
||||
@resource_index = resources.index_by(&:uri)
|
||||
@resource_index = index_resources_by_uri(resources)
|
||||
@context = context
|
||||
@configuration = ModelContextProtocol.configuration.merge(configuration)
|
||||
@handlers = {
|
||||
|
|
@ -205,5 +205,11 @@ module ModelContextProtocol
|
|||
def report_exception(exception, context = {})
|
||||
configuration.exception_reporter.call(exception, context)
|
||||
end
|
||||
|
||||
def index_resources_by_uri(resources)
|
||||
resources.each_with_object({}) do |resource, hash|
|
||||
hash[resource.uri] = resource
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue