Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: openlayer-ai/openlayer-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.2.0-alpha.88
Choose a base ref
...
head repository: openlayer-ai/openlayer-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.2.0-alpha.89
Choose a head ref
  • 14 commits
  • 11 files changed
  • 4 contributors

Commits on Sep 8, 2025

  1. 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.
    Gabriel Bayomi Tinoco Kalejaiye authored and gustavocidornelas committed Sep 8, 2025
    Configuration menu
    Copy the full SHA
    0bcc636 View commit details
    Browse the repository at this point in the history
  2. 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.
    Gabriel Bayomi Tinoco Kalejaiye authored and gustavocidornelas committed Sep 8, 2025
    Configuration menu
    Copy the full SHA
    b846ba5 View commit details
    Browse the repository at this point in the history
  3. 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.
    Gabriel Bayomi Tinoco Kalejaiye authored and gustavocidornelas committed Sep 8, 2025
    Configuration menu
    Copy the full SHA
    be7d827 View commit details
    Browse the repository at this point in the history
  4. 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.
    Gabriel Bayomi Tinoco Kalejaiye authored and gustavocidornelas committed Sep 8, 2025
    Configuration menu
    Copy the full SHA
    3e98c70 View commit details
    Browse the repository at this point in the history
  5. 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.
    Gabriel Bayomi Tinoco Kalejaiye authored and gustavocidornelas committed Sep 8, 2025
    Configuration menu
    Copy the full SHA
    4dde617 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d91fd55 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    9abe566 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    5f49d4a View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    73c53c6 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    c80943f View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    623f812 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    f50c8c6 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    86d2d54 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    fee55e8 View commit details
    Browse the repository at this point in the history
Loading