agent_config_tools.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. from collections.abc import Mapping
  2. from typing import Any, TypeVar
  3. from attrs import define as _attrs_define
  4. from attrs import field as _attrs_field
  5. T = TypeVar("T", bound="AgentConfigTools")
  6. @_attrs_define
  7. class AgentConfigTools:
  8. """ """
  9. additional_properties: dict[str, bool] = _attrs_field(init=False, factory=dict)
  10. def to_dict(self) -> dict[str, Any]:
  11. field_dict: dict[str, Any] = {}
  12. field_dict.update(self.additional_properties)
  13. return field_dict
  14. @classmethod
  15. def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
  16. d = dict(src_dict)
  17. agent_config_tools = cls()
  18. agent_config_tools.additional_properties = d
  19. return agent_config_tools
  20. @property
  21. def additional_keys(self) -> list[str]:
  22. return list(self.additional_properties.keys())
  23. def __getitem__(self, key: str) -> bool:
  24. return self.additional_properties[key]
  25. def __setitem__(self, key: str, value: bool) -> None:
  26. self.additional_properties[key] = value
  27. def __delitem__(self, key: str) -> None:
  28. del self.additional_properties[key]
  29. def __contains__(self, key: str) -> bool:
  30. return key in self.additional_properties