Skip to main content

class OnAddArtifactAlias

*,
event_type: Literal[ADD_ARTIFACT_ALIAS] = ADD_ARTIFACT_ALIAS,
scope: typing.Annotated[wandb.automations.scopes._ArtifactSequenceScope | wandb.automations.scopes._ArtifactPortfolioScope | wandb.automations.scopes.ProjectScope, BeforeValidator(func=<function parse_scope>, json_schema_input_type=PydanticUndefined)],
filter: typing.Annotated[wandb.automations._filters.operators.And | wandb.automations._filters.operators.Or | wandb.automations._filters.operators.Nor | wandb.automations._filters.operators.Not | wandb.automations._filters.operators.Lt | wandb.automations._filters.operators.Gt | wandb.automations._filters.operators.Lte | wandb.automations._filters.operators.Gte | wandb.automations._filters.operators.Eq | wandb.automations._filters.operators.Ne | wandb.automations._filters.operators.In | wandb.automations._filters.operators.NotIn | wandb.automations._filters.operators.Exists | wandb.automations._filters.operators.Regex | wandb.automations._filters.operators.Contains | wandb.automations._filters.expressions.FilterExpr | dict[str, typing.Any], Json, BeforeValidator(func=<function ensure_json>, json_schema_input_type=PydanticUndefined), PlainSerializer(func=<function to_json>, return_type=PydanticUndefined, when_used='always'), AfterValidator(func=<function wrap_mutation_event_filter>)] = And(())

Description

A new alias is assigned to an artifact.

Args

  • event_type:
  • scope: The scope of the event.
  • filter: Additional conditions(s), if any, that are required for this event to trigger.

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"),
)

Methods

method then

self,
action: 'InputAction'
Define a new Automation in which this event triggers the given action.
Arguments
  • action: