Private instance vars, public get properties
This commit is contained in:
@@ -9,7 +9,7 @@ class ReasoningEntry(Entry):
|
||||
Entry type for agent reasoning steps.
|
||||
|
||||
Attributes:
|
||||
content: The reasoning text
|
||||
_content: The reasoning text
|
||||
"""
|
||||
|
||||
def __init__(self, content: str, id: str, timestamp: datetime):
|
||||
@@ -22,7 +22,14 @@ class ReasoningEntry(Entry):
|
||||
timestamp: Creation timestamp for this entry
|
||||
"""
|
||||
super().__init__(id, timestamp)
|
||||
self.content = content
|
||||
self._content = content
|
||||
|
||||
@property
|
||||
def content(self) -> str:
|
||||
"""
|
||||
Get the reasoning text.
|
||||
"""
|
||||
return self._content
|
||||
|
||||
def update(self) -> None:
|
||||
"""No update needed for reasoning entries."""
|
||||
@@ -36,9 +43,9 @@ class ReasoningEntry(Entry):
|
||||
ET.Element: XML element containing the entry's data
|
||||
"""
|
||||
# Create root element
|
||||
element = ET.Element("reasoning", {"id": self.id})
|
||||
element = ET.Element("reasoning", {"id": self._id})
|
||||
|
||||
# Add content as CDATA or escaped text
|
||||
element.text = escape_text_for_xml(self.content)
|
||||
element.text = escape_text_for_xml(self._content)
|
||||
|
||||
return element
|
||||
Reference in New Issue
Block a user