Skip to main content

Module

Experiment Tags functionality for managing tags on experiments.

ExperimentTagsAPIException

Exception raised when experiment tags operations fail.

ExperimentTag

Wrapper class for experiment tags that provides additional functionality.

ExperimentTags

delete_experiment_tag

def delete_experiment_tag(self,
                          project_id: str,
                          experiment_id: str,
                          tag_id: str) -> dict[str, str]
Delete a specific tag from an experiment. Arguments
  • project_id: The project ID
  • experiment_id: The experiment ID
  • tag_id: The tag ID to delete
Raises
  • ExperimentTagsAPIException: If the API call fails
  • ValueError: If the experiment or tag is not found
Returns
  • dict[str, str]: Success message

get_experiment_tags

def get_experiment_tags(self,
                        project_id: str,
                        experiment_id: str) -> list[ExperimentTag]
Get all tags for a specific experiment.

Parameters

project_id The project ID experiment_id The experiment ID

Returns

list[ExperimentTag] List of tags associated with the experiment

Raises

ExperimentTagsAPIException If the API call fails ValueError If the experiment is not found

upsert_experiment_tag

def upsert_experiment_tag(self,
                          project_id: str,
                          experiment_id: str,
                          key: str,
                          value: str,
                          tag_type: str='generic') -> ExperimentTag
Upsert a tag for a specific experiment. Arguments
  • project_id: The project ID
  • experiment_id: The experiment ID
  • key: The tag key
  • value: The tag value
  • tag_type: The type of tag (default: “generic”)
Raises
  • ExperimentTagsAPIException: If the API call fails
  • ValueError: If the experiment is not found
Returns
  • ExperimentTag: The created or updated tag

delete_experiment_tag

def delete_experiment_tag(project_id: str,
                          experiment_id: str,
                          tag_id: str) -> dict[str, str]
Delete a specific tag from an experiment. Arguments
  • project_id: The project ID
  • experiment_id: The experiment ID
  • tag_id: The tag ID to delete
Raises
  • ExperimentTagsAPIException: If the API call fails
  • ValueError: If the experiment or tag is not found
Returns
  • dict[str, str]: Success message

get_experiment_tags

def get_experiment_tags(project_id: str, experiment_id: str) -> list[ExperimentTag]
Get all tags for a specific experiment. Arguments
  • project_id: The project ID
  • experiment_id: The experiment ID
Raises
  • ExperimentTagsAPIException: If the API call fails
  • ValueError: If the experiment is not found
Returns
  • list[ExperimentTag]: List of tags associated with the experiment

upsert_experiment_tag

def upsert_experiment_tag(project_id: str,
                          experiment_id: str,
                          key: str,
                          value: str,
                          tag_type: str='generic') -> ExperimentTag
Upsert (create or update) a tag for a specific experiment. Arguments
  • project_id: The project ID
  • experiment_id: The experiment ID
  • key: The tag key
  • value: The tag value
  • tag_type: The type of tag (default: “generic”)
Raises
  • ExperimentTagsAPIException: If the API call fails
  • ValueError: If the experiment is not found
Returns
  • ExperimentTag: The created or updated tag