From fca082879a5323a1b05641ff8044c24dee666b3e Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Sun, 20 Jul 2025 15:44:54 +0100 Subject: [PATCH] Agent manager is close to working with extract prompt --- trustgraph-flow/trustgraph/agent/react/agent_manager.py | 3 ++- trustgraph-flow/trustgraph/extract/kg/agent/extract.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/trustgraph-flow/trustgraph/agent/react/agent_manager.py b/trustgraph-flow/trustgraph/agent/react/agent_manager.py index 24282031..82e73555 100644 --- a/trustgraph-flow/trustgraph/agent/react/agent_manager.py +++ b/trustgraph-flow/trustgraph/agent/react/agent_manager.py @@ -261,7 +261,8 @@ class AgentManager: **act.arguments ) - resp = resp.strip() + if isinstance(resp, str): + resp = resp.strip() logger.info(f"resp: {resp}") diff --git a/trustgraph-flow/trustgraph/extract/kg/agent/extract.py b/trustgraph-flow/trustgraph/extract/kg/agent/extract.py index f26cf80f..af2679e2 100644 --- a/trustgraph-flow/trustgraph/extract/kg/agent/extract.py +++ b/trustgraph-flow/trustgraph/extract/kg/agent/extract.py @@ -146,7 +146,10 @@ class Processor(FlowProcessor): print("Done?", response.answer is not None, flush=True) if response.error is not None: - raise RuntimeError(response.error) + if response.error.message: + raise RuntimeError(str(response.error.message)) + else: + raise RuntimeError(str(response.error)) if response.answer is not None: return True