Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def restore_from_session(self, state: dict[str, Any]) -> Optional[list[Message]]
Args:
state: Previous state of the conversation manager
Returns:
Optional list of messages to prepend to the agents messages. By defualt returns None.
Optional list of messages to prepend to the agents messages. By default returns None.
"""
if state.get("__name__") != self.__class__.__name__:
raise ValueError("Invalid conversation manager state.")
Expand Down
2 changes: 1 addition & 1 deletion src/strands/multiagent/a2a/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
to be used as an executor in the A2A protocol. It handles the execution of agent
requests and the conversion of Strands Agent streamed responses to A2A events.

The A2A AgentExecutor ensures clients recieve responses for synchronous and
The A2A AgentExecutor ensures clients receive responses for synchronous and
streamed requests to the A2AServer.
"""

Expand Down
14 changes: 7 additions & 7 deletions src/strands/session/repository_session_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self, session_id: str, session_repository: SessionRepository, **kwa

Args:
session_id: ID to use for the session. A new session with this id will be created if it does
not exist in the reposiory yet
not exist in the repository yet
session_repository: Underlying session repository to use to store the sessions state.
**kwargs: Additional keyword arguments for future extensibility.

Expand Down Expand Up @@ -133,15 +133,15 @@ def initialize(self, agent: "Agent", **kwargs: Any) -> None:
agent.state = AgentState(session_agent.state)

# Restore the conversation manager to its previous state, and get the optional prepend messages
prepend_messsages = agent.conversation_manager.restore_from_session(
prepend_messages = agent.conversation_manager.restore_from_session(
session_agent.conversation_manager_state
)

if prepend_messsages is None:
prepend_messsages = []
if prepend_messages is None:
prepend_messages = []

# List the messages currently in the session, using an offset of the messages previously removed
# by the converstaion manager.
# by the conversation manager.
session_messages = self.session_repository.list_messages(
session_id=self.session_id,
agent_id=agent.agent_id,
Expand All @@ -150,5 +150,5 @@ def initialize(self, agent: "Agent", **kwargs: Any) -> None:
if len(session_messages) > 0:
self._latest_agent_message[agent.agent_id] = session_messages[-1]

# Resore the agents messages array including the optional prepend messages
agent.messages = prepend_messsages + [session_message.to_message() for session_message in session_messages]
# Restore the agents messages array including the optional prepend messages
agent.messages = prepend_messages + [session_message.to_message() for session_message in session_messages]
4 changes: 2 additions & 2 deletions src/strands/types/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def from_agent(cls, agent: "Agent") -> "SessionAgent":

@classmethod
def from_dict(cls, env: dict[str, Any]) -> "SessionAgent":
"""Initialize a SessionAgent from a dictionary, ignoring keys that are not calss parameters."""
"""Initialize a SessionAgent from a dictionary, ignoring keys that are not class parameters."""
return cls(**{k: v for k, v in env.items() if k in inspect.signature(cls).parameters})

def to_dict(self) -> dict[str, Any]:
Expand All @@ -144,7 +144,7 @@ class Session:

@classmethod
def from_dict(cls, env: dict[str, Any]) -> "Session":
"""Initialize a Session from a dictionary, ignoring keys that are not calss parameters."""
"""Initialize a Session from a dictionary, ignoring keys that are not class parameters."""
return cls(**{k: v for k, v in env.items() if k in inspect.signature(cls).parameters})

def to_dict(self) -> dict[str, Any]:
Expand Down
Loading