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

Method from_raw

ms_agent/llm/utils.py:106–117  ·  view source on GitHub ↗
(raw)

Source from the content-addressed store, hash-verified

104
105 @staticmethod
106 def from_raw(raw):
107 if isinstance(raw, str):
108 return ToolResult(text=raw)
109 if isinstance(raw, dict):
110 return ToolResult(
111 text=str(raw.get('text', '')),
112 resources=raw.get('resources', []),
113 extra={
114 k: v
115 for k, v in raw.items() if k not in ['text', 'resources']
116 })
117 raise TypeError('tool_call_result must be str or dict')

Callers 1

parallel_tool_callMethod · 0.80

Calls 2

ToolResultClass · 0.85
getMethod · 0.80

Tested by

no test coverage detected