MCPcopy
hub / github.com/langroid/langroid / get_value

Function get_value

langroid/utils/pydantic_utils.py:270–276  ·  view source on GitHub ↗
(obj: BaseModel, path: str)

Source from the content-addressed store, hash-verified

268 """
269
270 def get_value(obj: BaseModel, path: str) -> Any | None:
271 for part in path.split("."):
272 if hasattr(obj, part):
273 obj = getattr(obj, part)
274 else:
275 return None
276 return obj
277
278 def traverse(obj: BaseModel, result: Dict[str, Any], prefix: str = "") -> None:
279 for k, v in obj.__dict__.items():

Callers 1

extract_fieldsFunction · 0.85

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…