Skip to content
Open
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
5 changes: 3 additions & 2 deletions rnd/autogpt_server/autogpt_server/blocks/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class BlockAgentSettings(AgentSettings):


class OutputComponent(CommandProvider):
def get_commands(self) -> Iterator[Command]:
def get_commands() -> Iterator[Command]:
yield self.output

@command(
Expand Down Expand Up @@ -74,7 +74,6 @@ def __init__(
):
delattr(self, attr_name)


class AutoGPTAgentBlock(Block):
class Input(BlockSchema):
task: str = SchemaField(
Expand Down Expand Up @@ -151,6 +150,7 @@ def get_result(agent: BlockAgent) -> str:
result = asyncio.run(agent.execute(proposal))
return str(result)
except Exception as e:
logger.error(f"Error during agent action execution: {e}") # Detailed exception logging
error = e

raise error or Exception("Failed to get result")
Expand Down Expand Up @@ -188,3 +188,4 @@ def run(self, input_data: Input) -> BlockOutput:
result = self.get_result(agent)

yield "result", result