colorized think with ANSI to HTML

This commit is contained in:
anovazzi1 2023-04-03 18:39:55 -03:00
commit 6e3f8a89b4
5 changed files with 24 additions and 7 deletions

View file

@ -66,9 +66,7 @@ def process_graph(data_graph: Dict[str, Any]):
logger.debug("Saved langchain object to cache")
return {
"result": str(result),
"thought": re.sub(
r"\x1b\[([0-9,A-Z]{1,2}(;[0-9,A-Z]{1,2})?)?[m|K]", "", thought
).strip(),
"thought": thought.strip()
}