Skip to main content

Module

Experiment result wrapper for easy status access and monitoring.

ExperimentPhaseInfo

Wrapper for experiment phase status information. Provides easy access to phase-level progress and status information for an experiment. Examples

Access phase information from experiment status

experiment = Experiment.get(name=“ml-eval”, project_name=“My Project”) status = experiment.get_status() log_gen = status.log_generation if log_gen.is_complete: print(“Log generation phase completed!”) elif log_gen.is_in_progress: print(f”Log generation at {log_gen.progress_percent:.1f}%“)

Check phase status

print(f”Phase status: {log_gen}”) # Human-readable string

is_complete

Whether this phase is complete (progress >= 100%).

is_failed

Whether this phase failed. Currently always returns False.

is_in_progress

Whether this phase is in progress (0% < progress < 100%).

is_pending

Whether this phase hasn’t started yet (progress = 0%).

to_dict

Convert the phase info to a dictionary. Examples phase_dict = status.log_generation.to_dict() print(phase_dict[“progress_percent”]) print(phase_dict[“is_complete”])

ExperimentStatusInfo

Wrapper for experiment status information. Provides human-readable access to experiment execution status, including progress tracking and phase-level information. Examples

Get status information

experiment = Experiment.get(name=“ml-eval”, project_name=“My Project”) status = experiment.get_status()

Human-readable output

print(status) # “Experiment Running (45.2%)” print(f”Log Generation: {status.log_generation}”) # “In Progress (45.2%)“

Check status

if status.is_complete: print(“Experiment completed!”) elif status.is_in_progress: print(f”Progress: {status.overall_progress:.1f}%”) elif status.is_pending: print(“Experiment hasn’t started yet”)

Convert to dictionary

status_dict = status.to_dict() print(status_dict[“overall_progress”])

from_result

Create from experiment.run() result dictionary. Arguments
  • result: Dictionary returned from Experiment.run().

is_complete

Whether the experiment is complete (all phases at 100%).

is_failed

Whether the experiment has failed. Currently always returns False.

is_in_progress

Whether the experiment is currently running (0% < progress < 100%).

is_pending

Whether the experiment hasn’t started yet (progress = 0%).

overall_progress

Overall progress percentage across all phases. Currently uses log_generation progress. In the future, this may average multiple phase progress values.

Returns

float: Progress percentage from 0.0 to 100.0.

to_dict

Convert the status info to a dictionary. Examples status = experiment.get_status() status_dict = status.to_dict() print(status_dict[“overall_progress”]) print(status_dict[“log_generation”][“is_complete”])

ExperimentRunResult

Wrapper for experiment.run() result with human-readable access. Provides easy access to experiment run information including the link, status, and underlying experiment response. This wrapper makes it simple to work with experiment run results by exposing commonly needed information through intuitive properties and methods. Examples

Run an experiment and access the result

experiment = Experiment( name=“ml-evaluation”, dataset_name=“ml-dataset”, prompt_name=“ml-prompt”, project_name=“My AI Project” ).create() result = experiment.run()

Access basic information

print(result) # Human-readable summary print(f”View results: {result.link}”) print(f”Experiment ID: {result.experiment_id}“)

Check status

if result.status.is_in_progress: print(f”Progress: {result.status.overall_progress:.1f}%”) elif result.status.is_complete: print(“Experiment completed!”)

Get dataset and prompt information

if result.dataset_info: print(f”Dataset: {result.dataset_info[‘name’]}”) if result.prompt_info: print(f”Prompt: {result.prompt_info[‘name’]}“)

Convert to dictionary

result_dict = result.to_dict() print(result_dict[“link”])

dataset_info

Get dataset information if available. Examples result = experiment.run() if result.dataset_info: print(f”Dataset: {result.dataset_info[‘name’]}”) print(f”Version: {result.dataset_info[‘version’]}“)

experiment

Get the underlying ExperimentResponse object.

Returns

ExperimentResponse: The raw API response object.

prompt_info

Get prompt information if available. Examples result = experiment.run() if result.prompt_info: print(f”Prompt: {result.prompt_info[‘name’]}”) print(f”ID: {result.prompt_info[‘id’]}“)

to_dict

Convert the result to a dictionary. Examples result = experiment.run() result_dict = result.to_dict() print(result_dict[“link”]) print(result_dict[“status”][“overall_progress”])