Skip to content

Conversation

@axl1313
Copy link
Collaborator

@axl1313 axl1313 commented Jul 30, 2024

Description

Adds Cleanlab Studio Beta API functionality. This API will be used to upload datasets and run experimental jobs for customer POCs.

The main class that users will interact with is the StudioBeta class. This class has methods to upload datasets, run jobs, download results from a job, and list a user's datasets/jobs. The BetaDataset and BetaJob classes provide information about a dataset/job and some methods to interact w/ the dataset/job.

How to test

The experimental API is fully functional in staging. If you enable the TEMPLATE_JOB_ENABLED feature flag for yourself in staging, you can test running the job definition named "template" by running the following (can also test that you get an error if you try to run the job without the feature flag enabled):

from cleanlab_studio.studio_beta import StudioBeta

studio_beta = StudioBeta("<API_KEY>")
dataset = studio_beta.upload_dataset("<path to some csv file>")
job = studio_beta.run_job(dataset.id, "template")
job.wait_until_ready()
job.download_results("<path you'd like to save results to>")

You can also test listing datasets and jobs:

datasets = studio_beta.list_datasets()
jobs = studio_beta.list_jobs()

@axl1313 axl1313 force-pushed the feat/experimental-api branch 5 times, most recently from 4311f63 to 8d17e0c Compare August 1, 2024 06:17
@axl1313 axl1313 marked this pull request as ready for review August 1, 2024 22:15
@axl1313 axl1313 force-pushed the feat/experimental-api branch from 1953af8 to 1570a61 Compare August 12, 2024 16:48
return retval


def handle_api_error(res: requests.Response) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the code duplicated here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants