π OpenHands: AI-Driven Development
Removes upper-case 'List' imports from typing and replaces them with lower-case 'list' (#1676)
Ammar Ladhani564739d1db03
diff --git a/agenthub/codeact_agent/codeact_agent.py b/agenthub/codeact_agent/codeact_agent.pyindex 8179e070ff..5127b9fe5a 100644--- a/agenthub/codeact_agent/codeact_agent.py+++ b/agenthub/codeact_agent/codeact_agent.py@@ -1,5 +1,5 @@import re-from typing import List, Mapping+from typing import Mappingfrom agenthub.codeact_agent.prompt import EXAMPLES, SYSTEM_MESSAGEfrom opendevin.controller.agent import Agent@@ -117,7 +117,7 @@ class CodeActAgent(Agent):"""- sandbox_plugins: List[PluginRequirement] = [+ sandbox_plugins: list[PluginRequirement] = [JupyterRequirement(),SWEAgentCommandsRequirement(),]@@ -144,7 +144,7 @@ class CodeActAgent(Agent):- llm (LLM): The llm to be used by this agent"""super().__init__(llm)- self.messages: List[Mapping[str, str]] = []+ self.messages: list[Mapping[str, str]] = []self.cost_accumulator = 0def step(self, state: State) -> Action:@@ -263,5 +263,5 @@ class CodeActAgent(Agent):# it want to talk to the userreturn MessageAction(content=action_str, wait_for_response=True)- def search_memory(self, query: str) -> List[str]:+ def search_memory(self, query: str) -> list[str]:raise NotImplementedError('Implement this abstract method')diff --git a/opendevin/server/session/msg_stack.py b/opendevin/server/session/msg_stack.pyindex 86025f50de..c328073c72 100644--- a/opendevin/server/session/msg_stack.py+++ b/opendevin/server/session/msg_stack.py@@ -2,7 +2,7 @@ import atexitimport jsonimport osimport uuid-from typing import Dict, List+from typing import Dictfrom opendevin.core.logger import opendevin_logger as loggerfrom opendevin.core.schema.action import ActionType@@ -31,7 +31,7 @@ class Message:class MessageStack:- _messages: Dict[str, List[Message]] = {}+ _messages: Dict[str, list[Message]] = {}def __init__(self):self._load_messages()@@ -51,7 +51,7 @@ class MessageStack:returndel self._messages[sid]- def get_messages(self, sid: str) -> List[Dict[str, object]]:+ def get_messages(self, sid: str) -> list[Dict[str, object]]:if sid not in self._messages:return []return [msg.to_dict() for msg in self._messages[sid]]