Skip to main content
GitHub source

class OnAddArtifactAlias

A new alias is assigned to an artifact. Examples: Define an event that triggers whenever the alias “prod” is assigned to any artifact in the collection “my-collection”:
from wandb import Api
from wandb.automations import OnAddArtifactAlias, ArtifactEvent

api = Api()
collection = api.artifact_collection(name="my-collection", type_name="model")

event = OnAddArtifactAlias(
    scope=collection,
    filter=ArtifactEvent.alias.eq("prod"),
)

method OnAddArtifactAlias.__init__

__init__(
    event_type: 'Literal[ADD_ARTIFACT_ALIAS]' = ADD_ARTIFACT_ALIAS,
    scope: '_ArtifactSequenceScope | _ArtifactPortfolioScope | ProjectScope',
    filter: 'And | Or | Nor | Not | Lt | Gt | Lte | Gte | Eq | Ne | In | NotIn | Exists | Regex | Contains | FilterExpr | dict[str, Any]' = And(())
) → None
Args:
  • event_type (Literal[ADD_ARTIFACT_ALIAS]):
  • scope (Union[_ArtifactSequenceScope, _ArtifactPortfolioScope, ProjectScope]): The scope of the event.
  • filter (Union[And, Or, Nor, Not, Lt, Gt, Lte, Gte, Eq, Ne, In, NotIn, Exists, Regex, Contains, FilterExpr, Dict[str, Any]]): Additional conditions(s), if any, that are required for this event to trigger.
Returns: An OnAddArtifactAlias object.