Skip to content

Commit

Permalink
fix format problem
Browse files Browse the repository at this point in the history
  • Loading branch information
cinjospeh committed Jan 6, 2025
1 parent d50ef21 commit 9c01996
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions dbgpt/agent/resource/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,10 @@ def is_async(self) -> bool:
"""Return whether the tool is asynchronous."""
return True

async def execute(
self, *args, resource_name: Optional[str] = None, **kwargs
) -> Any:
def execute(self, *args, resource_name: Optional[str] = None, **kwargs) -> Any:
"""Execute the resource."""
if self.is_async:
raise RuntimeError("Async execution is not supported")
raise RuntimeError("Sync execution is not supported")

async def async_execute(
self,
Expand All @@ -156,8 +154,13 @@ async def async_execute(
specific tool).
**kwargs: The keyword arguments.
"""
user_input: str = kwargs.get("user_input")
parent_agent: ConversableAgent = kwargs.get("parent_agent")
user_input: Optional[str] = kwargs.get("user_input")
parent_agent: Optional[ConversableAgent] = kwargs.get("parent_agent")

if user_input is None:
raise RuntimeError("AppResource async execution user_input is None")
if parent_agent is None:
raise RuntimeError("AppResource async execution parent_agent is None")

reply_message = await _start_app(
self._app_code, user_input=user_input, sender=parent_agent
Expand Down

0 comments on commit 9c01996

Please sign in to comment.