From f67b79f00766df29dfda9faa8ae152c0b1f3e161 Mon Sep 17 00:00:00 2001 From: Siddhant Rai Date: Thu, 19 Dec 2024 17:55:58 +0530 Subject: [PATCH] fix: missing yield in tool agent --- application/tools/agent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/tools/agent.py b/application/tools/agent.py index e02c40f7..ab797992 100644 --- a/application/tools/agent.py +++ b/application/tools/agent.py @@ -120,7 +120,9 @@ class Agent: def gen(self, messages): # Generate initial response from the LLM if self.llm.supports_tools(): - self._simple_tool_agent(messages) + resp = self._simple_tool_agent(messages) + for line in resp: + yield line else: resp = self.llm.gen_stream(model=self.gpt_model, messages=messages) for line in resp: