Skip to content

Commit 3d7185a

Browse files
remove heading
1 parent 489f82a commit 3d7185a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

app/pipeline/inconsistency_check_pipeline.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import logging
2+
import re
3+
24
from typing import Dict, Optional
35

46
from langchain_core.runnables import Runnable
@@ -103,12 +105,17 @@ def __call__(self, dto: InconsistencyCheckPipelineExecutionDTO, **kwargs):
103105

104106
result = summary_response.content.strip()
105107

106-
# remove ``` from start and end if exists
108+
# Remove ``` from start and end if exists
107109
if result.startswith("```") and result.endswith("```"):
108110
result = result[3:-3]
109111
if result.startswith("markdown"):
110112
result = result[8:]
111113
result = result.strip()
114+
115+
# Remove first heading
116+
result = re.sub(r"^#\s.*?\n", "", result)
117+
118+
logger.info(f"Consistency issues found: {result}")
112119

113120
self._append_tokens(self.llm.tokens, PipelineEnum.IRIS_INCONSISTENCY_CHECK)
114121
self.callback.done(final_result=result, tokens=self.tokens)

0 commit comments

Comments
 (0)