From 3f1f1841f594ba889decb48842fc7d8ad1bd4675 Mon Sep 17 00:00:00 2001 From: Donnie Adams Date: Fri, 1 Nov 2024 20:25:21 -0400 Subject: [PATCH] fix: ensure parent call frame is of category none Signed-off-by: Donnie Adams --- gptscript/run.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gptscript/run.py b/gptscript/run.py index e4f09e8..c64e0d2 100644 --- a/gptscript/run.py +++ b/gptscript/run.py @@ -4,7 +4,7 @@ import httpx -from gptscript.frame import PromptFrame, RunFrame, CallFrame, RunState, RunEventType, Program +from gptscript.frame import PromptFrame, RunFrame, CallFrame, RunState, RunEventType, Program, ToolCategory from gptscript.opts import Options from gptscript.tool import ToolDef, Tool @@ -179,7 +179,7 @@ async def _request(self, tool: Any): if self._calls is None: self._calls = {} self._calls[event.id] = event - if event.parentID == "" and self._parentCallID == "": + if event.parentID == "" and self._parentCallID == "" and event.toolCategory != ToolCategory.none: self._parentCallID = event.id if self.event_handlers is not None: for event_handler in self.event_handlers: