Skip to main content

class OnAddArtifactTag

*,
event_type: Literal[ADD_ARTIFACT_TAG] = ADD_ARTIFACT_TAG,
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 tag is assigned to an artifact version.

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 tag “prod” is assigned to any artifact version in the collection “my-collection”:
from wandb import Api
from wandb.automations import OnAddArtifactTag, ArtifactEvent

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

event = OnAddArtifactTag(
    scope=collection,
    filter=ArtifactEvent.tag.eq("prod"),
)

Methods

method then

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