From 172485f4b450f62cf807ceef05a4fe1c6087d954 Mon Sep 17 00:00:00 2001 From: Juan Valacco <97040903+jvalacco-dataherald@users.noreply.github.com> Date: Tue, 2 Apr 2024 19:56:21 -0300 Subject: [PATCH] DH-5611 add newline on final answer from sql generation stream endpoint for correct parsing of SQL markdown -- added markdown bold text (#450) --- dataherald/sql_generator/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dataherald/sql_generator/__init__.py b/dataherald/sql_generator/__init__.py index 1377272a..081df00c 100644 --- a/dataherald/sql_generator/__init__.py +++ b/dataherald/sql_generator/__init__.py @@ -173,9 +173,9 @@ def stream_agent_steps( # noqa: C901 queue.put(message.content + "\n") elif "steps" in chunk: for step in chunk["steps"]: - queue.put(f"Observation: `{step.observation}`\n") + queue.put(f"**Observation:**\n `{step.observation}`\n") elif "output" in chunk: - queue.put(f'Final Answer: {chunk["output"]}') + queue.put(f'**Final Answer:**\n {chunk["output"]}') if "```sql" in chunk["output"]: response.sql = replace_unprocessable_characters( self.remove_markdown(chunk["output"])