MCPcopy Create free account
hub / github.com/modelscope/ms-agent / _coerce_str

Function _coerce_str

ms_agent/tools/code/local_code_executor.py:30–35  ·  view source on GitHub ↗
(value: Optional[bytes])

Source from the content-addressed store, hash-verified

28
29
30def _coerce_str(value: Optional[bytes]) -> str:
31 if value is None:
32 return ''
33 if isinstance(value, bytes):
34 return value.decode('utf-8', errors='replace')
35 return str(value)
36
37
38class LocalKernelSession:

Callers 1

shell_executorMethod · 0.85

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected