File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66from argparse import ArgumentError
77from logging import Logger
88from typing import Any
9- from dotenv import load_dotenv
109from datasets import Dataset
1110from langchain_openai import ChatOpenAI
1211from ragas import evaluate
@@ -197,21 +196,11 @@ def main(
197196 model: Model name to use for evaluation
198197 metrics: List of metric names to calculate
199198 """
200- # Load environment variables
201- load_dotenv ()
202199
203200 # Check if any metrics were provided
204201 if metrics is None :
205202 raise ArgumentError ("No metrics were provided as arguments" )
206203
207- # Initialize the LLM for RAGAS evaluation
208- # Using Google Generative AI (Gemini) via API key
209- api_key = os .getenv ("GOOGLE_API_KEY" )
210- if not api_key :
211- raise ValueError ("GOOGLE_API_KEY not found in environment variables" )
212-
213-
214-
215204 # Create LLM client using the AI Gateway (environment variables 'OPEN_API_KEY' and 'OPENAI_API_BASE' need to be set)
216205 ragas_llm = ChatOpenAI (
217206 model = model
You can’t perform that action at this time.
0 commit comments