diff --git a/agent_loop.py b/agent_loop.py index 05efc66..f4e8ec6 100644 --- a/agent_loop.py +++ b/agent_loop.py @@ -51,7 +51,7 @@ def agent_runner_loop(client, system_prompt, user_input, handler, tools_schema, if '```' in response.content: response.content = response.content.replace('```', ' \n```') showcontent = response.content if '' in showcontent: - showcontent = re.sub(r'\s*(.*?)\s*', r'\n````\n\1\n````', showcontent, flags=re.DOTALL) + showcontent = re.sub(r'\s*(.*?)\s*', r'\n```` \n\1\n ````', showcontent, flags=re.DOTALL) yield showcontent + '\n\n' if not response.tool_calls: