Skip to content

Commit 03bdfdc

Browse files
jsondaicopybara-github
authored andcommitted
feat: GenAI Client(evals) - auto-create EvaluationExperiment in create_evaluation_run
PiperOrigin-RevId: 951595957
1 parent 07ade2e commit 03bdfdc

11 files changed

Lines changed: 1500 additions & 17 deletions

File tree

agentplatform/_genai/_evals_common.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,21 @@
9090
AGENT_DATA = _evals_constant.AGENT_DATA
9191

9292

93+
def _local_timestamp() -> str:
94+
"""Returns the current local time as 'M/D/YYYY, H:MM:SS AM/PM'.
95+
96+
Matches the Agent Platform UI's default experiment name timestamp format
97+
(e.g. '6/1/2026, 1:12:29 PM').
98+
"""
99+
now = datetime.datetime.now()
100+
hour_12 = now.hour % 12 or 12
101+
meridiem = "AM" if now.hour < 12 else "PM"
102+
return (
103+
f"{now.month}/{now.day}/{now.year}, "
104+
f"{hour_12}:{now.minute:02d}:{now.second:02d} {meridiem}"
105+
)
106+
107+
93108
@contextlib.contextmanager
94109
def _temp_logger_level(logger_name: str, level: int) -> None: # type: ignore[misc]
95110
"""Temporarily sets the level of a logger."""

0 commit comments

Comments
 (0)