DocumentationAPI ReferenceRelease Notes
DocumentationLog In
Documentation

Data Download

Retrieving data from the Deepchecks platform for further analysis.

While the Deepchecks platform provides robust built-in analysis tools for most scenarios, there are situations where retrieving data to your local machine can offer additional flexibility and insights. Deepchecks SDK allows you to easily retrieve the data in addition to the calculated Properties, Topics, and more.

from deepchecks_llm_client.client import DeepchecksLLMClient
from deepchecks_llm_client.data_types import EnvType

# Init SDK's client and create an application
dc_client = DeepchecksLLMClient(api_token="YOUR API KEY")

# Get the data from the Deepchecks platform as DataFrame
dc_client.get_data(
    app_name="MyAppName", version_name="MyVersionName", environment=EnvType.EVAL,
    # Uncomment to filter by user_interaction_ids
    # user_interaction_ids=["id-1", "id-2", "id-3"],
    # Uncomment to filter by time range
    # start_time='2024-09-01T23:59:59', end_time=datetime.now().astimezone(),
)

Getting Results on Demand (CI/CD Integration)

In some cases, you may want to retrieve Deepchecks evaluation results as soon as they are ready. One main use case where this would be the case is when creating a CI/CD integration to verify the quality of a new pipeline before merging a pool request or as a condition before deployment.

This functionality is available via get_data_upon_completion which waits until the calculations are complete for the specified user interaction ids and then retrieves the evaluation results.

from deepchecks_llm_client.client import DeepchecksLLMClient
from deepchecks_llm_client.data_types import EnvType

# Init SDK's client and create an application
dc_client = DeepchecksLLMClient(api_token="YOUR API KEY")

# Get the data from the Deepchecks platform as DataFrame
dc_client.get_data_if_calculations_completed(
    app_name="MyAppName", version_name="MyVersionName", environment=EnvType.EVAL,
    user_interaction_ids=["id-1", "id-2", "id-3"],
    # Controls the frequency to check the status and maximum number of attempts.
    max_retries=60, retry_interval_in_seconds=10,
)