MCPcopy Index your code
hub / github.com/OpenBMB/ChatDev / _unwrap_annotation

Function _unwrap_annotation

utils/function_catalog.py:228–237  ·  view source on GitHub ↗
(annotation: Any)

Source from the content-addressed store, hash-verified

226
227
228def _unwrap_annotation(annotation: Any) -> Tuple[Any, ParamMeta | None]:
229 origin = get_origin(annotation)
230 if origin is Annotated:
231 args = get_args(annotation)
232 if not args:
233 return annotation, None
234 base = args[0]
235 meta = next((arg for arg in args[1:] if isinstance(arg, ParamMeta)), None)
236 return base, meta
237 return annotation, None
238
239
240def _strip_optional(annotation: Any) -> Tuple[Any, bool]:

Callers 1

_build_parameters_schemaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected