start implementation on new architecture
This commit is contained in:
44
sia/reasoning_entry.py
Normal file
44
sia/reasoning_entry.py
Normal file
@@ -0,0 +1,44 @@
|
||||
from datetime import datetime
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
from .entry import Entry
|
||||
from .util import escape_text_for_xml
|
||||
|
||||
class ReasoningEntry(Entry):
|
||||
"""
|
||||
Entry type for agent reasoning steps.
|
||||
|
||||
Attributes:
|
||||
content: The reasoning text
|
||||
"""
|
||||
|
||||
def __init__(self, content: str, id: str, timestamp: datetime):
|
||||
"""
|
||||
Initialize a new reasoning entry.
|
||||
|
||||
Args:
|
||||
content: The reasoning text
|
||||
id: Unique identifier for this entry
|
||||
timestamp: Creation timestamp for this entry
|
||||
"""
|
||||
super().__init__(id, timestamp)
|
||||
self.content = content
|
||||
|
||||
def update(self) -> None:
|
||||
"""No update needed for reasoning entries."""
|
||||
pass
|
||||
|
||||
def generate_context(self) -> ET.Element:
|
||||
"""
|
||||
Generate an XML Element representing this reasoning entry.
|
||||
|
||||
Returns:
|
||||
ET.Element: XML element containing the entry's data
|
||||
"""
|
||||
# Create root element
|
||||
element = ET.Element("reasoning", {"id": self.id})
|
||||
|
||||
# Add content as CDATA or escaped text
|
||||
element.text = escape_text_for_xml(self.content)
|
||||
|
||||
return element
|
||||
Reference in New Issue
Block a user