Skip to content

Commit ee0e735

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

11 files changed

Lines changed: 1539 additions & 25 deletions

File tree

agentplatform/_genai/_evals_common.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,21 @@
9191
_DEFAULT_CANDIDATE_NAME = _evals_constant.DEFAULT_CANDIDATE_NAME
9292

9393

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

0 commit comments

Comments
 (0)