1717from .session_repository import SessionRepository
1818
1919if TYPE_CHECKING :
20- from ..agent .agent import Agent
20+ from ..agent .base import AgentBase
2121 from ..multiagent .base import MultiAgentBase
2222
2323logger = logging .getLogger (__name__ )
@@ -58,12 +58,12 @@ def __init__(
5858 # Keep track of the latest message of each agent in case we need to redact it.
5959 self ._latest_agent_message : dict [str , Optional [SessionMessage ]] = {}
6060
61- def append_message (self , message : Message , agent : "Agent " , ** kwargs : Any ) -> None :
61+ def append_message (self , message : Message , agent : "AgentBase " , ** kwargs : Any ) -> None :
6262 """Append a message to the agent's session.
6363
6464 Args:
6565 message: Message to add to the agent in the session
66- agent: Agent to append the message to
66+ agent: AgentBase to append the message to
6767 **kwargs: Additional keyword arguments for future extensibility.
6868 """
6969 # Calculate the next index (0 if this is the first message, otherwise increment the previous index)
@@ -77,12 +77,12 @@ def append_message(self, message: Message, agent: "Agent", **kwargs: Any) -> Non
7777 self ._latest_agent_message [agent .agent_id ] = session_message
7878 self .session_repository .create_message (self .session_id , agent .agent_id , session_message )
7979
80- def redact_latest_message (self , redact_message : Message , agent : "Agent " , ** kwargs : Any ) -> None :
80+ def redact_latest_message (self , redact_message : Message , agent : "AgentBase " , ** kwargs : Any ) -> None :
8181 """Redact the latest message appended to the session.
8282
8383 Args:
8484 redact_message: New message to use that contains the redact content
85- agent: Agent to apply the message redaction to
85+ agent: AgentBase to apply the message redaction to
8686 **kwargs: Additional keyword arguments for future extensibility.
8787 """
8888 latest_agent_message = self ._latest_agent_message [agent .agent_id ]
@@ -91,23 +91,23 @@ def redact_latest_message(self, redact_message: Message, agent: "Agent", **kwarg
9191 latest_agent_message .redact_message = redact_message
9292 return self .session_repository .update_message (self .session_id , agent .agent_id , latest_agent_message )
9393
94- def sync_agent (self , agent : "Agent " , ** kwargs : Any ) -> None :
94+ def sync_agent (self , agent : "AgentBase " , ** kwargs : Any ) -> None :
9595 """Serialize and update the agent into the session repository.
9696
9797 Args:
98- agent: Agent to sync to the session.
98+ agent: AgentBase to sync to the session.
9999 **kwargs: Additional keyword arguments for future extensibility.
100100 """
101101 self .session_repository .update_agent (
102102 self .session_id ,
103103 SessionAgent .from_agent (agent ),
104104 )
105105
106- def initialize (self , agent : "Agent " , ** kwargs : Any ) -> None :
106+ def initialize (self , agent : "AgentBase " , ** kwargs : Any ) -> None :
107107 """Initialize an agent with a session.
108108
109109 Args:
110- agent: Agent to initialize from the session
110+ agent: AgentBase to initialize from the session
111111 **kwargs: Additional keyword arguments for future extensibility.
112112 """
113113 if agent .agent_id in self ._latest_agent_message :
0 commit comments