replace werewolf experience chromadb with rag

This commit is contained in:
better629 2024-04-10 19:35:46 +08:00
parent 835d6987b9
commit 5caaea2aeb
4 changed files with 57 additions and 94 deletions

View file

@ -722,7 +722,9 @@ def list_files(root: str | Path) -> List[Path]:
def parse_json_code_block(markdown_text: str) -> List[str]:
json_blocks = re.findall(r"```json(.*?)```", markdown_text, re.DOTALL) if "```json" in markdown_text else [markdown_text]
json_blocks = (
re.findall(r"```json(.*?)```", markdown_text, re.DOTALL) if "```json" in markdown_text else [markdown_text]
)
return [v.strip() for v in json_blocks]