From b3d13ac99285ef43299ffa91e89ab7dec0fbb7d3 Mon Sep 17 00:00:00 2001 From: betterwang Date: Fri, 15 Mar 2024 14:29:00 +0800 Subject: [PATCH] update --- examples/rag_pipeline.py | 9 +++++++-- metagpt/rag/vector_stores/chroma/base.py | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/rag_pipeline.py b/examples/rag_pipeline.py index 3eb1dfd9e..80fb95842 100644 --- a/examples/rag_pipeline.py +++ b/examples/rag_pipeline.py @@ -67,7 +67,9 @@ class RAGExample: self._print_query_result(answer) async def rag_add_docs(self): - """This example show how to add docs, before add docs llm anwser I don't know, after add docs llm give the correct answer, will print something like: + """This example show how to add docs. + before add docs llm anwser I don't know + after add docs llm give the correct answer, will print something like: [Before add docs] Retrieve Result: @@ -95,7 +97,10 @@ class RAGExample: await self.rag_pipeline(question=travel_question, print_title=False) async def rag_add_objs(self, print_title=True): - """This example show how to add objs, before add docs engine retrieve nothing, after add objs engine give the correct answer, will print something like: + """This example show how to add objs. + before add docs engine retrieve nothing. + after add objs engine give the correct answer, will print something like: + [Before add objs] Retrieve Result: diff --git a/metagpt/rag/vector_stores/chroma/base.py b/metagpt/rag/vector_stores/chroma/base.py index 94728f23b..55e5bd40d 100644 --- a/metagpt/rag/vector_stores/chroma/base.py +++ b/metagpt/rag/vector_stores/chroma/base.py @@ -3,7 +3,7 @@ Refs to https://github.com/run-llama/llama_index/blob/v0.10.12/llama-index-integrations/vector_stores/llama-index-vector-stores-chroma/llama_index/vector_stores/chroma/base.py. The repo requires onnxruntime = "^1.17.0", which is too new for many OS systems, such as CentOS7. """ -import logging + import math from typing import Any, Dict, Generator, List, Optional, cast @@ -24,7 +24,7 @@ from llama_index.core.vector_stores.utils import ( node_to_metadata_dict, ) -logger = logging.getLogger(__name__) +from metagpt.logs import logger def _transform_chroma_filter_condition(condition: str) -> str: