diff --git a/docs.json b/docs.json
index f8ae7178f1..f1002bc068 100644
--- a/docs.json
+++ b/docs.json
@@ -579,12 +579,15 @@
"models/ref/python/automations/automation",
"models/ref/python/automations/donothing",
"models/ref/python/automations/metricchangefilter",
+ "models/ref/python/automations/metriczscorefilter",
"models/ref/python/automations/metricthresholdfilter",
"models/ref/python/automations/newautomation",
"models/ref/python/automations/onaddartifactalias",
"models/ref/python/automations/oncreateartifact",
"models/ref/python/automations/onlinkartifact",
"models/ref/python/automations/onrunmetric",
+ "models/ref/python/automations/onrunstate",
+ "models/ref/python/automations/runstatefilter",
"models/ref/python/automations/sendnotification",
"models/ref/python/automations/sendwebhook"
]
diff --git a/models/ref/python/automations/metricthresholdfilter.mdx b/models/ref/python/automations/metricthresholdfilter.mdx
index 88f3ba44a6..18587f72b8 100644
--- a/models/ref/python/automations/metricthresholdfilter.mdx
+++ b/models/ref/python/automations/metricthresholdfilter.mdx
@@ -10,7 +10,10 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx';
## class `MetricThresholdFilter`
-Filter that compares a metric value against a user-defined threshold.
+Filter that compares an **absolute** metric value against a user-defined threshold.
+
+The value may be a single value or an aggregated result over a window of
+multiple values.
### method `MetricThresholdFilter.__init__`
diff --git a/models/ref/python/automations/metriczscorefilter.mdx b/models/ref/python/automations/metriczscorefilter.mdx
new file mode 100644
index 0000000000..a477f05bec
--- /dev/null
+++ b/models/ref/python/automations/metriczscorefilter.mdx
@@ -0,0 +1,63 @@
+---
+title: MetricZScoreFilter
+namespace: automations_namespace
+python_object_type: class
+---
+import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx';
+
+
+
+
+
+## class `MetricZScoreFilter`
+Usage docs: https://docs.pydantic.dev/2.10/concepts/models/
+
+A base class for creating Pydantic models.
+
+Attributes:
+ __class_vars__: The names of the class variables defined on the model.
+ __private_attributes__: Metadata about the private attributes of the model.
+ __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model.
+
+ __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
+ __pydantic_core_schema__: The core schema of the model.
+ __pydantic_custom_init__: Whether the model has a custom `__init__` function.
+ __pydantic_decorators__: Metadata containing the decorators defined on the model.
+ This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1.
+ __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to
+ __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.
+ __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
+ __pydantic_post_init__: The name of the post-init method for the model, if defined.
+ __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel].
+ __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model.
+ __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model.
+
+ __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects.
+ __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects.
+
+ __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra]
+ is set to `'allow'`.
+ __pydantic_fields_set__: The names of fields explicitly set during instantiation.
+ __pydantic_private__: Values of private attributes set on the model instance.
+
+
+### method `MetricZScoreFilter.__init__`
+
+```python
+__init__(
+ name: 'str',
+ window: 'int' = 30,
+ threshold: 'Annotated | Annotated' = 3.0,
+ change_dir: 'ChangeDir' = ANY
+) → None
+```
+
+**Args:**
+
+ - `name` (str): Name of the observed metric.
+ - `window` (int): Size of the window to calculate the metric mean and standard deviation over.
+ - `threshold` (Union[Annotated, Annotated]): Threshold for the z-score.
+ - `change_dir` (ChangeDir): Direction of the z-score change to watch for.
+
+**Returns:**
+ An `MetricZScoreFilter` object.
diff --git a/models/ref/python/automations/onaddartifactalias.mdx b/models/ref/python/automations/onaddartifactalias.mdx
index 3667ff4de1..a0b5084396 100644
--- a/models/ref/python/automations/onaddartifactalias.mdx
+++ b/models/ref/python/automations/onaddartifactalias.mdx
@@ -12,6 +12,23 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx';
## 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":
+
+ ```python
+ 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__`
@@ -19,7 +36,7 @@ A new alias is assigned to an artifact.
__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 | dict[str, Any] | FilterExpr' = And([])
+ filter: 'And | Or | Nor | Not | Lt | Gt | Lte | Gte | Eq | Ne | In | NotIn | Exists | Regex | Contains | FilterExpr | dict[str, Any]' = And(())
) → None
```
@@ -27,7 +44,7 @@ __init__(
- `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, Dict[str, Any], FilterExpr]): Additional conditions(s), if any, that are required for this event to trigger.
+ - `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.
diff --git a/models/ref/python/automations/oncreateartifact.mdx b/models/ref/python/automations/oncreateartifact.mdx
index 5471563efc..948a5fb46d 100644
--- a/models/ref/python/automations/oncreateartifact.mdx
+++ b/models/ref/python/automations/oncreateartifact.mdx
@@ -12,6 +12,20 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx';
## class `OnCreateArtifact`
A new artifact is created.
+Examples:
+ Define an event that triggers when a new artifact is created in the
+ collection "my-collection":
+
+ ```python
+ from wandb import Api
+ from wandb.automations import OnCreateArtifact
+
+ api = Api()
+ collection = api.artifact_collection(name="my-collection", type_name="model")
+
+ event = OnCreateArtifact(scope=collection)
+ ```
+
### method `OnCreateArtifact.__init__`
@@ -19,7 +33,7 @@ A new artifact is created.
__init__(
event_type: 'Literal[CREATE_ARTIFACT]' = CREATE_ARTIFACT,
scope: '_ArtifactSequenceScope | _ArtifactPortfolioScope',
- filter: 'And | Or | Nor | Not | Lt | Gt | Lte | Gte | Eq | Ne | In | NotIn | Exists | Regex | Contains | dict[str, Any] | FilterExpr' = And([])
+ filter: 'And | Or | Nor | Not | Lt | Gt | Lte | Gte | Eq | Ne | In | NotIn | Exists | Regex | Contains | FilterExpr | dict[str, Any]' = And(())
) → None
```
@@ -27,7 +41,7 @@ __init__(
- `event_type` (Literal[CREATE_ARTIFACT]):
- `scope` (Union[_ArtifactSequenceScope, _ArtifactPortfolioScope]): The scope of the event: must be an artifact collection.
- - `filter` (Union[And, Or, Nor, Not, Lt, Gt, Lte, Gte, Eq, Ne, In, NotIn, Exists, Regex, Contains, Dict[str, Any], FilterExpr]): Additional conditions(s), if any, that are required for this event to trigger.
+ - `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 `OnCreateArtifact` object.
diff --git a/models/ref/python/automations/onlinkartifact.mdx b/models/ref/python/automations/onlinkartifact.mdx
index 08fe6f2d75..8b9198718a 100644
--- a/models/ref/python/automations/onlinkartifact.mdx
+++ b/models/ref/python/automations/onlinkartifact.mdx
@@ -12,6 +12,23 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx';
## class `OnLinkArtifact`
A new artifact is linked to a collection.
+Examples:
+ Define an event that triggers when an artifact is linked to the
+ collection "my-collection" with the alias "prod":
+
+ ```python
+ from wandb import Api
+ from wandb.automations import OnLinkArtifact, ArtifactEvent
+
+ api = Api()
+ collection = api.artifact_collection(name="my-collection", type_name="model")
+
+ event = OnLinkArtifact(
+ scope=collection,
+ filter=ArtifactEvent.alias.eq("prod"),
+ )
+ ```
+
### method `OnLinkArtifact.__init__`
@@ -19,7 +36,7 @@ A new artifact is linked to a collection.
__init__(
event_type: 'Literal[LINK_ARTIFACT]' = LINK_ARTIFACT,
scope: '_ArtifactSequenceScope | _ArtifactPortfolioScope | ProjectScope',
- filter: 'And | Or | Nor | Not | Lt | Gt | Lte | Gte | Eq | Ne | In | NotIn | Exists | Regex | Contains | dict[str, Any] | FilterExpr' = And([])
+ filter: 'And | Or | Nor | Not | Lt | Gt | Lte | Gte | Eq | Ne | In | NotIn | Exists | Regex | Contains | FilterExpr | dict[str, Any]' = And(())
) → None
```
@@ -27,7 +44,7 @@ __init__(
- `event_type` (Literal[LINK_ARTIFACT]):
- `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, Dict[str, Any], FilterExpr]): Additional conditions(s), if any, that are required for this event to trigger.
+ - `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 `OnLinkArtifact` object.
diff --git a/models/ref/python/automations/onrunmetric.mdx b/models/ref/python/automations/onrunmetric.mdx
index 61c2fca29e..ec947118fb 100644
--- a/models/ref/python/automations/onrunmetric.mdx
+++ b/models/ref/python/automations/onrunmetric.mdx
@@ -12,12 +12,29 @@ import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx';
## class `OnRunMetric`
A run metric satisfies a user-defined condition.
+Examples:
+ Define an event that triggers for any run in project "my-project" when
+ the average of the last 5 values of metric "my-metric" exceeds 123.45:
+
+ ```python
+ from wandb import Api
+ from wandb.automations import OnRunMetric, RunEvent
+
+ api = Api()
+ project = api.project(name="my-project")
+
+ event = OnRunMetric(
+ scope=project,
+ filter=RunEvent.metric("my-metric").avg(5).gt(123.45),
+ )
+ ```
+
### method `OnRunMetric.__init__`
```python
__init__(
- event_type: 'Literal[RUN_METRIC_THRESHOLD, RUN_METRIC_CHANGE]',
+ event_type: 'Literal[RUN_METRIC_THRESHOLD, RUN_METRIC_CHANGE, RUN_METRIC_ZSCORE]',
scope: 'ProjectScope',
filter: 'RunMetricFilter'
) → None
@@ -25,7 +42,7 @@ __init__(
**Args:**
- - `event_type` (Literal[RUN_METRIC_THRESHOLD, RUN_METRIC_CHANGE]):
+ - `event_type` (Literal[RUN_METRIC_THRESHOLD, RUN_METRIC_CHANGE, RUN_METRIC_ZSCORE]):
- `scope` (ProjectScope): The scope of the event: must be a project.
- `filter` (RunMetricFilter): Run and/or metric condition(s) that must be satisfied for this event to trigger.
diff --git a/models/ref/python/automations/onrunstate.mdx b/models/ref/python/automations/onrunstate.mdx
new file mode 100644
index 0000000000..0b244da66f
--- /dev/null
+++ b/models/ref/python/automations/onrunstate.mdx
@@ -0,0 +1,50 @@
+---
+title: OnRunState
+namespace: automations_namespace
+python_object_type: class
+---
+import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx';
+
+
+
+
+
+## class `OnRunState`
+A run state changes.
+
+Examples:
+ Define an event that triggers for any run in project "my-project" when
+ its state changes to "finished" (i.e. succeeded) or "failed":
+
+ ```python
+ from wandb import Api
+ from wandb.automations import OnRunState
+
+ api = Api()
+ project = api.project(name="my-project")
+
+ event = OnRunState(
+ scope=project,
+ filter=RunEvent.state.in_(["finished", "failed"]),
+ )
+ ```
+
+
+### method `OnRunState.__init__`
+
+```python
+__init__(
+ event_type: 'Literal[RUN_STATE]' = RUN_STATE,
+ scope: 'ProjectScope',
+ filter: 'RunStateFilter'
+) → None
+```
+
+**Args:**
+
+ - `event_type` (Literal[RUN_STATE]):
+ - `scope` (ProjectScope): The scope of the event: must be a project.
+ - `filter` (RunStateFilter): Run state condition(s) that must be satisfied for this event to trigger.
+
+**Returns:**
+ An `OnRunState` object.
diff --git a/models/ref/python/automations/runstatefilter.mdx b/models/ref/python/automations/runstatefilter.mdx
new file mode 100644
index 0000000000..1a1fbadbca
--- /dev/null
+++ b/models/ref/python/automations/runstatefilter.mdx
@@ -0,0 +1,59 @@
+---
+title: RunStateFilter
+namespace: automations_namespace
+python_object_type: class
+---
+import { GitHubLink } from '/snippets/en/_includes/github-source-link.mdx';
+
+
+
+
+
+## class `RunStateFilter`
+Usage docs: https://docs.pydantic.dev/2.10/concepts/models/
+
+A base class for creating Pydantic models.
+
+Attributes:
+ __class_vars__: The names of the class variables defined on the model.
+ __private_attributes__: Metadata about the private attributes of the model.
+ __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model.
+
+ __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.
+ __pydantic_core_schema__: The core schema of the model.
+ __pydantic_custom_init__: Whether the model has a custom `__init__` function.
+ __pydantic_decorators__: Metadata containing the decorators defined on the model.
+ This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1.
+ __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to
+ __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.
+ __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.
+ __pydantic_post_init__: The name of the post-init method for the model, if defined.
+ __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel].
+ __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model.
+ __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model.
+
+ __pydantic_fields__: A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects.
+ __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects.
+
+ __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra]
+ is set to `'allow'`.
+ __pydantic_fields_set__: The names of fields explicitly set during instantiation.
+ __pydantic_private__: Values of private attributes set on the model instance.
+
+
+### method `RunStateFilter.__init__`
+
+```python
+__init__(
+ run: 'And | Or | Nor | Not | Lt | Gt | Lte | Gte | Eq | Ne | In | NotIn | Exists | Regex | Contains | FilterExpr | dict[str, Any]' = And(()),
+ state: 'StateFilter'
+) → None
+```
+
+**Args:**
+
+ - `run` (Union[And, Or, Nor, Not, Lt, Gt, Lte, Gte, Eq, Ne, In, NotIn, Exists, Regex, Contains, FilterExpr, Dict[str, Any]]): Filters that must match any runs that will trigger this event.
+ - `state` (StateFilter): Run state condition(s) that must be satisfied for this event to trigger.
+
+**Returns:**
+ An `RunStateFilter` object.
diff --git a/models/ref/python/automations/sendwebhook.mdx b/models/ref/python/automations/sendwebhook.mdx
index 6f593e1723..f2fef31c07 100644
--- a/models/ref/python/automations/sendwebhook.mdx
+++ b/models/ref/python/automations/sendwebhook.mdx
@@ -37,7 +37,7 @@ __init__(
```python
from_integration(
integration: 'WebhookIntegration',
- payload: 'Optional[SerializedToJson[dict[str, Any]]]' = None
+ payload: 'Optional[JsonEncoded[dict[str, Any]]]' = None
) → Self
```
diff --git a/models/ref/python/experiments/run.mdx b/models/ref/python/experiments/run.mdx
index 45b197b6c0..881962fd85 100644
--- a/models/ref/python/experiments/run.mdx
+++ b/models/ref/python/experiments/run.mdx
@@ -767,8 +767,8 @@ Declare an artifact as an output of a run.
log_code(
root: 'str | None' = '.',
name: 'str | None' = None,
- include_fn: 'Callable[[str, str], bool] | Callable[[str], bool]' = ,
- exclude_fn: 'Callable[[str, str], bool] | Callable[[str], bool]' =
+ include_fn: 'Callable[[str, str], bool] | Callable[[str], bool]' = ,
+ exclude_fn: 'Callable[[str, str], bool] | Callable[[str], bool]' =
) → Artifact | None
```
diff --git a/models/ref/python/experiments/settings.mdx b/models/ref/python/experiments/settings.mdx
index 4d4ca099a8..f262e3326f 100644
--- a/models/ref/python/experiments/settings.mdx
+++ b/models/ref/python/experiments/settings.mdx
@@ -34,7 +34,7 @@ The settings are organized into three categories:
__init__(
allow_offline_artifacts: 'bool' = True,
allow_val_change: 'bool' = False,
- anonymous: 'Literal['allow', 'must', 'never'] | None' = None,
+ anonymous: 'object' =