Upload datasets to HoneyHive through the web UI or programmatically via the SDK.If your dataset is managed outside HoneyHive (S3, Google Sheets, internal tools) and you want to keep it synced over time, see Sync datasets from external sources.
[ {"user_query": "What's the history of AI?", "response": "The history of AI is a long one."}, {"user_query": "What is AI?", "response": "AI is the simulation of human intelligence in machines."}]
import osfrom honeyhive import HoneyHivefrom honeyhive.models import CreateDatasetRequest, CreateDatapointRequestclient = HoneyHive(api_key=os.environ["HH_API_KEY"])# Step 1: Create datapointsdatapoints_data = [ {"inputs": {"question": "How do I make tables?"}, "ground_truth": {"answer": "Use the Table component"}}, {"inputs": {"question": "How do I make modals?"}, "ground_truth": {"answer": "Use the Modal component"}}, {"inputs": {"question": "How do I make forms?"}, "ground_truth": {"answer": "Use the Form component"}},]datapoint_ids = []for dp in datapoints_data: response = client.datapoints.create(CreateDatapointRequest( inputs=dp["inputs"], ground_truth=dp.get("ground_truth"), )) datapoint_ids.append(response.result["insertedId"])# Step 2: Create dataset with those datapointsdataset = client.datasets.create(CreateDatasetRequest( name="My Q&A Dataset", description="Questions and answers for evaluation", datapoints=datapoint_ids,))print(f"Created dataset: {dataset.result['insertedId']}")