Skip to content

Commit 11b7240

Browse files
committed
Revert "added logs and identity log to llm and luna evaluators"
This reverts commit ff00a4f.
1 parent ff00a4f commit 11b7240

2 files changed

Lines changed: 6 additions & 82 deletions

File tree

‎evaluators/contrib/galileo/src/agent_control_evaluator_galileo/llm/evaluator.py‎

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -252,23 +252,10 @@ def _execution_context_from_extensions(
252252
if not isinstance(organization_id, str) or not organization_id:
253253
raise ValueError("Authenticated execution metadata is missing organization_id")
254254

255-
resolved_user_id = user_id if isinstance(user_id, str) and user_id else None
256-
resolved_project_id = project_id if isinstance(project_id, str) and project_id else None
257-
raw_api_key = os.getenv("GALILEO_API_SECRET_KEY") or os.getenv("GALILEO_API_SECRET") or ""
258-
api_key_hint = f"...{raw_api_key[-4:]}" if len(raw_api_key) >= 4 else "***"
259-
logger.info(
260-
"[execution_context] caller_id=%r → user_id=%r org=%r project=%r run=%r api_key=%s",
261-
user_id,
262-
resolved_user_id,
263-
organization_id,
264-
resolved_project_id,
265-
run_id,
266-
api_key_hint,
267-
)
268255
return GalileoExecutionContext(
269256
organization_id=organization_id,
270-
user_id=resolved_user_id,
271-
project_id=resolved_project_id,
257+
user_id=user_id if isinstance(user_id, str) and user_id else None,
258+
project_id=project_id if isinstance(project_id, str) and project_id else None,
272259
run_id=run_id,
273260
)
274261

@@ -280,12 +267,8 @@ async def _evaluate(
280267
extensions: JSONObject | None = None,
281268
) -> EvaluatorResult:
282269
"""Run an LLM scorer evaluation with optional structured runtime context."""
283-
display = self.__class__.__name__
284-
scorer_id = self.config.scorer_id
285-
logger.info("[%s] Dispatching scorer evaluation: scorer_id=%s", display, scorer_id)
286270
input_text, output_text = self._prepare_payload(data)
287271
if not (_has_text(input_text) or _has_text(output_text)):
288-
logger.info("[%s] Skipping scorer invocation: no data to score", display)
289272
return EvaluatorResult(
290273
matched=False,
291274
confidence=1.0,
@@ -300,12 +283,6 @@ async def _evaluate(
300283
scorer_kwargs["step"] = step
301284
if execution_context is not None:
302285
scorer_kwargs["execution_context"] = execution_context
303-
logger.info(
304-
"[%s] Invoking scorer: scorer_id=%s timeout=%.1fs",
305-
display,
306-
scorer_id,
307-
self.get_timeout_seconds(),
308-
)
309286
response = await self._get_client().invoke(
310287
**scorer_kwargs,
311288
input=input_text if _has_text(input_text) else None,
@@ -323,15 +300,6 @@ async def _evaluate(
323300
operator = self.config.operator
324301
threshold = self.config.threshold
325302
state = "triggered" if matched else "not triggered"
326-
logger.info(
327-
"[%s] Scorer result: scorer_id=%s score=%r %s threshold=%r → %s",
328-
display,
329-
scorer_id,
330-
response.score,
331-
operator,
332-
threshold,
333-
state,
334-
)
335303
return EvaluatorResult(
336304
matched=matched,
337305
confidence=_confidence_from_score(response.score),
@@ -342,13 +310,7 @@ async def _evaluate(
342310
metadata=metadata,
343311
)
344312
except Exception as exc:
345-
logger.error(
346-
"[%s] Scorer evaluation error: scorer_id=%s error=%s",
347-
display,
348-
scorer_id,
349-
exc,
350-
exc_info=True,
351-
)
313+
logger.error("LLM scorer evaluation error: %s", exc, exc_info=True)
352314
return self._handle_error(exc)
353315

354316
def _base_metadata(self) -> dict[str, Any]:

‎evaluators/contrib/galileo/src/agent_control_evaluator_galileo/luna/evaluator.py‎

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -252,23 +252,10 @@ def _execution_context_from_extensions(
252252
if not isinstance(organization_id, str) or not organization_id:
253253
raise ValueError("Authenticated execution metadata is missing organization_id")
254254

255-
resolved_user_id = user_id if isinstance(user_id, str) and user_id else None
256-
resolved_project_id = project_id if isinstance(project_id, str) and project_id else None
257-
raw_api_key = os.getenv("GALILEO_API_SECRET_KEY") or os.getenv("GALILEO_API_SECRET") or ""
258-
api_key_hint = f"...{raw_api_key[-4:]}" if len(raw_api_key) >= 4 else "***"
259-
logger.info(
260-
"[execution_context] caller_id=%r → user_id=%r org=%r project=%r run=%r api_key=%s",
261-
user_id,
262-
resolved_user_id,
263-
organization_id,
264-
resolved_project_id,
265-
run_id,
266-
api_key_hint,
267-
)
268255
return GalileoExecutionContext(
269256
organization_id=organization_id,
270-
user_id=resolved_user_id,
271-
project_id=resolved_project_id,
257+
user_id=user_id if isinstance(user_id, str) and user_id else None,
258+
project_id=project_id if isinstance(project_id, str) and project_id else None,
272259
run_id=run_id,
273260
)
274261

@@ -280,12 +267,8 @@ async def _evaluate(
280267
extensions: JSONObject | None = None,
281268
) -> EvaluatorResult:
282269
"""Run a Luna evaluation with optional structured runtime context."""
283-
display = self.__class__.__name__
284-
scorer_id = self.config.scorer_id
285-
logger.info("[%s] Dispatching scorer evaluation: scorer_id=%s", display, scorer_id)
286270
input_text, output_text = self._prepare_payload(data)
287271
if not (_has_text(input_text) or _has_text(output_text)):
288-
logger.info("[%s] Skipping scorer invocation: no data to score", display)
289272
return EvaluatorResult(
290273
matched=False,
291274
confidence=1.0,
@@ -300,12 +283,6 @@ async def _evaluate(
300283
scorer_kwargs["step"] = step
301284
if execution_context is not None:
302285
scorer_kwargs["execution_context"] = execution_context
303-
logger.info(
304-
"[%s] Invoking scorer: scorer_id=%s timeout=%.1fs",
305-
display,
306-
scorer_id,
307-
self.get_timeout_seconds(),
308-
)
309286
response = await self._get_client().invoke(
310287
**scorer_kwargs,
311288
input=input_text if _has_text(input_text) else None,
@@ -323,15 +300,6 @@ async def _evaluate(
323300
operator = self.config.operator
324301
threshold = self.config.threshold
325302
state = "triggered" if matched else "not triggered"
326-
logger.info(
327-
"[%s] Scorer result: scorer_id=%s score=%r %s threshold=%r → %s",
328-
display,
329-
scorer_id,
330-
response.score,
331-
operator,
332-
threshold,
333-
state,
334-
)
335303
return EvaluatorResult(
336304
matched=matched,
337305
confidence=_confidence_from_score(response.score),
@@ -342,13 +310,7 @@ async def _evaluate(
342310
metadata=metadata,
343311
)
344312
except Exception as exc:
345-
logger.error(
346-
"[%s] Scorer evaluation error: scorer_id=%s error=%s",
347-
display,
348-
scorer_id,
349-
exc,
350-
exc_info=True,
351-
)
313+
logger.error("Luna evaluation error: %s", exc, exc_info=True)
352314
return self._handle_error(exc)
353315

354316
def _base_metadata(self) -> dict[str, Any]:

0 commit comments

Comments
 (0)