Skip to content
Merged
Changes from all 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
22 changes: 9 additions & 13 deletions src/ragas/llms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,39 +61,35 @@ def set_run_config(self, run_config: RunConfig):

def get_temperature(self, n: int) -> float:
"""Return the temperature to use for completion based on n."""
return 0.3 if n > 1 else 1e-8

def is_finished(self, response: LLMResult) -> bool:
logger.warning(
f"is_finished not implemented for {self.__class__.__name__}. Will default to True."
)
return True
return 0.3 if n > 1 else 0.01

@abstractmethod
def generate_text(
self,
prompt: PromptValue,
n: int = 1,
temperature: float = 1e-8,
temperature: float = 0.01,
stop: t.Optional[t.List[str]] = None,
callbacks: Callbacks = None,
) -> LLMResult: ...
) -> LLMResult:
...

@abstractmethod
async def agenerate_text(
self,
prompt: PromptValue,
n: int = 1,
temperature: t.Optional[float] = None,
temperature: t.Optional[float] = 0.01,
stop: t.Optional[t.List[str]] = None,
callbacks: Callbacks = None,
) -> LLMResult: ...
) -> LLMResult:
...

async def generate(
self,
prompt: PromptValue,
n: int = 1,
temperature: t.Optional[float] = None,
temperature: t.Optional[float] = 0.01,
stop: t.Optional[t.List[str]] = None,
callbacks: Callbacks = None,
) -> LLMResult:
Expand Down Expand Up @@ -195,7 +191,7 @@ def generate_text(
self,
prompt: PromptValue,
n: int = 1,
temperature: t.Optional[float] = None,
temperature: t.Optional[float] = 0.01,
stop: t.Optional[t.List[str]] = None,
callbacks: Callbacks = None,
) -> LLMResult:
Expand Down