Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ragas/llms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ def generate_text(
if temperature is None:
temperature = self.get_temperature(n=n)
if hasattr(self.langchain_llm, "temperature"):
old_temperature = self.langchain_llm.temperature # type: ignore
self.langchain_llm.temperature = temperature # type: ignore
old_temperature = temperature

if is_multiple_completion_supported(self.langchain_llm):
result = self.langchain_llm.generate_prompt(
Expand Down Expand Up @@ -268,8 +268,8 @@ async def agenerate_text(
if temperature is None:
temperature = self.get_temperature(n=n)
if hasattr(self.langchain_llm, "temperature") and not self.bypass_temperature:
old_temperature = self.langchain_llm.temperature # type: ignore
self.langchain_llm.temperature = temperature # type: ignore
old_temperature = temperature

# handle n
if hasattr(self.langchain_llm, "n"):
Expand Down
Loading