MCPcopy
hub / github.com/langroid/langroid / add

Method add

langroid/utils/object_registry.py:27–31  ·  view source on GitHub ↗

Adds an object to the registry, returning the object's ID.

(cls, obj: ObjWithId)

Source from the content-addressed store, hash-verified

25
26 @classmethod
27 def add(cls, obj: ObjWithId) -> str:
28 """Adds an object to the registry, returning the object's ID."""
29 object_id = obj.id() if callable(obj.id) else obj.id
30 cls.registry[object_id] = obj
31 return object_id
32
33 @classmethod
34 def get(cls, obj_id: str) -> Optional[ObjWithId]:

Callers 15

git_commit_fileFunction · 0.45
git_commit_modsFunction · 0.45
register_objectMethod · 0.45
_normalize_model_namesFunction · 0.45
_warn_unknown_modelFunction · 0.45
_store_clientFunction · 0.45
get_openai_clientFunction · 0.45
get_async_openai_clientFunction · 0.45
__init__Method · 0.45
parse_number_range_listFunction · 0.45
parse_itemMethod · 0.45

Calls 1

idMethod · 0.80

Tested by

no test coverage detected