Retrieve a specific evaluator by ID
# Synchronous client.evaluators.get( evaluator_id: str ) -> Dict[str, Any] # Asynchronous await client.evaluators.get( evaluator_id: str ) -> Dict[str, Any]
from keywordsai import KeywordsAI client = KeywordsAI(api_key="your-api-key") # Get specific evaluator evaluator = client.evaluators.get(evaluator_id="eval_123") print(f"Evaluator: {evaluator['name']}") print(f"Type: {evaluator['type']}") print(f"Description: {evaluator['description']}") print(f"Config: {evaluator['config']}") # Access evaluator configuration if 'config' in evaluator: threshold = evaluator['config'].get('threshold', 0.5) print(f"Threshold: {threshold}")
try: evaluator = client.evaluators.get(evaluator_id="eval_123") except Exception as e: print(f"Error retrieving evaluator: {e}") # Handle case where evaluator doesn't exist if "not found" in str(e).lower(): print("Evaluator does not exist")
Was this page helpful?