Skip to content

Commit be13ebd

Browse files
committed
address review: use logger.warning + debug instead of logger.exception
1 parent 814d039 commit be13ebd

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/agents/realtime/session.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,8 +987,14 @@ async def _run_output_guardrails(self, text: str, response_id: str) -> bool:
987987
)
988988
if result.output.tripwire_triggered:
989989
triggered_results.append(result)
990-
except Exception:
991-
logger.exception("Output guardrail %r raised an exception", guardrail.get_name())
990+
except Exception as exc:
991+
logger.warning(
992+
"Output guardrail %r raised %s: %s; skipping it.",
993+
guardrail.get_name(),
994+
type(exc).__name__,
995+
exc,
996+
)
997+
logger.debug("Output guardrail failure details.", exc_info=True)
992998
continue
993999

9941000
if triggered_results:

0 commit comments

Comments
 (0)