active_genie 0.0.19 → 0.0.20
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 +59 -1
- data/VERSION +1 -1
- data/lib/active_genie/battle/basic.rb +1 -9
- data/lib/active_genie/configuration/providers/internal_company_api_config.rb +54 -0
- data/lib/active_genie/scoring/recommended_reviewers.rb +2 -1
- data/lib/tasks/templates/active_genie.rb +1 -1
- metadata +24 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d46586e4c64fdba00b703d32d2ee5eaad16e53e38f01adadb1a6090f049118d1
|
4
|
+
data.tar.gz: f8420784cfd4b4ce21b2217af31d3e46252d623a65f0e93194027d9fd416b8ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ab8e0d11276d5805d9ea3568c4f0c2a15d23fed01d8d762b8750cb6a2bd2f6a698a929b13b6bdf8da30d4b2b81187ab61160be9250b7e709b827389f925a9e2
|
7
|
+
data.tar.gz: a6cddf62c9f6f19fe6fbe6982e8c6a2097b644280d0d86fea19e85da507e91b8dab3299304f182246f84c1cfa7c0e2e003c19781d827b66f15a5c34d10e36da5
|
data/README.md
CHANGED
@@ -137,7 +137,7 @@ result = ActiveGenie::Battle.call(
|
|
137
137
|
# }
|
138
138
|
```
|
139
139
|
|
140
|
-
*Recommended model*: `
|
140
|
+
*Recommended model*: `claude-3-5-haiku`
|
141
141
|
|
142
142
|
Features:
|
143
143
|
- Multi-reviewer evaluation with automatic expert selection
|
@@ -216,6 +216,64 @@ See the [Benchmark README](benchmark/README.md) for detailed results, methodolog
|
|
216
216
|
|
217
217
|
> **Note:** Each module can append its own set of configuration, see the individual module documentation for details.
|
218
218
|
|
219
|
+
## How to create a new provider
|
220
|
+
|
221
|
+
ActiveGenie supports adding custom providers to integrate with different LLM services. To create a new provider:
|
222
|
+
|
223
|
+
1. Create a configuration class for your provider in `lib/active_genie/configuration/providers/`:
|
224
|
+
|
225
|
+
```ruby
|
226
|
+
# Example: lib/active_genie/configuration/providers/internal_company_api_config.rb
|
227
|
+
module ActiveGenie
|
228
|
+
module Configuration::Providers
|
229
|
+
class InternalCompanyApiConfig < BaseConfig
|
230
|
+
NAME = :internal_company_api
|
231
|
+
|
232
|
+
# API key accessor with environment variable fallback
|
233
|
+
def api_key
|
234
|
+
@api_key || ENV['INTERNAL_COMPANY_API_KEY']
|
235
|
+
end
|
236
|
+
|
237
|
+
# Base API URL
|
238
|
+
def api_url
|
239
|
+
@api_url || 'https://api.internal-company.com/v1'
|
240
|
+
end
|
241
|
+
|
242
|
+
# Client instantiation
|
243
|
+
def client
|
244
|
+
@client ||= ::ActiveGenie::Clients::InternalCompanyApiClient.new(self)
|
245
|
+
end
|
246
|
+
|
247
|
+
# Model tier definitions
|
248
|
+
def lower_tier_model
|
249
|
+
@lower_tier_model || 'internal-basic'
|
250
|
+
end
|
251
|
+
|
252
|
+
def middle_tier_model
|
253
|
+
@middle_tier_model || 'internal-standard'
|
254
|
+
end
|
255
|
+
|
256
|
+
def upper_tier_model
|
257
|
+
@upper_tier_model || 'internal-premium'
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|
261
|
+
end
|
262
|
+
```
|
263
|
+
|
264
|
+
2. Register your provider in your configuration:
|
265
|
+
|
266
|
+
```ruby
|
267
|
+
# In config/initializers/active_genie.rb
|
268
|
+
ActiveGenie.configure do |config|
|
269
|
+
# Register your custom provider
|
270
|
+
config.providers.register(InternalCompanyApi::Configuration)
|
271
|
+
|
272
|
+
# Configure your provider
|
273
|
+
config.internal_company_api.api_key = ENV['INTERNAL_COMPANY_API_KEY']
|
274
|
+
end
|
275
|
+
```
|
276
|
+
|
219
277
|
## Contributing
|
220
278
|
|
221
279
|
1. Fork the repository
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.20
|
@@ -122,15 +122,7 @@ module ActiveGenie::Battle
|
|
122
122
|
description: 'Who is the winner based on the impartial judge reasoning?',
|
123
123
|
enum: ['player_1', 'player_2']
|
124
124
|
},
|
125
|
-
}
|
126
|
-
required: [
|
127
|
-
'player_1_sell_himself',
|
128
|
-
'player_2_sell_himself',
|
129
|
-
'player_1_arguments',
|
130
|
-
'player_2_counter',
|
131
|
-
'impartial_judge_winner_reasoning',
|
132
|
-
'impartial_judge_winner'
|
133
|
-
]
|
125
|
+
}
|
134
126
|
}
|
135
127
|
}
|
136
128
|
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require_relative '../../clients/internal_company_api_client'
|
2
|
+
require_relative './base_config'
|
3
|
+
|
4
|
+
module ActiveGenie
|
5
|
+
module Configuration::Providers
|
6
|
+
# Configuration class for the Internal Company API client.
|
7
|
+
# Manages API keys, URLs, model selections, and client instantiation.
|
8
|
+
class InternalCompanyApiConfig < BaseConfig
|
9
|
+
NAME = :internal_company_api
|
10
|
+
|
11
|
+
# Retrieves the API key.
|
12
|
+
# Falls back to the INTERNAL_COMPANY_API_KEY environment variable if not set.
|
13
|
+
# @return [String, nil] The API key.
|
14
|
+
def api_key
|
15
|
+
@api_key || ENV['INTERNAL_COMPANY_API_KEY']
|
16
|
+
end
|
17
|
+
|
18
|
+
# Retrieves the base API URL for Internal Company API.
|
19
|
+
# Defaults to 'https://api.internal-company.com/v1'.
|
20
|
+
# @return [String] The API base URL.
|
21
|
+
def api_url
|
22
|
+
@api_url || 'https://api.internal-company.com/v1'
|
23
|
+
end
|
24
|
+
|
25
|
+
# Lazily initializes and returns an instance of the InternalCompanyApiClient.
|
26
|
+
# Passes itself (the config object) to the client's constructor.
|
27
|
+
# @return [ActiveGenie::Clients::InternalCompanyApiClient] The client instance.
|
28
|
+
def client
|
29
|
+
@client ||= ::ActiveGenie::Clients::InternalCompanyApiClient.new(self)
|
30
|
+
end
|
31
|
+
|
32
|
+
# Retrieves the model name designated for the lower tier (e.g., cost-effective, faster).
|
33
|
+
# Defaults to 'internal-basic'.
|
34
|
+
# @return [String] The lower tier model name.
|
35
|
+
def lower_tier_model
|
36
|
+
@lower_tier_model || 'internal-basic'
|
37
|
+
end
|
38
|
+
|
39
|
+
# Retrieves the model name designated for the middle tier (e.g., balanced performance).
|
40
|
+
# Defaults to 'internal-standard'.
|
41
|
+
# @return [String] The middle tier model name.
|
42
|
+
def middle_tier_model
|
43
|
+
@middle_tier_model || 'internal-standard'
|
44
|
+
end
|
45
|
+
|
46
|
+
# Retrieves the model name designated for the upper tier (e.g., most capable).
|
47
|
+
# Defaults to 'internal-premium'.
|
48
|
+
# @return [String] The upper tier model name.
|
49
|
+
def upper_tier_model
|
50
|
+
@upper_tier_model || 'internal-premium'
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -10,7 +10,7 @@ ActiveGenie.configure do |config|
|
|
10
10
|
# config.providers.openai.client = ActiveGenie::Providers::Openai::Client.new(config)
|
11
11
|
|
12
12
|
# example how add a new provider
|
13
|
-
# config.providers.register(
|
13
|
+
# config.providers.register(InternalCompanyApi::Configuration)
|
14
14
|
|
15
15
|
# Logs configuration
|
16
16
|
# config.log_level = :debug # default is :info
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Radamés Roriz
|
@@ -62,7 +62,7 @@ description: "# ActiveGenie \U0001F9DE♂️\n> The lodash for GenAI, stop re
|
|
62
62
|
While Player 2 has good test coverage, \n# the tight coupling makes
|
63
63
|
the code harder to maintain and modify.\",\n# what_could_be_changed_to_avoid_draw:
|
64
64
|
\"Focus on specific architectural patterns and design principles\"\n# }\n```\n\n*Recommended
|
65
|
-
model*: `
|
65
|
+
model*: `claude-3-5-haiku`\n\nFeatures:\n- Multi-reviewer evaluation with automatic
|
66
66
|
expert selection\n- Detailed feedback with scoring reasoning\n- Customizable reviewer
|
67
67
|
weights\n- Flexible evaluation criteria\n\nSee the [Battle README](lib/active_genie/battle/README.md)
|
68
68
|
for advanced usage, custom reviewers, and detailed interface documentation.\n\n###
|
@@ -93,9 +93,27 @@ description: "# ActiveGenie \U0001F9DE♂️\n> The lodash for GenAI, stop re
|
|
93
93
|
`api_key` | Provider API key | `nil` |\n| `timeout` | Request timeout in seconds
|
94
94
|
| `5` |\n| `max_retries` | Maximum retry attempts | `3` |\n\n> **Note:** Each module
|
95
95
|
can append its own set of configuration, see the individual module documentation
|
96
|
-
for details.\n\n##
|
97
|
-
|
98
|
-
|
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.
|
99
117
|
Open a Pull Request\n\n## License\n\nThis project is licensed under the Apache License
|
100
118
|
2.0 License - see the [LICENSE](LICENSE) file for details.\n"
|
101
119
|
email:
|
@@ -124,6 +142,7 @@ files:
|
|
124
142
|
- lib/active_genie/configuration/providers/base_config.rb
|
125
143
|
- lib/active_genie/configuration/providers/deepseek_config.rb
|
126
144
|
- lib/active_genie/configuration/providers/google_config.rb
|
145
|
+
- lib/active_genie/configuration/providers/internal_company_api_config.rb
|
127
146
|
- lib/active_genie/configuration/providers/openai_config.rb
|
128
147
|
- lib/active_genie/configuration/providers_config.rb
|
129
148
|
- lib/active_genie/configuration/runtime_config.rb
|