-
Notifications
You must be signed in to change notification settings - Fork 1
Comparing changes
Open a pull request
base repository: openlayer-ai/openlayer-python
base: v0.2.0-alpha.88
head repository: openlayer-ai/openlayer-python
compare: v0.2.0-alpha.89
- 14 commits
- 11 files changed
- 4 contributors
Commits on Sep 8, 2025
-
feat: add guardrails system with PII protection
- Add base guardrail architecture with GuardrailAction, BlockStrategy enums - Implement GuardrailResult dataclass for structured guardrail responses - Create BaseGuardrail abstract class for extensible guardrail implementations - Add PIIGuardrail using Microsoft Presidio for PII detection and redaction - Support multiple block strategies: raise exception, return empty, return error message, skip function - Include GuardrailRegistry for managing guardrail instances - Add comprehensive error handling and logging This foundational system enables flexible content filtering and protection for AI/LLM applications with configurable actions and strategies.
Configuration menu - View commit details
-
Copy full SHA for 0bcc636 - Browse repository at this point
Copy the full SHA 0bcc636View commit details -
feat: integrate guardrails into tracing system
- Add guardrails parameter to @trace() and @trace_async() decorators - Enhance create_step() context manager to support guardrails - Update add_chat_completion_step_to_trace() for helper function integration - Add global guardrails configuration via tracer.configure() - Implement input and output guardrail processing with graceful error handling - Add comprehensive guardrail metadata to trace steps including action flags - Support multiple block strategies: graceful handling vs exceptions - Enable per-call guardrail overrides and global configuration - Maintain 100% backward compatibility with existing trace decorators This integration enables automatic protection for both @trace() decorated functions and LLM helper functions like trace_openai() with rich metadata for monitoring and analysis.
Configuration menu - View commit details
-
Copy full SHA for b846ba5 - Browse repository at this point
Copy the full SHA b846ba5View commit details -
docs: add comprehensive guardrails usage examples
- Add trace_decorator_with_guardrails.py demonstrating @trace() with guardrails * Basic PII protection with different block strategies * Multiple guardrails with layered protection * Custom guardrail implementations * Role-based conditional guardrails - Add trace_openai_with_guardrails.py demonstrating helper function integration * Global guardrails configuration for all LLM calls * RAG pipeline protection with automatic guardrail application * Application-specific guardrail configurations * Multi-model setups with different protection levels * Monitoring and analytics with comprehensive metadata These examples provide clear guidance for implementing guardrails in production AI applications with both decorator and helper function patterns.
Configuration menu - View commit details
-
Copy full SHA for be7d827 - Browse repository at this point
Copy the full SHA be7d827View commit details -
test: add guardrails integration tests and additional examples
- Add comprehensive test suite for guardrails functionality - Include tests for different block strategies and error handling - Add helper functions integration tests - Provide additional usage examples and demonstrations These tests ensure the guardrails system works correctly across all integration points and usage patterns.
Configuration menu - View commit details
-
Copy full SHA for 3e98c70 - Browse repository at this point
Copy the full SHA 3e98c70View commit details -
refactor: simplify guardrails integration and clean up examples
- Remove complex guardrail logic from create_step and add_chat_completion_step_to_trace - Simplify @trace() decorator integration to be much less intrusive - Remove global guardrails configuration (not needed for basic functionality) - Clean up examples to focus on core @trace() decorator usage - Remove unnecessary test files and complex examples - Keep only essential guardrails functionality in tracer.py This makes the integration much cleaner and easier to review while maintaining the core guardrails functionality for @trace() decorated functions.
Configuration menu - View commit details
-
Copy full SHA for 4dde617 - Browse repository at this point
Copy the full SHA 4dde617View commit details -
Configuration menu - View commit details
-
Copy full SHA for d91fd55 - Browse repository at this point
Copy the full SHA d91fd55View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9abe566 - Browse repository at this point
Copy the full SHA 9abe566View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5f49d4a - Browse repository at this point
Copy the full SHA 5f49d4aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 73c53c6 - Browse repository at this point
Copy the full SHA 73c53c6View commit details -
Configuration menu - View commit details
-
Copy full SHA for c80943f - Browse repository at this point
Copy the full SHA c80943fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 623f812 - Browse repository at this point
Copy the full SHA 623f812View commit details -
Configuration menu - View commit details
-
Copy full SHA for f50c8c6 - Browse repository at this point
Copy the full SHA f50c8c6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 86d2d54 - Browse repository at this point
Copy the full SHA 86d2d54View commit details -
Configuration menu - View commit details
-
Copy full SHA for fee55e8 - Browse repository at this point
Copy the full SHA fee55e8View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v0.2.0-alpha.88...v0.2.0-alpha.89