Experiment Tags functionality for managing tags on experiments.

ExperimentTagsAPIException Objects

class ExperimentTagsAPIException(APIException)
Exception raised when experiment tags operations fail.

ExperimentTag Objects

class ExperimentTag(RunTagDB)
Wrapper class for experiment tags that provides additional functionality.

ExperimentTags Objects

class ExperimentTags(DecorateAllMethods)

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 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

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