mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
21 lines
597 B
Python
21 lines
597 B
Python
from dataclasses import dataclass, field
|
|
from typing import Any
|
|
|
|
from openhands.core.schema import ObservationType
|
|
from openhands.events.observation.observation import Observation
|
|
|
|
|
|
@dataclass
|
|
class MCPObservation(Observation):
|
|
"""This data class represents the result of a MCP Server operation."""
|
|
|
|
observation: str = ObservationType.MCP
|
|
name: str = '' # The name of the MCP tool that was called
|
|
arguments: dict[str, Any] = field(
|
|
default_factory=dict
|
|
) # The arguments passed to the MCP tool
|
|
|
|
@property
|
|
def message(self) -> str:
|
|
return self.content
|