Skip to content

The agent engineering platform.

refactor: replace print with logger.info in llm_summarization_checker (#34903)

wixarv8a81852a8368
diff --git a/libs/langchain/langchain_classic/chains/llm_summarization_checker/base.py b/libs/langchain/langchain_classic/chains/llm_summarization_checker/base.py
index e5d86dd2f0..d8c9d096be 100644
--- a/libs/langchain/langchain_classic/chains/llm_summarization_checker/base.py
+++ b/libs/langchain/langchain_classic/chains/llm_summarization_checker/base.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+import logging
import warnings
from pathlib import Path
from typing import Any
@@ -17,6 +18,7 @@ from langchain_classic.chains.llm import LLMChain
from langchain_classic.chains.sequential import SequentialChain
PROMPTS_DIR = Path(__file__).parent / "prompts"
+logger = logging.getLogger(__name__)
CREATE_ASSERTIONS_PROMPT = PromptTemplate.from_file(PROMPTS_DIR / "create_facts.txt")
CHECK_ASSERTIONS_PROMPT = PromptTemplate.from_file(PROMPTS_DIR / "check_facts.txt")
@@ -164,7 +166,7 @@ class LLMSummarizationCheckerChain(Chain):
break
if self.verbose:
- print(output["revised_summary"]) # noqa: T201
+ logger.info(output["revised_summary"])
chain_input = output["revised_summary"]