MCPcopy
hub / github.com/LazyAGI/LazyLLM / _extract_roi_impl

Method _extract_roi_impl

lazyllm/tools/tools/json.py:214–221  ·  view source on GitHub ↗
(item: Dict[str, Any], roi: str)

Source from the content-addressed store, hash-verified

212 raise ValueError('base_model must be provided for distinct mode.')
213
214 def _extract_roi_impl(item: Dict[str, Any], roi: str) -> Any:
215 try:
216 result = item
217 for k in roi.split('.'):
218 result = result.get(k, '')
219 return result if isinstance(result, str) else json.dumps(result, ensure_ascii=False)
220 except Exception:
221 return ''
222
223 def extract_roi(item: Dict[str, Any], rois: List[str]) -> str:
224 if not rois:

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected