MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / get_bundle_handler

Function get_bundle_handler

plugin/app/cache/bundle_handler.py:24–45  ·  view source on GitHub ↗

Get the bundle handler for the given bundle id and plugin id. :param bundle_id: bundle id. :return: the plugin.

(bundle_id: str)

Source from the content-addressed store, hash-verified

22
23
24def get_bundle_handler(bundle_id: str):
25
26 """
27 Get the bundle handler for the given bundle id and plugin id.
28 :param bundle_id: bundle id.
29 :return: the plugin.
30 """
31 if __bundle_handlers.get(bundle_id):
32 return __bundle_handlers[bundle_id]
33
34 if bundle_id not in __bundle_handlers:
35 __bundle_handlers[bundle_id] = {}
36
37 try:
38 # Get the corresponding plugin class
39 model_class = __load_bundle_handler_class(bundle_id)
40 # Instantiate the model class
41 __bundle_handlers[bundle_id] = model_class()
42 except (ImportError, AttributeError):
43 raise Exception(f"get_bundle_handler: error loading bundle_handler of {bundle_id}")
44
45 return __bundle_handlers[bundle_id]
46
47
48# Automatically search and import all providers

Callers 2

api_verify_credentialsFunction · 0.90
load_all_bundle_handlersFunction · 0.85

Calls 2

getMethod · 0.45

Tested by

no test coverage detected