RAGASFactory
Factory for creating RAGAS evaluators and individual metrics.
Provides convenient methods to create evaluators from environment configuration or with specific settings.
Attributes
- Example
-
{ // Create from environment val evaluator = RAGASFactory.fromConfigs(providerCfg, embeddingCfg) // Create with specific metrics val basicEvaluator = RAGASFactory.withMetrics( llmClient, embeddingClient, embeddingConfig, Set("faithfulness", "answer_relevancy") ) // Create individual metrics val faithfulness = RAGASFactory.faithfulness(llmClient)}
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
RAGASFactory.type
Members list
Value members
Concrete methods
Create an Answer Relevancy metric.
Create an Answer Relevancy metric.
Value parameters
- embeddingClient
-
Embedding client for similarity calculations
- embeddingModelConfig
-
Configuration for the embedding model
- llmClient
-
LLM client for question generation
- numGeneratedQuestions
-
Number of questions to generate
Attributes
- Returns
-
A configured Answer Relevancy metric
Create a basic evaluator with only Faithfulness and Answer Relevancy metrics. These metrics don't require ground truth, making them suitable for production evaluation.
Create a basic evaluator with only Faithfulness and Answer Relevancy metrics. These metrics don't require ground truth, making them suitable for production evaluation.
Value parameters
- embeddingClient
-
Embedding client for similarity calculations
- embeddingModelConfig
-
Configuration for the embedding model
- llmClient
-
LLM client for semantic evaluation
Attributes
- Returns
-
A basic evaluator without ground truth requirements
Create a basic evaluator from explicit configurations.
Create a basic evaluator from explicit configurations.
Attributes
Create a Context Precision metric.
Create a Context Precision metric.
Value parameters
- llmClient
-
LLM client for relevance assessment
Attributes
- Returns
-
A configured Context Precision metric
Create a Context Recall metric.
Create a Context Recall metric.
Value parameters
- llmClient
-
LLM client for fact extraction and attribution
Attributes
- Returns
-
A configured Context Recall metric
Create evaluator with all default metrics.
Create evaluator with all default metrics.
Value parameters
- embeddingClient
-
Embedding client for similarity calculations
- embeddingModelConfig
-
Configuration for the embedding model
- llmClient
-
LLM client for semantic evaluation
Attributes
- Returns
-
A configured evaluator
Create a Faithfulness metric.
Create a Faithfulness metric.
Value parameters
- batchSize
-
Number of claims to verify per LLM call
- llmClient
-
LLM client for claim extraction and verification
Attributes
- Returns
-
A configured Faithfulness metric
Create evaluator with all default metrics from explicit configurations.
Create evaluator with all default metrics from explicit configurations.
Attributes
Create evaluator with specific metrics only.
Create evaluator with specific metrics only.
Value parameters
- embeddingClient
-
Embedding client for similarity calculations
- embeddingModelConfig
-
Configuration for the embedding model
- llmClient
-
LLM client for semantic evaluation
- metricNames
-
Names of metrics to enable (faithfulness, answer_relevancy, context_precision, context_recall)
Attributes
- Returns
-
A configured evaluator with only specified metrics
Concrete fields
Available metric names.
Available metric names.
Attributes
Metrics that require ground truth.
Metrics that require ground truth.
Attributes
Metrics that work without ground truth.
Metrics that work without ground truth.