active_genie 0.0.20 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/VERSION +1 -1
  4. metadata +14 -111
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d46586e4c64fdba00b703d32d2ee5eaad16e53e38f01adadb1a6090f049118d1
4
- data.tar.gz: f8420784cfd4b4ce21b2217af31d3e46252d623a65f0e93194027d9fd416b8ca
3
+ metadata.gz: 3fdcde2460a0cd018a5c140a4ad9018b5a48149789921a75ac2fc71601408d44
4
+ data.tar.gz: 0df8c2d70f45f1786da6622c71feff04743b5ec0479d5cd2c4d79e30d885306d
5
5
  SHA512:
6
- metadata.gz: 7ab8e0d11276d5805d9ea3568c4f0c2a15d23fed01d8d762b8750cb6a2bd2f6a698a929b13b6bdf8da30d4b2b81187ab61160be9250b7e709b827389f925a9e2
7
- data.tar.gz: a6cddf62c9f6f19fe6fbe6982e8c6a2097b644280d0d86fea19e85da507e91b8dab3299304f182246f84c1cfa7c0e2e003c19781d827b66f15a5c34d10e36da5
6
+ metadata.gz: a3f22c2e6af49dba9301403652def1cd85cd0c5ac7e64195de28c0cdae79afadbacae79771c741a20cf6b0e854e2e2088571c0802074dfd49b6e37eef1e92ef7
7
+ data.tar.gz: 3837b2687720a22633b3b06f012c81b431cb18ff097ea9d2abc98364db0c65a73f8998117e3522e821933c95f2e897703162485d76bb4ccd1d96eb0ebe4adc2c
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![Gem Version](https://badge.fury.io/rb/active_genie.svg?icon=si%3Arubygems)](https://badge.fury.io/rb/active_genie)
5
5
  [![Ruby](https://github.com/roriz/active_genie/actions/workflows/benchmark.yml/badge.svg)](https://github.com/roriz/active_genie/actions/workflows/benchmark.yml)
6
6
 
7
- ActiveGenie is a Ruby gem that provides valuable solutions powered by Generative AI (GenAI) models. Just like Lodash or ActiveStorage, ActiveGenie brings a set of Modules reach real value fast and reliable.
7
+ ActiveGenie is a Ruby gem that provides valuable solutions powered by Generative AI (GenAI) models. Just like Lodash or ActiveStorage, ActiveGenie brings a set of Modules to reach real value fast and reliably.
8
8
  ActiveGenie is backed by a custom benchmarking system that ensures consistent quality and performance across different models and providers in every release.
9
9
 
10
10
  ## Installation
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.20
1
+ 0.0.22
metadata CHANGED
@@ -1,121 +1,26 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_genie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Radamés Roriz
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-04-04 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: "# ActiveGenie \U0001F9DE‍♂️\n> The lodash for GenAI, stop reinventing
14
- the wheel\n\n[![Gem Version](https://badge.fury.io/rb/active_genie.svg?icon=si%3Arubygems)](https://badge.fury.io/rb/active_genie)\n[![Ruby](https://github.com/roriz/active_genie/actions/workflows/benchmark.yml/badge.svg)](https://github.com/roriz/active_genie/actions/workflows/benchmark.yml)\n\nActiveGenie
15
- is a Ruby gem that provides valuable solutions powered by Generative AI (GenAI)
16
- models. Just like Lodash or ActiveStorage, ActiveGenie brings a set of Modules reach
17
- real value fast and reliable.\nActiveGenie is backed by a custom benchmarking system
18
- that ensures consistent quality and performance across different models and providers
19
- in every release.\n\n## Installation\n\n1. Add to your Gemfile:\n```ruby\ngem 'active_genie'\n```\n\n2.
20
- Install the gem:\n```shell\nbundle install\n```\n\n3. Generate the configuration:\n```shell\necho
21
- \"ActiveGenie.load_tasks\" >> Rakefile\nrails g active_genie:install\n```\n\n4.
22
- Configure your credentials in `config/initializers/active_genie.rb`:\n```ruby\nActiveGenie.configure
23
- do |config|\n config.openai.api_key = ENV['OPENAI_API_KEY']\nend\n```\n\n## Quick
24
- Start\n\n### Data Extractor\n\nExtract structured data from text using AI-powered
25
- analysis, handling informal language and complex expressions.\n\n```ruby\ntext =
26
- \"Nike Air Max 90 - Size 42 - $199.99\"\nschema = {\n brand: { \n type: 'string',\n
27
- \ enum: [\"Nike\", \"Adidas\", \"Puma\"]\n },\n price: { \n type: 'number',\n
28
- \ minimum: 0\n },\n size: {\n type: 'number',\n minimum: 35,\n maximum:
29
- 46\n }\n}\n\nresult = ActiveGenie::DataExtractor.call(\n text,\n schema,\n config:
30
- { provider: :openai, model: 'gpt-4o-mini' } # optional\n)\n# => { \n# brand:
31
- \"Nike\", \n# brand_explanation: \"Brand name found at start of text\",\n#
32
- \ price: 199.99,\n# price_explanation: \"Price found in USD format at end\",\n#
33
- \ size: 42,\n# size_explanation: \"Size explicitly stated in the middle\"\n#
34
- \ }\n```\n\n*Recommended model*: `gpt-4o-mini`\n\nFeatures:\n- Structured data
35
- extraction with type validation\n- Schema-based extraction with custom constraints\n-
36
- Informal text analysis (litotes, hedging)\n- Detailed explanations for extracted
37
- values\n\nSee the [Data Extractor README](lib/active_genie/data_extractor/README.md)
38
- for informal text processing, advanced schemas, and detailed interface documentation.\n\n###
39
- Scoring\nText evaluation system that provides detailed scoring and feedback using
40
- multiple expert reviewers. Get balanced scoring through AI-powered expert reviewers
41
- that automatically adapt to your content.\n\n```ruby\ntext = \"The code implements
42
- a binary search algorithm with O(log n) complexity\"\ncriteria = \"Evaluate technical
43
- accuracy and clarity\"\n\nresult = ActiveGenie::Scoring.basic(\n text,\n criteria,\n
44
- \ config: { provider: :anthropic, model: 'claude-3-5-haiku-20241022' } # optional\n)\n#
45
- => {\n# algorithm_expert_score: 95,\n# algorithm_expert_reasoning: \"Accurately
46
- describes binary search and its complexity\",\n# technical_writer_score: 90,\n#
47
- \ technical_writer_reasoning: \"Clear and concise explanation of the algorithm\",\n#
48
- \ final_score: 92.5\n# }\n```\n\n*Recommended model*: `claude-3-5-haiku-20241022`\n\nFeatures:\n-
49
- Multi-reviewer evaluation with automatic expert selection\n- Detailed feedback with
50
- scoring reasoning\n- Customizable reviewer weights\n- Flexible evaluation criteria\n\nSee
51
- the [Scoring README](lib/active_genie/scoring/README.md) for advanced usage, custom
52
- reviewers, and detailed interface documentation.\n\n### Battle\nAI-powered battle
53
- evaluation system that determines winners between two players based on specified
54
- criteria.\n\n```ruby\nrequire 'active_genie'\n\nplayer_1 = \"Implementation uses
55
- dependency injection for better testability\"\nplayer_2 = \"Code has high test coverage
56
- but tightly coupled components\"\ncriteria = \"Evaluate code quality and maintainability\"\n\nresult
57
- = ActiveGenie::Battle.call(\n player_1,\n player_2,\n criteria,\n config: {
58
- provider: :google, model: 'gemini-2.0-flash-lite' } # optional\n)\n# => {\n# winner_player:
59
- \"Implementation uses dependency injection for better testability\",\n# reasoning:
60
- \"Player 1 implementation demonstrates better maintainability through dependency
61
- injection, \n# which allows for easier testing and component replacement.
62
- While Player 2 has good test coverage, \n# the tight coupling makes
63
- the code harder to maintain and modify.\",\n# what_could_be_changed_to_avoid_draw:
64
- \"Focus on specific architectural patterns and design principles\"\n# }\n```\n\n*Recommended
65
- model*: `claude-3-5-haiku`\n\nFeatures:\n- Multi-reviewer evaluation with automatic
66
- expert selection\n- Detailed feedback with scoring reasoning\n- Customizable reviewer
67
- weights\n- Flexible evaluation criteria\n\nSee the [Battle README](lib/active_genie/battle/README.md)
68
- for advanced usage, custom reviewers, and detailed interface documentation.\n\n###
69
- Ranking\nThe Ranking module provides competitive ranking through multi-stage evaluation:\n\n```ruby\nrequire
70
- 'active_genie'\n\nplayers = ['REST API', 'GraphQL API', 'SOAP API', 'gRPC API',
71
- 'Websocket API']\ncriteria = \"Best one to be used into a high changing environment\"\n\nresult
72
- = ActiveGenie::Ranking.call(\n players,\n criteria,\n config: { provider: :google,
73
- model: 'gemini-2.0-flash-lite' } # optional\n)\n# => {\n# winner_player: \"gRPC
74
- API\",\n# reasoning: \"gRPC API is the best one to be used into a high changing
75
- environment\",\n# }\n```\n\n*Recommended model*: `gemini-2.0-flash-lite`\n\n-
76
- **Multi-phase ranking system** combining expert scoring and ELO algorithms\n- **Automatic
77
- elimination** of inconsistent performers using statistical analysis\n- **Dynamic
78
- ranking adjustments** based on simulated pairwise battles, from bottom to top\n\nSee
79
- the [Ranking README](lib/active_genie/ranking/README.md) for implementation details,
80
- configuration, and advanced ranking strategies.\n\n### Text Summarizer (Future)\n###
81
- Categorizer (Future)\n### Language detector (Future)\n### Translator (Future)\n###
82
- Sentiment analyzer (Future)\n\n## Benchmarking \U0001F9EA\n\nActiveGenie includes
83
- a comprehensive benchmarking system to ensure consistent, high-quality outputs across
84
- different LLM models and providers.\n\n```ruby\n# Run all benchmarks\nbundle exec
85
- rake active_genie:benchmark\n\n# Run benchmarks for a specific module\nbundle exec
86
- rake active_genie:benchmark[data_extractor]\n```\n\n### Latest Results\n\n| Model
87
- | Overall Precision |\n|-------|-------------------|\n| claude-3-5-haiku-20241022
88
- | 92.25% |\n| gemini-2.0-flash-lite | 84.25% |\n| gpt-4o-mini | 62.75% |\n| deepseek-chat
89
- | 57.25% |\n\nSee the [Benchmark README](benchmark/README.md) for detailed results,
90
- methodology, and how to contribute to our test suite.\n\n## Configuration\n\n| Config
91
- | Description | Default |\n|--------|-------------|---------|\n| `provider` | LLM
92
- provider (openai, anthropic, etc) | `nil` |\n| `model` | Model to use | `nil` |\n|
93
- `api_key` | Provider API key | `nil` |\n| `timeout` | Request timeout in seconds
94
- | `5` |\n| `max_retries` | Maximum retry attempts | `3` |\n\n> **Note:** Each module
95
- can append its own set of configuration, see the individual module documentation
96
- for details.\n\n## How to create a new provider\n\nActiveGenie supports adding custom
97
- providers to integrate with different LLM services. To create a new provider:\n\n1.
98
- Create a configuration class for your provider in `lib/active_genie/configuration/providers/`:\n\n```ruby\n#
99
- Example: lib/active_genie/configuration/providers/internal_company_api_config.rb\nmodule
100
- ActiveGenie\n module Configuration::Providers\n class InternalCompanyApiConfig
101
- < BaseConfig\n NAME = :internal_company_api\n \n # API key accessor
102
- with environment variable fallback\n def api_key\n @api_key || ENV['INTERNAL_COMPANY_API_KEY']\n
103
- \ end\n \n # Base API URL\n def api_url\n @api_url ||
104
- 'https://api.internal-company.com/v1'\n end\n \n # Client instantiation\n
105
- \ def client\n @client ||= ::ActiveGenie::Clients::InternalCompanyApiClient.new(self)\n
106
- \ end\n \n # Model tier definitions\n def lower_tier_model\n
107
- \ @lower_tier_model || 'internal-basic'\n end\n \n def middle_tier_model\n
108
- \ @middle_tier_model || 'internal-standard'\n end\n \n def
109
- upper_tier_model\n @upper_tier_model || 'internal-premium'\n end\n end\n
110
- \ end\nend\n```\n\n2. Register your provider in your configuration:\n\n```ruby\n#
111
- In config/initializers/active_genie.rb\nActiveGenie.configure do |config|\n # Register
112
- your custom provider\n config.providers.register(InternalCompanyApi::Configuration)\n
113
- \ \n # Configure your provider\n config.internal_company_api.api_key = ENV['INTERNAL_COMPANY_API_KEY']\nend\n```\n\n##
114
- Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout
115
- -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing
116
- feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5.
117
- Open a Pull Request\n\n## License\n\nThis project is licensed under the Apache License
118
- 2.0 License - see the [LICENSE](LICENSE) file for details.\n"
13
+ the wheel\n\nActiveGenie is a Ruby gem that provides valuable solutions powered
14
+ by Generative AI (GenAI) models. Just like Lodash or ActiveStorage, ActiveGenie
15
+ brings a set of Modules to reach real value fast and reliably.\nActiveGenie is backed
16
+ by a custom benchmarking system that ensures consistent quality and performance
17
+ across different models and providers in every release.\n\n## Features\n\n* **Data
18
+ Extractor:** (100% precision) Extract structured data from text using AI-powered
19
+ analysis\n* **Scoring:** (69% precision) Text evaluation system with detailed scoring
20
+ and feedback\n* **Battle:** (100% precision) AI-powered battle evaluation system
21
+ between two players\n* **Ranking:** (100% precision) Multi-phase ranking system
22
+ for multiple options\n\nSee the [GitHub repository](https://github.com/Roriz/active_genie)
23
+ for complete documentation and examples.\n"
119
24
  email:
120
25
  - radames@roriz.dev
121
26
  executables: []
@@ -175,7 +80,6 @@ metadata:
175
80
  changelog_uri: https://github.com/Roriz/active_genie/blob/master/CHANGELOG.md
176
81
  bug_tracker_uri: https://github.com/Roriz/active_genie/issues
177
82
  rubygems_mfa_required: 'true'
178
- post_install_message:
179
83
  rdoc_options: []
180
84
  require_paths:
181
85
  - lib
@@ -190,8 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
94
  - !ruby/object:Gem::Version
191
95
  version: '0'
192
96
  requirements: []
193
- rubygems_version: 3.5.3
194
- signing_key:
97
+ rubygems_version: 3.6.7
195
98
  specification_version: 4
196
99
  summary: Transform your Ruby application with powerful, production-ready GenAI features
197
100
  test_files: []