diff --git a/EvoScientist/usage/callback.py b/EvoScientist/usage/callback.py index 26620fb..d6c32bc 100644 --- a/EvoScientist/usage/callback.py +++ b/EvoScientist/usage/callback.py @@ -51,7 +51,7 @@ def usage_tracking_enabled() -> bool: for name in ( "EVOSCIENTIST_USAGE_SINK_URL", "EVOSCIENTIST_USAGE_SINK_TOKEN", - "EVOSCIENTIST_DEPLOYMENT_ID", + "EVOSCIENTIST_USAGE_DEPLOYMENT_ID", "EVOSCIENTIST_WORKSPACE_ID", "EVOSCIENTIST_USAGE_SPOOL_DIR", ) @@ -254,13 +254,13 @@ class UsageCaptureCallback(BaseCallbackHandler): event = UsageEventV1( schema_version=1, event_id=( - f"{os.environ['EVOSCIENTIST_DEPLOYMENT_ID']}:{run_id}:callback_final:1" + f"{os.environ['EVOSCIENTIST_USAGE_DEPLOYMENT_ID']}:{run_id}:callback_final:1" ), event_type="usage_observed", source="callback_final", authority_class="observed_final", revision=1, - deployment_id=os.environ["EVOSCIENTIST_DEPLOYMENT_ID"], + deployment_id=os.environ["EVOSCIENTIST_USAGE_DEPLOYMENT_ID"], workspace_id=os.environ["EVOSCIENTIST_WORKSPACE_ID"], model_call_id=run_id, parent_run_id=state.parent_run_id, diff --git a/EvoScientist/usage/identity.py b/EvoScientist/usage/identity.py index 55dee84..0352f1d 100644 --- a/EvoScientist/usage/identity.py +++ b/EvoScientist/usage/identity.py @@ -116,7 +116,7 @@ def prepare_usage_environment( f"http://127.0.0.1:{webui_port}/api/usage/events" ), "EVOSCIENTIST_USAGE_SINK_TOKEN": sink_token, - "EVOSCIENTIST_DEPLOYMENT_ID": deployment_id, + "EVOSCIENTIST_USAGE_DEPLOYMENT_ID": deployment_id, "EVOSCIENTIST_WORKSPACE_ID": workspace_id, "EVOSCIENTIST_USAGE_SPOOL_DIR": str(data_dir / "usage-spool"), } diff --git a/EvoScientist/usage/spool.py b/EvoScientist/usage/spool.py index 8c0d5e5..f24e583 100644 --- a/EvoScientist/usage/spool.py +++ b/EvoScientist/usage/spool.py @@ -65,7 +65,7 @@ class UsageSpool: def __init__(self) -> None: self.sink_url = os.environ["EVOSCIENTIST_USAGE_SINK_URL"] self.token = os.environ["EVOSCIENTIST_USAGE_SINK_TOKEN"] - self.deployment_id = os.environ["EVOSCIENTIST_DEPLOYMENT_ID"] + self.deployment_id = os.environ["EVOSCIENTIST_USAGE_DEPLOYMENT_ID"] self.workspace_id = os.environ["EVOSCIENTIST_WORKSPACE_ID"] self.root = Path(os.environ["EVOSCIENTIST_USAGE_SPOOL_DIR"]) if not self.root.is_absolute(): diff --git a/tests/test_usage_tracking.py b/tests/test_usage_tracking.py index 7990233..6cf1a9c 100644 --- a/tests/test_usage_tracking.py +++ b/tests/test_usage_tracking.py @@ -62,7 +62,7 @@ def _usage_environment(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None: "EVOSCIENTIST_USAGE_TRACKING": "true", "EVOSCIENTIST_USAGE_SINK_URL": "http://127.0.0.1:1/api/usage/events", "EVOSCIENTIST_USAGE_SINK_TOKEN": "test-token", - "EVOSCIENTIST_DEPLOYMENT_ID": "11111111-1111-4111-8111-111111111111", + "EVOSCIENTIST_USAGE_DEPLOYMENT_ID": "11111111-1111-4111-8111-111111111111", "EVOSCIENTIST_WORKSPACE_ID": "ws1_fixture", "EVOSCIENTIST_USAGE_SPOOL_DIR": str(tmp_path / "spool"), "EVOSCIENTIST_WORKSPACE_DIR": str(tmp_path),