Skip to content

Conversation

@michi-okahata
Copy link
Contributor

@michi-okahata michi-okahata commented Jun 3, 2025

📥 Pull Request

📘 Description
Closes #1003, input/output guardrail decorators.

Unsure about naming conventions, currently in_guardrail and out_guardrail to avoid collisions with OpenAI's input_guardrail and output_guardrail.

The guardrail's inputs and outputs proper are not deserialized but I think that is a different issue as per Monday morning standup.

🧪 Testing
Only tested against OpenAI's input/output guardrail examples.

@codecov
Copy link

codecov bot commented Jun 3, 2025

Codecov Report

Attention: Patch coverage is 84.61538% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
agentops/sdk/decorators/factory.py 73.33% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@michi-okahata michi-okahata changed the title input/output guardrail decorator #1003 input/output guardrail decorator Jun 3, 2025
@bboynton97 bboynton97 mentioned this pull request Jun 4, 2025
@areibman areibman requested a review from dot-agi June 11, 2025 09:02
Copy link
Member

@dot-agi dot-agi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor bug.

Some more items are needed -

  1. An example in the examples/openai_agents directory that can be used by the users to understand the decorator's usage.
  2. Relevant docs in docs/v2 explaining the use of the decorator.

@dot-agi dot-agi self-requested a review June 11, 2025 22:21
Copy link
Member

@dot-agi dot-agi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @michi-okahata 🙌!

@dot-agi dot-agi merged commit eb34e26 into main Jun 11, 2025
10 checks passed
@dot-agi dot-agi deleted the guardrail_decorator branch June 11, 2025 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add a @guardrail decorator

5 participants