1- """Ragas LLM Manager - Ragas-specific LLM wrapper that takes LiteLLM parameters ."""
1+ """Ragas LLM Manager - Ragas-specific LLM wrapper."""
22
33from typing import Any , Optional
44
1010
1111
1212class RagasCustomLLM (BaseRagasLLM , BaseCustomLLM ):
13- """Custom LLM for Ragas using LiteLLM parameters ."""
13+ """Custom LLM for Ragas."""
1414
15- def __init__ (self , model_name : str , litellm_params : dict [str , Any ]):
16- """Initialize Ragas custom LLM with model name and LiteLLM parameters."""
15+ def __init__ (self , model_name : str , llm_params : dict [str , Any ]):
16+ """Initialize Ragas custom LLM with model name and LLM parameters."""
1717 BaseRagasLLM .__init__ (self )
18- BaseCustomLLM .__init__ (self , model_name , litellm_params )
18+ BaseCustomLLM .__init__ (self , model_name , llm_params )
1919 print (f"✅ Ragas Custom LLM: { self .model_name } " )
2020
2121 def generate_text ( # pylint: disable=too-many-arguments,too-many-positional-arguments
@@ -26,14 +26,14 @@ def generate_text( # pylint: disable=too-many-arguments,too-many-positional-arg
2626 stop : Optional [list [str ]] = None ,
2727 callbacks : Optional [Any ] = None ,
2828 ) -> LLMResult :
29- """Generate text using LiteLLM with provided parameters."""
29+ """Generate text using LLM with provided parameters."""
3030 prompt_text = str (prompt )
3131
3232 # Use temperature from params unless explicitly overridden
3333 temp = (
3434 temperature
3535 if temperature != 1e-08
36- else self .litellm_params .get ("temperature" , 0.0 )
36+ else self .llm_params .get ("temperature" , 0.0 )
3737 )
3838
3939 try :
@@ -84,11 +84,11 @@ class RagasLLMManager:
8484 This manager focuses solely on Ragas-specific LLM integration.
8585 """
8686
87- def __init__ (self , model_name : str , litellm_params : dict [str , Any ]):
87+ def __init__ (self , model_name : str , llm_params : dict [str , Any ]):
8888 """Initialize with LLM parameters from LLMManager."""
8989 self .model_name = model_name
90- self .litellm_params = litellm_params
91- self .custom_llm = RagasCustomLLM (model_name , litellm_params )
90+ self .llm_params = llm_params
91+ self .custom_llm = RagasCustomLLM (model_name , llm_params )
9292
9393 # Configure Ragas metrics to use our custom LLM
9494 answer_relevancy .llm = self .custom_llm
@@ -104,5 +104,5 @@ def get_model_info(self) -> dict[str, Any]:
104104 """Get information about the configured model."""
105105 return {
106106 "model_name" : self .model_name ,
107- "temperature" : self .litellm_params .get ("temperature" , 0.0 ),
107+ "temperature" : self .llm_params .get ("temperature" , 0.0 ),
108108 }
0 commit comments