diff --git a/backend/agent/run.py b/backend/agent/run.py index ba459f94..f9473223 100644 --- a/backend/agent/run.py +++ b/backend/agent/run.py @@ -1,7 +1,6 @@ import os import json -import re -from uuid import uuid4 +import asyncio from typing import Optional # from agent.tools.message_tool import MessageTool @@ -633,4 +632,4 @@ async def run_agent( if generation: generation.end(output=full_response) - langfuse.flush() \ No newline at end of file + asyncio.create_task(asyncio.to_thread(lambda: langfuse.flush()))