From d4093258600fd4ca1f26bb319a2d80b703ee3323 Mon Sep 17 00:00:00 2001 From: MUHAMMAD SALMAN HUSSAIN <160324527+mshsheikh@users.noreply.github.com> Date: Sat, 26 Jul 2025 08:43:09 +0500 Subject: [PATCH 1/3] Fix grammar issues in guardrail documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. ✅ Fixed article usage ("a" to "an") before class names starting with vowel sounds 2. ✅ Corrected possessive form ("function name" to "function's name") 3. ✅ Removed redundant word ("do" in "to do check" → "to check") --- src/agents/guardrail.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/agents/guardrail.py b/src/agents/guardrail.py index 630c6f5d4..93154ef21 100644 --- a/src/agents/guardrail.py +++ b/src/agents/guardrail.py @@ -79,7 +79,7 @@ class InputGuardrail(Generic[TContext]): create an `InputGuardrail` manually. Guardrails return a `GuardrailResult`. If `result.tripwire_triggered` is `True`, the agent - execution will immediately stop and a `InputGuardrailTripwireTriggered` exception will be raised + execution will immediately stop and an `InputGuardrailTripwireTriggered` exception will be raised """ guardrail_function: Callable[ @@ -127,12 +127,12 @@ async def run( @dataclass class OutputGuardrail(Generic[TContext]): """Output guardrails are checks that run on the final output of an agent. - They can be used to do check if the output passes certain validation criteria + They can be used to check if the output passes certain validation criteria You can use the `@output_guardrail()` decorator to turn a function into an `OutputGuardrail`, or create an `OutputGuardrail` manually. - Guardrails return a `GuardrailResult`. If `result.tripwire_triggered` is `True`, a + Guardrails return a `GuardrailResult`. If `result.tripwire_triggered` is `True`, an `OutputGuardrailTripwireTriggered` exception will be raised. """ @@ -316,7 +316,7 @@ def decorator( ) -> OutputGuardrail[TContext_co]: return OutputGuardrail( guardrail_function=f, - # Guardrail name defaults to function name when not specified (None). + # Guardrail name defaults to function's name when not specified (None). name=name if name else f.__name__, ) From 173aaac405eefd0eea9d4a2c76161c26a5942bac Mon Sep 17 00:00:00 2001 From: MUHAMMAD SALMAN HUSSAIN <160324527+mshsheikh@users.noreply.github.com> Date: Sat, 26 Jul 2025 09:03:03 +0500 Subject: [PATCH 2/3] Fix documentation issues in guardrail module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Corrected multiple documentation issues across the guardrail implementation: - Fixed article usage ("a" → "an") before class names starting with vowel sounds - Corrected possessive forms ("function name" → "function's name") - Removed redundant words ("to do check" → "to check") - Resolved line length violations (E501) by restructuring long docstring lines --- src/agents/guardrail.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/agents/guardrail.py b/src/agents/guardrail.py index 93154ef21..d48883214 100644 --- a/src/agents/guardrail.py +++ b/src/agents/guardrail.py @@ -78,8 +78,9 @@ class InputGuardrail(Generic[TContext]): You can use the `@input_guardrail()` decorator to turn a function into an `InputGuardrail`, or create an `InputGuardrail` manually. - Guardrails return a `GuardrailResult`. If `result.tripwire_triggered` is `True`, the agent - execution will immediately stop and an `InputGuardrailTripwireTriggered` exception will be raised + Guardrails return a `GuardrailResult`. If `result.tripwire_triggered` is `True`, + the agent's execution will immediately stop, and + an `InputGuardrailTripwireTriggered` exception will be raised """ guardrail_function: Callable[ From bd173739af5dc2af410c93ffd32c4268a5b6e775 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 28 Jul 2025 14:12:10 +0900 Subject: [PATCH 3/3] Update src/agents/guardrail.py --- src/agents/guardrail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agents/guardrail.py b/src/agents/guardrail.py index d48883214..99e287675 100644 --- a/src/agents/guardrail.py +++ b/src/agents/guardrail.py @@ -128,7 +128,7 @@ async def run( @dataclass class OutputGuardrail(Generic[TContext]): """Output guardrails are checks that run on the final output of an agent. - They can be used to check if the output passes certain validation criteria + They can be used to do check if the output passes certain validation criteria You can use the `@output_guardrail()` decorator to turn a function into an `OutputGuardrail`, or create an `OutputGuardrail` manually.