Update existing rows in an experiment dataset
# Synchronous client.experiments.update_rows( experiment_id: str, updates: List[Dict[str, Any]] ) -> Dict[str, Any] # Asynchronous await client.experiments.update_rows( experiment_id: str, updates: List[Dict[str, Any]] ) -> Dict[str, Any]
from keywordsai import KeywordsAI client = KeywordsAI(api_key="your-api-key") # Update specific rows in experiment updates = [ { "row_id": "row_123", "input": "What is machine learning?", "expected_output": "ML is a subset of AI" }, { "row_id": "row_456", "input": "Define neural networks", "expected_output": "Networks inspired by biological neurons" } ] result = client.experiments.update_rows( experiment_id="exp_123", updates=updates ) print(f"Updated {len(updates)} rows in experiment")
try: result = client.experiments.update_rows( experiment_id="exp_123", updates=updates ) except Exception as e: print(f"Error updating rows: {e}")
Was this page helpful?