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

Function _apply_param_meta

utils/function_catalog.py:303–314  ·  view source on GitHub ↗
(schema: Dict[str, Any], meta: ParamMeta | None)

Source from the content-addressed store, hash-verified

301
302
303def _apply_param_meta(schema: Dict[str, Any], meta: ParamMeta | None) -> Dict[str, Any]:
304 if meta is None:
305 return schema
306 updated = dict(schema)
307 if meta.description:
308 updated["description"] = meta.description
309 if meta.enum:
310 updated["enum"] = list(meta.enum)
311 inferred = _infer_literal_type(meta.enum)
312 if inferred:
313 updated["type"] = inferred
314 return updated
315
316
317def _literal_schema(values: Sequence[Any]) -> Dict[str, Any]:

Callers 1

_build_parameters_schemaFunction · 0.85

Calls 1

_infer_literal_typeFunction · 0.85

Tested by

no test coverage detected