ancient-judge-59849
11/04/2025, 7:59 PMError running task NegotiationTask: cannot call `SpeechHandle.wait_for_playout()` from inside the function tool `avanzar_flujo` that owns this SpeechHandle. This creates a circular wait: the speech handle is waiting for the function tool to complete, while the function tool is simultaneously waiting for the speech handle.refined-appointment-81829
11/04/2025, 9:25 PMancient-judge-59849
11/04/2025, 9:28 PMresult: NegotiationResult = await NegotiationTask(...)ancient-judge-59849
11/04/2025, 9:28 PMancient-judge-59849
11/04/2025, 9:31 PMasync def llm_node(
self,
chat_ctx: llm.ChatContext,
tools: list[FunctionTool],
model_settings: ModelSettings,
):
# Obtener el stream del LLM por defecto
llm_stream = Agent.default.llm_node(self, chat_ctx, tools, model_settings)
if asyncio.iscoroutine(llm_stream):
llm_stream = await llm_stream
accumulated_text = ""
async for chunk in llm_stream:
if isinstance(chunk, str):
accumulated_text += chunk
elif isinstance(chunk, llm.ChatChunk):
if chunk.delta and chunk.delta.content:
accumulated_text += chunk.delta.content
# Verificar palabras prohibidas
if self._contains_forbidden_word(accumulated_text):
...
I was also thinking that that await in the llm stream was causing issues since i did not know what other await might be causing thisrefined-appointment-81829
11/04/2025, 9:36 PMrefined-appointment-81829
11/04/2025, 9:37 PMSpeechHandle.wait_for_playout() somewhereancient-judge-59849
11/04/2025, 9:38 PM