mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-27 14:26:48 +00:00
Use getLogger
instead of basicConfig
in multi_query.py
(#6891)
Remove `logging.basicConfig`, which turns on logging. Use `getLogger` instead
This commit is contained in:
@@ -9,7 +9,7 @@ from langchain.output_parsers.pydantic import PydanticOutputParser
|
|||||||
from langchain.prompts.prompt import PromptTemplate
|
from langchain.prompts.prompt import PromptTemplate
|
||||||
from langchain.schema import BaseRetriever, Document
|
from langchain.schema import BaseRetriever, Document
|
||||||
|
|
||||||
logging.basicConfig(level=logging.INFO)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class LineList(BaseModel):
|
class LineList(BaseModel):
|
||||||
@@ -120,7 +120,7 @@ class MultiQueryRetriever(BaseRetriever):
|
|||||||
response = self.llm_chain({"question": question})
|
response = self.llm_chain({"question": question})
|
||||||
lines = getattr(response["text"], self.parser_key, [])
|
lines = getattr(response["text"], self.parser_key, [])
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
logging.info(f"Generated queries: {lines}")
|
logger.info(f"Generated queries: {lines}")
|
||||||
return lines
|
return lines
|
||||||
|
|
||||||
def retrieve_documents(self, queries: List[str]) -> List[Document]:
|
def retrieve_documents(self, queries: List[str]) -> List[Document]:
|
||||||
|
Reference in New Issue
Block a user