active_genie 0.0.24 → 0.0.25
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.
- checksums.yaml +4 -4
- data/README.md +35 -50
- data/VERSION +1 -1
- data/lib/active_genie/battle/README.md +5 -5
- data/lib/active_genie/battle/generalist.rb +132 -0
- data/lib/active_genie/battle.rb +6 -5
- data/lib/active_genie/clients/providers/anthropic_client.rb +77 -0
- data/lib/active_genie/clients/{base_client.rb → providers/base_client.rb} +74 -100
- data/lib/active_genie/clients/providers/deepseek_client.rb +91 -0
- data/lib/active_genie/clients/providers/google_client.rb +132 -0
- data/lib/active_genie/clients/providers/openai_client.rb +96 -0
- data/lib/active_genie/clients/unified_client.rb +42 -12
- data/lib/active_genie/concerns/loggable.rb +11 -23
- data/lib/active_genie/config/battle_config.rb +8 -0
- data/lib/active_genie/config/data_extractor_config.rb +23 -0
- data/lib/active_genie/config/llm_config.rb +36 -0
- data/lib/active_genie/config/log_config.rb +44 -0
- data/lib/active_genie/config/providers/anthropic_config.rb +57 -0
- data/lib/active_genie/config/providers/deepseek_config.rb +50 -0
- data/lib/active_genie/config/providers/google_config.rb +52 -0
- data/lib/active_genie/config/providers/openai_config.rb +50 -0
- data/lib/active_genie/config/providers/provider_base.rb +89 -0
- data/lib/active_genie/config/providers_config.rb +62 -0
- data/lib/active_genie/config/ranking_config.rb +21 -0
- data/lib/active_genie/config/scoring_config.rb +8 -0
- data/lib/active_genie/configuration.rb +51 -28
- data/lib/active_genie/data_extractor/README.md +13 -13
- data/lib/active_genie/data_extractor/from_informal.rb +54 -48
- data/lib/active_genie/data_extractor/generalist.md +12 -0
- data/lib/active_genie/data_extractor/generalist.rb +125 -0
- data/lib/active_genie/data_extractor.rb +7 -5
- data/lib/active_genie/errors/invalid_provider_error.rb +41 -0
- data/lib/active_genie/logger.rb +17 -66
- data/lib/active_genie/ranking/README.md +31 -1
- data/lib/active_genie/ranking/elo_round.rb +107 -104
- data/lib/active_genie/ranking/free_for_all.rb +78 -74
- data/lib/active_genie/ranking/player.rb +79 -71
- data/lib/active_genie/ranking/players_collection.rb +83 -71
- data/lib/active_genie/ranking/ranking.rb +71 -94
- data/lib/active_genie/ranking/ranking_scoring.rb +71 -50
- data/lib/active_genie/ranking.rb +2 -0
- data/lib/active_genie/scoring/README.md +4 -4
- data/lib/active_genie/scoring/generalist.rb +171 -0
- data/lib/active_genie/scoring/recommended_reviewers.rb +70 -71
- data/lib/active_genie/scoring.rb +8 -5
- data/lib/active_genie.rb +23 -1
- data/lib/tasks/benchmark.rake +10 -9
- data/lib/tasks/install.rake +3 -1
- data/lib/tasks/templates/active_genie.rb +11 -6
- metadata +31 -22
- data/lib/active_genie/battle/basic.rb +0 -129
- data/lib/active_genie/clients/anthropic_client.rb +0 -84
- data/lib/active_genie/clients/google_client.rb +0 -135
- data/lib/active_genie/clients/helpers/retry.rb +0 -29
- data/lib/active_genie/clients/openai_client.rb +0 -98
- data/lib/active_genie/configuration/log_config.rb +0 -14
- data/lib/active_genie/configuration/providers/anthropic_config.rb +0 -54
- data/lib/active_genie/configuration/providers/base_config.rb +0 -85
- data/lib/active_genie/configuration/providers/deepseek_config.rb +0 -54
- data/lib/active_genie/configuration/providers/google_config.rb +0 -56
- data/lib/active_genie/configuration/providers/internal_company_api_config.rb +0 -54
- data/lib/active_genie/configuration/providers/openai_config.rb +0 -54
- data/lib/active_genie/configuration/providers_config.rb +0 -40
- data/lib/active_genie/configuration/runtime_config.rb +0 -35
- data/lib/active_genie/data_extractor/basic.rb +0 -101
- data/lib/active_genie/scoring/basic.rb +0 -170
@@ -0,0 +1,171 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../clients/unified_client'
|
4
|
+
|
5
|
+
module ActiveGenie
|
6
|
+
module Scoring
|
7
|
+
# The Generalist class provides a foundation for scoring text content against specified criteria
|
8
|
+
# using AI-powered evaluation. It supports both single and multiple reviewer scenarios,
|
9
|
+
# with the ability to automatically recommend reviewers when none are specified.
|
10
|
+
#
|
11
|
+
# The scoring process evaluates text based on given criteria and returns detailed feedback
|
12
|
+
# including individual reviewer scores, reasoning, and a final aggregated score.
|
13
|
+
#
|
14
|
+
# @example Generalist usage with a single reviewer
|
15
|
+
# Generalist.call("Sample text", "Evaluate grammar and clarity", ["Grammar Expert"])
|
16
|
+
#
|
17
|
+
# @example Usage with automatic reviewer recommendation
|
18
|
+
# Generalist.call("Sample text", "Evaluate technical accuracy")
|
19
|
+
#
|
20
|
+
class Generalist
|
21
|
+
# @param text [String] The text content to be evaluated
|
22
|
+
# @param criteria [String] The evaluation criteria or rubric to assess against
|
23
|
+
# @param reviewers [Array<String>] Optional list of specific reviewers. If empty,
|
24
|
+
# reviewers will be automatically recommended based on the content and criteria
|
25
|
+
# @param config [Hash] Additional configuration config that modify the scoring behavior
|
26
|
+
# @return [Hash] The evaluation result containing the scores and reasoning
|
27
|
+
# @return [Number] :final_score The final score of the text based on the criteria and reviewers
|
28
|
+
# @return [String] :final_reasoning Detailed explanation of why the final score was reached
|
29
|
+
def self.call(...)
|
30
|
+
new(...).call
|
31
|
+
end
|
32
|
+
|
33
|
+
def initialize(text, criteria, reviewers = [], config: {})
|
34
|
+
@text = text
|
35
|
+
@criteria = criteria
|
36
|
+
@param_reviewers = Array(reviewers).compact.uniq
|
37
|
+
@config = ActiveGenie.configuration.merge(config)
|
38
|
+
end
|
39
|
+
|
40
|
+
def call
|
41
|
+
messages = [
|
42
|
+
{ role: 'system', content: PROMPT },
|
43
|
+
{ role: 'user', content: "Scoring criteria: #{@criteria}" },
|
44
|
+
{ role: 'user', content: "Text to score: #{@text}" }
|
45
|
+
]
|
46
|
+
|
47
|
+
properties = build_properties
|
48
|
+
|
49
|
+
function = {
|
50
|
+
name: 'scoring',
|
51
|
+
description: 'Score the text based on the given criteria.',
|
52
|
+
parameters: {
|
53
|
+
type: 'object',
|
54
|
+
properties:,
|
55
|
+
required: properties.keys
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
result = ::ActiveGenie::Clients::UnifiedClient.function_calling(
|
60
|
+
messages,
|
61
|
+
function,
|
62
|
+
config: @config
|
63
|
+
)
|
64
|
+
|
65
|
+
result['final_score'] = 0 if result['final_score'].nil?
|
66
|
+
|
67
|
+
ActiveGenie::Logger.call({
|
68
|
+
code: :scoring,
|
69
|
+
text: @text[0..30],
|
70
|
+
criteria: @criteria[0..30],
|
71
|
+
reviewers: reviewers,
|
72
|
+
score: result['final_score'],
|
73
|
+
reasoning: result['final_reasoning']
|
74
|
+
})
|
75
|
+
|
76
|
+
result
|
77
|
+
end
|
78
|
+
|
79
|
+
private
|
80
|
+
|
81
|
+
def build_properties
|
82
|
+
properties = {}
|
83
|
+
reviewers.each do |reviewer|
|
84
|
+
properties["#{reviewer}_reasoning"] = {
|
85
|
+
type: 'string',
|
86
|
+
description: "The reasoning of the scoring process by #{reviewer}."
|
87
|
+
}
|
88
|
+
properties["#{reviewer}_score"] = {
|
89
|
+
type: 'number',
|
90
|
+
description: "The score given by #{reviewer}.",
|
91
|
+
min: 0,
|
92
|
+
max: 100
|
93
|
+
}
|
94
|
+
end
|
95
|
+
|
96
|
+
properties[:final_score] = {
|
97
|
+
type: 'number',
|
98
|
+
description: 'The final score based on the previous reviewers'
|
99
|
+
}
|
100
|
+
properties[:final_reasoning] = {
|
101
|
+
type: 'string',
|
102
|
+
description: 'The final reasoning based on the previous reviewers'
|
103
|
+
}
|
104
|
+
|
105
|
+
properties
|
106
|
+
end
|
107
|
+
|
108
|
+
def reviewers
|
109
|
+
@reviewers ||= if @param_reviewers.count.positive?
|
110
|
+
@param_reviewers
|
111
|
+
else
|
112
|
+
result = RecommendedReviewers.call(@text, @criteria, config: @config)
|
113
|
+
|
114
|
+
[result['reviewer1'], result['reviewer2'], result['reviewer3']]
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
PROMPT = <<~PROMPT
|
119
|
+
Evaluate and score the provided text based on predefined criteria, using a scoring range of 0 to 100 with 100 representing the highest possible score.
|
120
|
+
|
121
|
+
Follow the instructions below to ensure a comprehensive and objective assessment.
|
122
|
+
|
123
|
+
# Evaluation Process
|
124
|
+
|
125
|
+
1. **Analysis**:
|
126
|
+
- Thoroughly compare the text against each criterion for a comprehensive evaluation.
|
127
|
+
|
128
|
+
2. **Document Deviations**:
|
129
|
+
- Identify and document areas where the content does not align with the specified criteria.
|
130
|
+
|
131
|
+
3. **Highlight Strengths**:
|
132
|
+
- Note notable features or elements that enhance the quality or effectiveness of the content.
|
133
|
+
|
134
|
+
4. **Identify Weaknesses**:
|
135
|
+
- Specify areas where the content fails to meet the criteria or where improvements could be made.
|
136
|
+
|
137
|
+
# Scoring Fairness
|
138
|
+
|
139
|
+
- Ensure the assigned score reflects both the alignment with the criteria and the content's effectiveness.
|
140
|
+
- Consider if the fulfillment of other criteria compensates for areas lacking extreme details.
|
141
|
+
|
142
|
+
# Scoring Range
|
143
|
+
|
144
|
+
Segment scores into five parts before assigning a final score:
|
145
|
+
- **Terrible**: 0-20 - Content does not meet the criteria.
|
146
|
+
- **Bad**: 21-40 - Content is substandard but meets some criteria.
|
147
|
+
- **Average**: 41-60 - Content meets criteria with room for improvement.
|
148
|
+
- **Good**: 61-80 - Content exceeds criteria and is above average.
|
149
|
+
- **Great**: 81-100 - Content exceeds all expectations.
|
150
|
+
|
151
|
+
# Guidelines
|
152
|
+
|
153
|
+
- Maintain objectivity and avoid biases.
|
154
|
+
- Deconstruct each criterion into actionable components for systematic evaluation.
|
155
|
+
- Apply reasonable judgment in assigning a score, justifying your rationale clearly.
|
156
|
+
|
157
|
+
# Output Format
|
158
|
+
|
159
|
+
- Provide a detailed review including:
|
160
|
+
- A final score (0-100)
|
161
|
+
- Specific reasoning for the assigned score, detailing all evaluated criteria
|
162
|
+
- Include both positive aspects and suggested improvements
|
163
|
+
|
164
|
+
# Notes
|
165
|
+
|
166
|
+
- Consider edge cases where the text may partially align with criteria.
|
167
|
+
- If lacking information, reasonably judge and explain your scoring approach.
|
168
|
+
PROMPT
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
@@ -2,87 +2,86 @@
|
|
2
2
|
|
3
3
|
require_relative '../clients/unified_client'
|
4
4
|
|
5
|
-
module ActiveGenie
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
# The class ensures a balanced and comprehensive review process by recommending
|
11
|
-
# three distinct reviewer roles with complementary expertise and perspectives.
|
12
|
-
#
|
13
|
-
# @example Getting recommended reviewers for technical content
|
14
|
-
# RecommendedReviewers.call("Technical documentation about API design",
|
15
|
-
# "Evaluate technical accuracy and clarity")
|
16
|
-
# # => { reviewer1: "API Architect", reviewer2: "Technical Writer",
|
17
|
-
# # reviewer3: "Developer Advocate", reasoning: "..." }
|
18
|
-
#
|
19
|
-
class RecommendedReviewers
|
20
|
-
def self.call(...)
|
21
|
-
new(...).call
|
22
|
-
end
|
23
|
-
|
24
|
-
# Initializes a new reviewer recommendation instance
|
5
|
+
module ActiveGenie
|
6
|
+
module Scoring
|
7
|
+
# The RecommendedReviewers class intelligently suggests appropriate reviewer roles
|
8
|
+
# for evaluating text content based on specific criteria. It uses AI to analyze
|
9
|
+
# the content and criteria to identify the most suitable subject matter experts.
|
25
10
|
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
11
|
+
# The class ensures a balanced and comprehensive review process by recommending
|
12
|
+
# three distinct reviewer roles with complementary expertise and perspectives.
|
13
|
+
#
|
14
|
+
# @example Getting recommended reviewers for technical content
|
15
|
+
# RecommendedReviewers.call("Technical documentation about API design",
|
16
|
+
# "Evaluate technical accuracy and clarity")
|
17
|
+
# # => { reviewer1: "API Architect", reviewer2: "Technical Writer",
|
18
|
+
# # reviewer3: "Developer Advocate", reasoning: "..." }
|
19
|
+
#
|
20
|
+
class RecommendedReviewers
|
21
|
+
def self.call(...)
|
22
|
+
new(...).call
|
23
|
+
end
|
34
24
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
25
|
+
# Initializes a new reviewer recommendation instance
|
26
|
+
#
|
27
|
+
# @param text [String] The text content to analyze for reviewer recommendations
|
28
|
+
# @param criteria [String] The evaluation criteria that will guide reviewer selection
|
29
|
+
# @param config [Hash] Additional configuration config that modify the recommendation process
|
30
|
+
def initialize(text, criteria, config: {})
|
31
|
+
@text = text
|
32
|
+
@criteria = criteria
|
33
|
+
@config = ActiveGenie.configuration.merge(config)
|
34
|
+
end
|
41
35
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
reasoning: { type: 'string' },
|
49
|
-
reviewer1: { type: 'string' },
|
50
|
-
reviewer2: { type: 'string' },
|
51
|
-
reviewer3: { type: 'string' },
|
52
|
-
},
|
53
|
-
required: ['reasoning', 'reviewer1', 'reviewer2', 'reviewer3']
|
54
|
-
}
|
55
|
-
}
|
36
|
+
def call
|
37
|
+
messages = [
|
38
|
+
{ role: 'system', content: PROMPT },
|
39
|
+
{ role: 'user', content: "Scoring criteria: #{@criteria}" },
|
40
|
+
{ role: 'user', content: "Text to score: #{@text}" }
|
41
|
+
]
|
56
42
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
43
|
+
function = {
|
44
|
+
name: 'identify_reviewers',
|
45
|
+
description: 'Discover reviewers based on the text and given criteria.',
|
46
|
+
parameters: {
|
47
|
+
type: 'object',
|
48
|
+
properties: {
|
49
|
+
reasoning: { type: 'string' },
|
50
|
+
reviewer1: { type: 'string' },
|
51
|
+
reviewer2: { type: 'string' },
|
52
|
+
reviewer3: { type: 'string' }
|
53
|
+
},
|
54
|
+
required: %w[reasoning reviewer1 reviewer2 reviewer3]
|
55
|
+
}
|
56
|
+
}
|
63
57
|
|
64
|
-
|
65
|
-
|
58
|
+
client.function_calling(
|
59
|
+
messages,
|
60
|
+
function,
|
61
|
+
config: @config
|
62
|
+
)
|
63
|
+
end
|
66
64
|
|
67
|
-
|
65
|
+
private
|
68
66
|
|
69
|
-
|
70
|
-
|
67
|
+
PROMPT = <<~PROMPT
|
68
|
+
Identify the top 3 suitable reviewer titles or roles based on the provided text and criteria. Selected reviewers must possess subject matter expertise, offer valuable insights, and ensure diverse yet aligned perspectives on the content.
|
71
69
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
70
|
+
# Instructions
|
71
|
+
1. **Analyze the Text and Criteria**: Examine the content and criteria to identify relevant reviewer titles or roles.
|
72
|
+
2. **Determine Subject Matter Expertise**: Select reviewers with substantial knowledge or experience in the subject area.
|
73
|
+
3. **Evaluate Insight Contribution**: Prioritize titles or roles capable of providing meaningful and actionable feedback on the content.
|
74
|
+
4. **Incorporate Perspective Diversity**: Ensure the selection includes reviewers with varied but complementary viewpoints while maintaining alignment with the criteria.
|
77
75
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
76
|
+
# Constraints
|
77
|
+
- Selected reviewers must align with the content’s subject matter and criteria.
|
78
|
+
- Include reasoning for how each choice supports a thorough and insightful review.
|
79
|
+
- Avoid redundant or overly similar titles/roles to maintain diversity.
|
80
|
+
PROMPT
|
83
81
|
|
84
|
-
|
85
|
-
|
82
|
+
def client
|
83
|
+
::ActiveGenie::Clients::UnifiedClient
|
84
|
+
end
|
86
85
|
end
|
87
86
|
end
|
88
87
|
end
|
data/lib/active_genie/scoring.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'scoring/generalist'
|
2
4
|
require_relative 'scoring/recommended_reviewers'
|
3
5
|
|
4
6
|
module ActiveGenie
|
@@ -6,11 +8,12 @@ module ActiveGenie
|
|
6
8
|
module Scoring
|
7
9
|
module_function
|
8
10
|
|
9
|
-
def basic(...)
|
10
|
-
Basic.call(...)
|
11
|
-
end
|
12
11
|
def call(...)
|
13
|
-
|
12
|
+
Generalist.call(...)
|
13
|
+
end
|
14
|
+
|
15
|
+
def generalist(...)
|
16
|
+
Generalist.call(...)
|
14
17
|
end
|
15
18
|
|
16
19
|
def recommended_reviewers(...)
|
data/lib/active_genie.rb
CHANGED
@@ -1,19 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'active_genie/logger'
|
2
4
|
require_relative 'active_genie/configuration'
|
3
5
|
|
6
|
+
require_relative 'active_genie/config/providers/openai_config'
|
7
|
+
require_relative 'active_genie/config/providers/google_config'
|
8
|
+
require_relative 'active_genie/config/providers/anthropic_config'
|
9
|
+
require_relative 'active_genie/config/providers/deepseek_config'
|
10
|
+
|
4
11
|
module ActiveGenie
|
5
12
|
autoload :DataExtractor, File.join(__dir__, 'active_genie/data_extractor')
|
6
13
|
autoload :Battle, File.join(__dir__, 'active_genie/battle')
|
7
14
|
autoload :Scoring, File.join(__dir__, 'active_genie/scoring')
|
8
15
|
autoload :Ranking, File.join(__dir__, 'active_genie/ranking')
|
9
16
|
|
17
|
+
VERSION = File.read(File.expand_path('../VERSION', __dir__)).strip
|
18
|
+
|
10
19
|
class << self
|
11
20
|
def configure
|
12
21
|
yield(configuration) if block_given?
|
13
22
|
end
|
14
23
|
|
15
24
|
def configuration
|
16
|
-
@configuration ||=
|
25
|
+
@configuration ||= initialize_configuration
|
17
26
|
end
|
18
27
|
|
19
28
|
def load_tasks
|
@@ -22,5 +31,18 @@ module ActiveGenie
|
|
22
31
|
Rake::Task.define_task(:environment)
|
23
32
|
Dir.glob(File.join(__dir__, 'tasks', '*.rake')).each { |r| load r }
|
24
33
|
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def initialize_configuration
|
38
|
+
config = Configuration.new
|
39
|
+
|
40
|
+
config.providers.add(Config::Providers::OpenaiConfig)
|
41
|
+
config.providers.add(Config::Providers::GoogleConfig)
|
42
|
+
config.providers.add(Config::Providers::AnthropicConfig)
|
43
|
+
config.providers.add(Config::Providers::DeepseekConfig)
|
44
|
+
|
45
|
+
config
|
46
|
+
end
|
25
47
|
end
|
26
48
|
end
|
data/lib/tasks/benchmark.rake
CHANGED
@@ -1,27 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
|
2
3
|
namespace :active_genie do
|
3
|
-
desc
|
4
|
+
desc 'Run benchmarks, optionally for a specific module (e.g., rake active_genie:benchmark[data_extractor])'
|
4
5
|
task :benchmark, [:module_name] do |_, args|
|
5
6
|
Rake::TestTask.new(:run_benchmarks) do |t|
|
6
|
-
t.libs <<
|
7
|
-
|
7
|
+
t.libs << 'benchmark'
|
8
|
+
|
8
9
|
if args[:module_name]
|
9
10
|
module_name = args[:module_name]
|
10
11
|
module_path = "benchmark/test_cases/#{module_name}/"
|
11
12
|
t.test_files = FileList["#{module_path}**/*_test.rb"]
|
12
13
|
puts "Running benchmarks for module: #{module_name}"
|
13
14
|
else
|
14
|
-
t.test_files = FileList[
|
15
|
-
puts
|
15
|
+
t.test_files = FileList['benchmark/test_cases/**/*_test.rb']
|
16
|
+
puts 'Running all benchmarks'
|
16
17
|
end
|
17
|
-
|
18
|
+
|
18
19
|
t.warning = false
|
19
20
|
end
|
20
|
-
|
21
|
+
|
21
22
|
begin
|
22
23
|
Rake::Task[:run_benchmarks].invoke
|
23
|
-
rescue => e
|
24
|
+
rescue StandardError => e
|
24
25
|
puts e
|
25
26
|
end
|
26
27
|
end
|
27
|
-
end
|
28
|
+
end
|
data/lib/tasks/install.rake
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'fileutils'
|
2
4
|
|
3
5
|
namespace :active_genie do
|
@@ -7,6 +9,6 @@ namespace :active_genie do
|
|
7
9
|
target = File.join('config', 'initializers', 'active_genie.rb')
|
8
10
|
|
9
11
|
FileUtils.cp(source, target)
|
10
|
-
puts
|
12
|
+
puts 'Successfully installed active_genie!'
|
11
13
|
end
|
12
14
|
end
|
@@ -1,17 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
|
2
3
|
ActiveGenie.configure do |config|
|
3
4
|
# example with openai and the current default for each config
|
4
5
|
# config.providers.openai.api_key = ENV['OPENAI_API_KEY']
|
5
6
|
# config.providers.openai.organization = ENV['OPENAI_ORGANIZATION']
|
6
7
|
# config.providers.openai.api_url = 'https://api.openai.com/v1'
|
7
|
-
# config.providers.openai.lower_tier_model = 'gpt-
|
8
|
-
# config.providers.openai.middle_tier_model = 'gpt-
|
9
|
-
# config.providers.openai.upper_tier_model = '
|
8
|
+
# config.providers.openai.lower_tier_model = 'gpt-4.1-mini'
|
9
|
+
# config.providers.openai.middle_tier_model = 'gpt-4.1'
|
10
|
+
# config.providers.openai.upper_tier_model = 'o3-mini'
|
10
11
|
# config.providers.openai.client = ActiveGenie::Providers::Openai::Client.new(config)
|
11
12
|
|
12
13
|
# example how add a new provider
|
13
|
-
# config.providers.
|
14
|
+
# config.providers.add(InternalCompanyApi::Configuration)
|
14
15
|
|
15
16
|
# Logs configuration
|
16
|
-
# config.log_level = :debug # default is :info
|
17
|
-
|
17
|
+
# config.log.log_level = :debug # default is :info
|
18
|
+
# config.log.add_observer(GlobalLogObserver.new)
|
19
|
+
# config.log.add_observer(PersistUsageObserver.new, scope: { code: 'llm_usage' })
|
20
|
+
# config.log.remove_observer(PersistUsageObserver.new)
|
21
|
+
# config.log.clear_observers
|
22
|
+
end
|
metadata
CHANGED
@@ -1,17 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_genie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Radamés Roriz
|
8
|
+
autorequire:
|
8
9
|
bindir: bin
|
9
10
|
cert_chain: []
|
10
|
-
date:
|
11
|
+
date: 2025-05-19 00:00:00.000000000 Z
|
11
12
|
dependencies: []
|
12
13
|
description: |
|
13
14
|
The lodash for GenAI, stop reinventing the wheel
|
14
|
-
|
15
|
+
|
16
|
+
ActiveGenie is a Ruby gem that provides valuable solutions using GenAI. Just like Lodash or ActiveStorage, ActiveGenie brings a set of Modules to reach real value fast and reliably. Backed by a custom benchmarking system that ensures consistent quality and performance across different models and providers in every release.
|
15
17
|
email:
|
16
18
|
- radames@roriz.dev
|
17
19
|
executables: []
|
@@ -24,28 +26,33 @@ files:
|
|
24
26
|
- lib/active_genie.rb
|
25
27
|
- lib/active_genie/battle.rb
|
26
28
|
- lib/active_genie/battle/README.md
|
27
|
-
- lib/active_genie/battle/
|
28
|
-
- lib/active_genie/clients/anthropic_client.rb
|
29
|
-
- lib/active_genie/clients/base_client.rb
|
30
|
-
- lib/active_genie/clients/
|
31
|
-
- lib/active_genie/clients/
|
32
|
-
- lib/active_genie/clients/openai_client.rb
|
29
|
+
- lib/active_genie/battle/generalist.rb
|
30
|
+
- lib/active_genie/clients/providers/anthropic_client.rb
|
31
|
+
- lib/active_genie/clients/providers/base_client.rb
|
32
|
+
- lib/active_genie/clients/providers/deepseek_client.rb
|
33
|
+
- lib/active_genie/clients/providers/google_client.rb
|
34
|
+
- lib/active_genie/clients/providers/openai_client.rb
|
33
35
|
- lib/active_genie/clients/unified_client.rb
|
34
36
|
- lib/active_genie/concerns/loggable.rb
|
37
|
+
- lib/active_genie/config/battle_config.rb
|
38
|
+
- lib/active_genie/config/data_extractor_config.rb
|
39
|
+
- lib/active_genie/config/llm_config.rb
|
40
|
+
- lib/active_genie/config/log_config.rb
|
41
|
+
- lib/active_genie/config/providers/anthropic_config.rb
|
42
|
+
- lib/active_genie/config/providers/deepseek_config.rb
|
43
|
+
- lib/active_genie/config/providers/google_config.rb
|
44
|
+
- lib/active_genie/config/providers/openai_config.rb
|
45
|
+
- lib/active_genie/config/providers/provider_base.rb
|
46
|
+
- lib/active_genie/config/providers_config.rb
|
47
|
+
- lib/active_genie/config/ranking_config.rb
|
48
|
+
- lib/active_genie/config/scoring_config.rb
|
35
49
|
- lib/active_genie/configuration.rb
|
36
|
-
- lib/active_genie/configuration/log_config.rb
|
37
|
-
- lib/active_genie/configuration/providers/anthropic_config.rb
|
38
|
-
- lib/active_genie/configuration/providers/base_config.rb
|
39
|
-
- lib/active_genie/configuration/providers/deepseek_config.rb
|
40
|
-
- lib/active_genie/configuration/providers/google_config.rb
|
41
|
-
- lib/active_genie/configuration/providers/internal_company_api_config.rb
|
42
|
-
- lib/active_genie/configuration/providers/openai_config.rb
|
43
|
-
- lib/active_genie/configuration/providers_config.rb
|
44
|
-
- lib/active_genie/configuration/runtime_config.rb
|
45
50
|
- lib/active_genie/data_extractor.rb
|
46
51
|
- lib/active_genie/data_extractor/README.md
|
47
|
-
- lib/active_genie/data_extractor/basic.rb
|
48
52
|
- lib/active_genie/data_extractor/from_informal.rb
|
53
|
+
- lib/active_genie/data_extractor/generalist.md
|
54
|
+
- lib/active_genie/data_extractor/generalist.rb
|
55
|
+
- lib/active_genie/errors/invalid_provider_error.rb
|
49
56
|
- lib/active_genie/logger.rb
|
50
57
|
- lib/active_genie/ranking.rb
|
51
58
|
- lib/active_genie/ranking/README.md
|
@@ -57,7 +64,7 @@ files:
|
|
57
64
|
- lib/active_genie/ranking/ranking_scoring.rb
|
58
65
|
- lib/active_genie/scoring.rb
|
59
66
|
- lib/active_genie/scoring/README.md
|
60
|
-
- lib/active_genie/scoring/
|
67
|
+
- lib/active_genie/scoring/generalist.rb
|
61
68
|
- lib/active_genie/scoring/recommended_reviewers.rb
|
62
69
|
- lib/tasks/benchmark.rake
|
63
70
|
- lib/tasks/install.rake
|
@@ -71,6 +78,7 @@ metadata:
|
|
71
78
|
changelog_uri: https://github.com/Roriz/active_genie/blob/master/CHANGELOG.md
|
72
79
|
bug_tracker_uri: https://github.com/Roriz/active_genie/issues
|
73
80
|
rubygems_mfa_required: 'true'
|
81
|
+
post_install_message:
|
74
82
|
rdoc_options: []
|
75
83
|
require_paths:
|
76
84
|
- lib
|
@@ -78,14 +86,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
86
|
requirements:
|
79
87
|
- - ">="
|
80
88
|
- !ruby/object:Gem::Version
|
81
|
-
version: 3.
|
89
|
+
version: 3.3.0
|
82
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
91
|
requirements:
|
84
92
|
- - ">="
|
85
93
|
- !ruby/object:Gem::Version
|
86
94
|
version: '0'
|
87
95
|
requirements: []
|
88
|
-
rubygems_version: 3.
|
96
|
+
rubygems_version: 3.4.20
|
97
|
+
signing_key:
|
89
98
|
specification_version: 4
|
90
99
|
summary: Transform your Ruby application with powerful, production-ready GenAI features
|
91
100
|
test_files: []
|