You can use our Python SDK to create a dataset in Athina.
You can create a dataset and add rows programmatically using our Python SDK.If you are using any other language, then you can do so through some simple API requests.
from athina_client.datasets import Datasettry: dataset = Dataset.create( name='test_dataset', # the fields below are optional description="Optional description", tags=["tag1", "tag2"], project_name="project_name", # Note: project name should already exist on Athina metadata={ # freeform dictionary of metadata 'model': 'gpt-4o-mini', 'prompt': 'closed_qa/v1', 'dataset_type': 'classification', 'dataset_source': 'https://example.com', } )except Exception as e: print(f"Failed to create dataset: {e}")
The name of the dataset must be unique, otherwise the request will throw an
exception.
4. Add rows to the dataset
Copy
Ask AI
try: Dataset.add_rows( dataset_id=dataset.id, rows=[ { 'query': 'What is the capital of France?', 'context': ['France is a country in Western Europe.', 'Paris is the capital of France.'], 'response': 'Paris', 'expected_response': 'Paris' }, ], )except Exception as e: print(f"Failed to add rows: {e}")