Skip to content
Merged
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`~/.galileo/` on logout/reset is now named `splunk-ao-config.json` (was
`galileo-python-config.json`). The old file can be deleted or ignored — it is
never read back and has no effect on authentication or config resolution.
- **Evaluator terminology alignment in docs and errors**: Updated
`SplunkAOEvaluators` docstrings, agent stream/evaluator API docstrings, and
user-visible error messages to use evaluator and agent stream vocabulary following
the `SplunkAOMetrics` → `SplunkAOEvaluators` rename. Enum values are documented
as matching scorer labels via the legacy `/scorers` API paths. The public
`metrics=` parameter name is unchanged for API compatibility. Renamed stale
`test_galileo_metrics_*` and `test_lookup_by_galileo_metrics_enum` test identifiers.

## [0.1.1] - 2026-08-03

Expand Down
5 changes: 3 additions & 2 deletions docs/domain-entity-rename.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ streams = AgentStream.list(project_name="my-project")

# Enable evaluators on the stream
from splunk_ao.schema.metrics import SplunkAOEvaluators
stream.enable_evaluators([SplunkAOEvaluators.correctness, SplunkAOEvaluators.completeness])
stream.set_metrics([SplunkAOEvaluators.correctness, SplunkAOEvaluators.completeness])
```

```python
Expand Down Expand Up @@ -187,7 +187,8 @@ from splunk_ao.metrics import … → from splunk_ao.evaluators import
project.create_log_stream(…) → project.create_agent_stream(…)
project.list_log_streams(…) → project.list_agent_streams(…)
project.logstreams → project.agent_streams
enable_metrics(…) → enable_evaluators(…)
log_stream.enable_metrics(…) → agent_stream.set_metrics(…)
enable_metrics(…) → enable_evaluators(…) (AgentStreams service / module-level only)
delete_metric(…) → delete_evaluator(…)
get_metrics(…) → get_evaluators(…)
create_custom_llm_metric(…) → create_custom_llm_evaluator(…)
Expand Down
36 changes: 18 additions & 18 deletions src/splunk_ao/agent_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ class AgentStream(StateManagementMixin):
project = Project.get(name="My AI Project")
agent_stream = project.create_agent_stream(name="Production Logs")

# Enable metrics on the log stream
# Enable evaluators on the agent stream
from splunk_ao.schema.metrics import SplunkAOEvaluators
local_metrics = log_stream.enable_evaluators([
local_evaluators = agent_stream.set_metrics([
SplunkAOEvaluators.correctness,
SplunkAOEvaluators.completeness,
"context_relevance"
])

# Refresh log stream state from API
log_stream.refresh()
# Refresh agent stream state from API
agent_stream.refresh()
"""

created_at: datetime | None
Expand Down Expand Up @@ -408,21 +408,21 @@ def refresh(self) -> None:

def get_metrics(self) -> builtins.list[str]:
"""
Get the list of metrics currently enabled on this log stream.
Get the list of evaluators currently enabled on this agent stream.

Returns
-------
list[str]: List of metric names currently enabled.
list[str]: List of evaluator names currently enabled.

Raises
------
ValueError: If the log stream lacks required id or project_id attributes.
ValueError: If the agent stream lacks required id or project_id attributes.

Examples
--------
agent_stream = AgentStream.get(name="Production Logs", project_name="My Project")
current_metrics = log_stream.get_metrics()
print(f"Currently enabled: {current_metrics}")
current_evaluators = agent_stream.get_metrics()
print(f"Currently enabled: {current_evaluators}")
"""
logger.info(f"AgentStream.get_metrics: id='{self.id}' - started")
config = SplunkAOConfig.get()
Expand All @@ -444,26 +444,26 @@ def set_metrics(
self, metrics: builtins.list[SplunkAOEvaluators | Metric | LocalMetricConfig | str]
) -> builtins.list[LocalMetricConfig]:
"""
Set (replace) the metrics on this log stream.
Set (replace) the evaluators on this agent stream.

This replaces any existing metrics with the new list. Alias for enable_metrics
with clearer naming intent.
This replaces any existing evaluators with the new list. The ``metrics`` parameter
name is retained for API compatibility.

Args:
metrics: List of metrics to set. Supports:
metrics: List of evaluators to set. Supports:
- SplunkAOEvaluators enum values (e.g., SplunkAOEvaluators.correctness)
- Metric objects (including from Metric.get(id="..."))
- LocalMetricConfig objects for custom scoring functions
- String names of built-in metrics
- String names of built-in evaluators

Returns
-------
List[LocalMetricConfig]: Local metric configurations that must be
List[LocalMetricConfig]: Local evaluator configurations that must be
computed client-side.

Raises
------
ValueError: If any specified metrics are unknown.
ValueError: If any specified evaluators are unknown.

Examples
--------
Expand All @@ -472,7 +472,7 @@ def set_metrics(
agent_stream = AgentStream.get(name="Production Logs", project_name="My Project")

# Set evaluators (replaces existing)
log_stream.set_metrics([
agent_stream.set_metrics([
Evaluator.metrics.correctness,
Evaluator.metrics.completeness,
Evaluator.get(id="evaluator-from-console-uuid"), # From console
Expand All @@ -483,7 +483,7 @@ def set_metrics(
agent_streams_svc = AgentStreams()
agent_stream = agent_streams_svc.get(name=self.name, project_id=self.project_id)
if agent_stream is None:
raise ValueError(f"Log stream '{self.name}' not found")
raise ValueError(f"Agent stream '{self.name}' not found")
result = agent_stream.enable_evaluators(metrics)
# Set state to synced after successful operation
self._set_state(SyncState.SYNCED)
Expand Down
Loading
Loading