Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,26 @@ class AgentConfig:
knowledge_subdirs: list[str] = field(default_factory=lambda: ["default", "custom"])
additional: Dict[str, Any] = field(default_factory=dict)

def get(self, key: str, default: Any = None) -> Any:
"""Dict-like access to config attributes.

Provides dict-style .get() access to AgentConfig fields and
the additional dict. This is useful for extensions and skills
that treat config as a dict-like object.

Args:
key: The attribute name to look up
default: Value to return if key not found

Returns:
The attribute value, or value from additional dict, or default
"""
if hasattr(self, key):
return getattr(self, key)
if key in self.additional:
return self.additional[key]
return default


@dataclass
class UserMessage:
Expand Down