Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# First, run:
# pip install simiotics
from simiotics.clients import SimioticsRESTClient
if __name__ == '__main__':
import json
import time
dataset_id = f'test-dataset-{int(time.time())}'
client = SimioticsRESTClient.from_env()
print(json.dumps(client.ping()))
print(json.dumps(client.datasets_list(offset=1, limit=1)))
print(json.dumps(
client.dataset_create(
id=dataset_id,
source_type='INTRINSIC',
uri='None',
description='Test'
)
))
print(json.dumps(client.dataset_get(dataset_id)))
sample = client.sample_create(dataset_id, 'test-sample', [{'key': 'role', 'value': 'test'}])
print(json.dumps(sample))
print(json.dumps(client.samples_list(dataset_id)))
new_attribute = client.sample_attribute_create(
sample['dataset_id'],
sample['id'],
'some-key',
'some-value',
)
print(json.dumps(new_attribute))
print(json.dumps(client.sample_get(sample['dataset_id'], sample['id'])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.