Multiselect jQuery plugin for Rails asset pipeline
Acra helps you easily secure your databases in distributed, microservice-rich environments. It allows you to selectively encrypt sensitive records with strong multi-layer cryptography, detect potential intrusions and SQL injections and cryptographically compartmentalise data stored in large sharded schemes.
SimpleEnum::Multiple is extension of SimpleEnum, which brings multi-select enum support to SimpleEnum.
The use library solves the multi-mixin problem by allowing you to selectively mixin specific methods from a module rather than mixing in all of them. In addition, you can alias methods on the fly as they are mixed in, effectively allowing you to change the name of the mixin method.
Acra helps you easily secure your databases in distributed, microservice-rich environments. It allows you to selectively encrypt sensitive records with strong multi-layer cryptography, detect potential intrusions and SQL injections and cryptographically compartmentalise data stored in large sharded schemes.
A gem to integrate Jquery multi-select js
Automated Gem installation, activation, and much more! == FEATURES: GemInstaller provides automated installation, loading and activation of RubyGems. It uses a simple YAML config file to: * Automatically install the correct versions of all required gems wherever your app runs. * Automatically ensure installed gems and versions are consistent across multiple applications, machines, platforms, and environments * Automatically activate correct versions of gems on the ruby load path when your app runs ('require_gem'/'gem') * Automatically reinstall missing dependency gems (built in to RubyGems > 1.0) * Automatically detect correct platform to install for multi-platform gems (built in to RubyGems > 1.0) * Print YAML for \"rogue gems\" which are not specified in the current config, to easily bootstrap your config file, or find gems that were manually installed without GemInstaller. * Allow for common configs to be reused across projects or environments by supporting multiple config files, including common config file snippets, and defaults with overrides. * Allow for dynamic selection of gems, versions, and platforms to be used based on environment vars or any other logic. * Avoid the \"works on demo, breaks on production\" syndrome * Solve world hunger, prevent the global energy crisis, and wash your socks. == SYNOPSYS:
select some conditions
# ActiveGenie 🧞♂️ > Transform your Ruby application with powerful, production-ready GenAI features [](https://badge.fury.io/rb/active_genie) [](https://github.com/roriz/active_genie/actions/workflows/ruby.yml) ActiveGenie is a Ruby gem that provides a polished, production-ready interface for working with Generative AI (GenAI) models. Just like ActiveStorage simplifies file handling in Rails, ActiveGenie makes it effortless to integrate GenAI capabilities into your Ruby applications. ## Features - 🎯 **Data Extraction**: Extract structured data from unstructured text with type validation - 📊 **Smart Scoring**: Multi-reviewer evaluation system with automatic expert selection - 💭 **Sentiment Analysis**: Advanced sentiment analysis with customizable rules - 🔒 **Safe & Secure**: Built-in validation and sanitization - 🛠️ **Configurable**: Supports multiple GenAI providers and models ## Installation 1. Add to your Gemfile: ```ruby gem 'active_genie' ``` 2. Install the gem: ```shell bundle install ``` 3. Generate the configuration: ```shell echo "ActiveGenie.load_tasks" >> Rakefile rails g active_genie:install ``` 4. [Optional] Configure your credentials in `config/active_genie.yml`: ```yaml GPT-4o-mini: api_key: <%= ENV['OPENAI_API_KEY'] %> provider: "openai" claude-3-5-sonnet: api_key: <%= ENV['ANTHROPIC_API_KEY'] %> provider: "anthropic" ``` > The first key will be used as default in all modules, in this example `GPT-4o-mini` ## Quick Start ### Data Extractor Extract structured data from text using AI-powered analysis, handling informal language and complex expressions. ```ruby text = "Nike Air Max 90 - Size 42 - $199.99" schema = { brand: { type: 'string', enum: ["Nike", "Adidas", "Puma"] }, price: { type: 'number', minimum: 0 }, size: { type: 'integer', minimum: 35, maximum: 46 } } result = ActiveGenie::DataExtractor.call(text, schema) # => { # brand: "Nike", # brand_explanation: "Brand name found at start of text", # price: 199.99, # price_explanation: "Price found in USD format at end", # size: 42, # size_explanation: "Size explicitly stated in the middle" # } ``` Features: - Structured data extraction with type validation - Schema-based extraction with custom constraints - Informal text analysis (litotes, hedging) - Detailed explanations for extracted values See the [Data Extractor README](lib/active_genie/data_extractor/README.md) for informal text processing, advanced schemas, and detailed interface documentation. ### Scoring Text evaluation system that provides detailed scoring and feedback using multiple expert reviewers. Get balanced scoring through AI-powered expert reviewers that automatically adapt to your content. ```ruby text = "The code implements a binary search algorithm with O(log n) complexity" criteria = "Evaluate technical accuracy and clarity" result = ActiveGenie::Scoring::Basic.call(text, criteria) # => { # algorithm_expert_score: 95, # algorithm_expert_reasoning: "Accurately describes binary search and its complexity", # technical_writer_score: 90, # technical_writer_reasoning: "Clear and concise explanation of the algorithm", # final_score: 92.5 # } ``` Features: - Multi-reviewer evaluation with automatic expert selection - Detailed feedback with scoring reasoning - Customizable reviewer weights - Flexible evaluation criteria See the [Scoring README](lib/active_genie/scoring/README.md) for advanced usage, custom reviewers, and detailed interface documentation. ### Battle AI-powered battle evaluation system that determines winners between two players based on specified criteria. ```ruby require 'active_genie' player_a = "Implementation uses dependency injection for better testability" player_b = "Code has high test coverage but tightly coupled components" criteria = "Evaluate code quality and maintainability" result = ActiveGenie::Battle::Basic.call(player_a, player_b, criteria) # => { # winner_player: "Implementation uses dependency injection for better testability", # reasoning: "Player A's implementation demonstrates better maintainability through dependency injection, # which allows for easier testing and component replacement. While Player B has good test coverage, # the tight coupling makes the code harder to maintain and modify.", # what_could_be_changed_to_avoid_draw: "Focus on specific architectural patterns and design principles" # } ``` Features: - Multi-reviewer evaluation with automatic expert selection - Detailed feedback with scoring reasoning - Customizable reviewer weights - Flexible evaluation criteria See the [Battle README](lib/active_genie/battle/README.md) for advanced usage, custom reviewers, and detailed interface documentation. ### Summarizer (WIP) The summarizer is a tool that can be used to summarize a given text. It uses a set of rules to summarize the text out of the box. Uses the best practices of prompt engineering and engineering to make the summarization as accurate as possible. ```ruby require 'active_genie' text = "Example text to be summarized. The fox jumps over the dog" summarized_text = ActiveGenie::Summarizer.call(text) puts summarized_text # => "The fox jumps over the dog" ``` ### Language detector (WIP) The language detector is a tool that can be used to detect the language of a given text. It uses a set of rules to detect the language of the text out of the box. Uses the best practices of prompt engineering and engineering to make the language detection as accurate as possible. ```ruby require 'active_genie' text = "Example text to be detected" language = ActiveGenie::LanguageDetector.call(text) puts language # => "en" ``` ### Translator (WIP) The translator is a tool that can be used to translate a given text. It uses a set of rules to translate the text out of the box. Uses the best practices of prompt engineering and engineering to make the translation as accurate as possible. ```ruby require 'active_genie' text = "Example text to be translated" translated_text = ActiveGenie::Translator.call(text, from: 'en', to: 'pt') puts translated_text # => "Exemplo de texto a ser traduzido" ``` ### Sentiment analyzer (WIP) The sentiment analyzer is a tool that can be used to analyze the sentiment of a given text. It uses a set of rules to analyze the sentiment of the text out of the box. Uses the best practices of prompt engineering and engineering to make the sentiment analysis as accurate as possible. ```ruby require 'active_genie' text = "Example text to be analyzed" sentiment = ActiveGenie::SentimentAnalyzer.call(text) puts sentiment # => "positive" ``` ### Elo ranking (WIP) The Elo ranking is a tool that can be used to rank a set of items. It uses a set of rules to rank the items out of the box. Uses the best practices of prompt engineering and engineering to make the ranking as accurate as possible. ```ruby require 'active_genie' items = ['Square', 'Circle', 'Triangle'] criterias = 'items that look rounded' ranked_items = ActiveGenie::EloRanking.call(items, criterias, rounds: 10) puts ranked_items # => [{ name: "Circle", score: 1500 }, { name: "Square", score: 800 }, { name: "Triangle", score: 800 }] ``` ## Configuration Options | Option | Description | Default | |--------|-------------|---------| | `provider` | LLM provider (openai, anthropic, etc) | `nil` | | `model` | Model to use | `nil` | | `api_key` | Provider API key | `nil` | | `timeout` | Request timeout in seconds | `5` | | `max_retries` | Maximum retry attempts | `3` | > **Note:** Each module can append its own set of configuration options, see the individual module documentation for details. ## Contributing 1. Fork the repository 2. Create your feature branch (`git checkout -b feature/amazing-feature`) 3. Commit your changes (`git commit -m 'Add amazing feature'`) 4. Push to the branch (`git push origin feature/amazing-feature`) 5. Open a Pull Request ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.