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

Class ExecutionOutput

ms_agent/skill/container.py:111–143  ·  view source on GitHub ↗

Output specification for skill execution. Attributes: return_value: Return value from function execution. stdout: Standard output content. stderr: Standard error content. exit_code: Process exit code. output_files: Dict of output files {name: path}.

Source from the content-addressed store, hash-verified

109
110@dataclass
111class ExecutionOutput:
112 """
113 Output specification for skill execution.
114
115 Attributes:
116 return_value: Return value from function execution.
117 stdout: Standard output content.
118 stderr: Standard error content.
119 exit_code: Process exit code.
120 output_files: Dict of output files {name: path}.
121 artifacts: Any generated artifacts (data, objects, etc.).
122 duration_ms: Execution duration in milliseconds.
123 """
124 return_value: Any = None
125 stdout: str = ''
126 stderr: str = ''
127 exit_code: int = 0
128 output_files: Dict[str, Path] = field(default_factory=dict)
129 artifacts: Dict[str, Any] = field(default_factory=dict)
130 duration_ms: float = 0.0
131
132 def to_dict(self) -> Dict[str, Any]:
133 return {
134 'return_value':
135 str(self.return_value) if self.return_value else None,
136 'stdout': self.stdout,
137 'stderr': self.stderr,
138 'exit_code': self.exit_code,
139 'output_files': {k: str(v)
140 for k, v in self.output_files.items()},
141 'artifacts': list(self.artifacts.keys()),
142 'duration_ms': self.duration_ms,
143 }
144
145
146@dataclass

Calls

no outgoing calls