Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: py bindings refactoring #317

Merged
merged 2 commits into from
Feb 16, 2025
Merged

Conversation

stefan-gorules
Copy link
Contributor

Python Bindings Refactoring & API Improvements

This PR introduces significant improvements to the Python bindings, focusing on better ergonomics, simplified type handling, and enhanced async support. It also adds version information to the package.

Features

  • ✨ Improved type handling with direct JSON string/bytes support
  • 🚀 Enhanced async loader capabilities with proper task locals handling
  • 🔄 Simplified context passing and evaluation options
  • 📝 Added comprehensive type hints via .pyi stub file

API Improvements

# Before
engine.evaluate("decision_key", {"data": "value"}, {"max_depth": 10})

# After
engine.evaluate("decision_key", '{"data": "value"}')  # Now accepts JSON strings
engine.evaluate("decision_key", context_dict, {"max_depth": 10, "trace": True})

@stefan-gorules stefan-gorules merged commit ff34aff into master Feb 16, 2025
7 checks passed
@stefan-gorules stefan-gorules deleted the feat/py-bindings-refactoring branch February 16, 2025 19:19
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.

2 participants