Create Dataset via SDK
1. Install theathina package
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
You can use our Python SDK to create a dataset in Athina.
athina package
pip install athina-client
import os
from athina_client.keys import AthinaApiKey
AthinaApiKey.set_key(os.getenv('ATHINA_API_KEY'))
from athina_client.datasets import Dataset
try:
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}")
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}")
dataset_id from the URL when you open the dataset
through https://app.athina.ai/develop.