MCPcopy Create free account
hub / github.com/SkyworkAI/DeepResearchAgent / ActionResult

Class ActionResult

src/environment/types.py:335–369  ·  view source on GitHub ↗

Action result

Source from the content-addressed store, hash-verified

333 transform_info: Optional[Dict[str, Any]] = Field(default=None, description="Transform information")
334
335class ActionResult(BaseModel):
336 """Action result"""
337 model_config = ConfigDict(arbitrary_types_allowed=True, extra="allow")
338
339 success: bool = Field(description="Whether the action was successful")
340 message: str = Field(description="The message of the action result")
341 extra: Optional[Dict[str, Any]] = Field(default=None, description="The extra information of the action result")
342
343 def __str__(self) -> str:
344 return f"ActionResult(success={self.success}, message={self.message}, extra={self.extra})"
345
346 def __repr__(self) -> str:
347 return self.__str__()
348
349 def model_dump(self, **kwargs) -> Dict[str, Any]:
350 """Dump the model to a dictionary, recursively serializing nested Pydantic models."""
351 from pydantic import BaseModel
352
353 def serialize_value(value: Any) -> Any:
354 if isinstance(value, BaseModel):
355 return value.model_dump(**kwargs)
356 if isinstance(value, list):
357 return [serialize_value(item) for item in value]
358 if isinstance(value, dict):
359 return {k: serialize_value(v) for k, v in value.items()}
360 return value
361
362 return {
363 "success": self.success,
364 "message": self.message,
365 "extra": serialize_value(self.extra) if self.extra is not None else None,
366 }
367
368 def model_dump_json(self) -> str:
369 return json.dumps(self.model_dump())
370
371class EnvironmentState(BaseModel):
372 """Environment state"""

Callers 15

search_googleMethod · 0.90
go_to_urlMethod · 0.90
go_backMethod · 0.90
waitMethod · 0.90
input_textMethod · 0.90
scrollMethod · 0.90
send_keysMethod · 0.90
scroll_to_textMethod · 0.90
get_dropdown_optionsMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected