cleo_quality_review 0.5.0 → 0.6.0
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bc077380027b74b33b14b5fb0065841dddde664ec03f9633c1fc20ba87c88566
|
|
4
|
+
data.tar.gz: 30ead6b8a03ed7ba76455d0e030e6d229555a15622a559d63eb34f260278409f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ab13fbc517a6058cc4fdaa989ba278fa5a81ff582006a0910927d909bdc34596f3ff451a20ff8cb7216b1e08ff29c8b3b31fda9172ec3472887115c331e8c4a1
|
|
7
|
+
data.tar.gz: 2dce96fc04ae0ae5bbb1479f394967ad04af1b089d12c435a4bed69f2c0997ffec136e3d3a7008fddb650583f2a0696ad246bd3ed47cff3ce2c1b0db0eda22f5
|
data/config/default.yml
CHANGED
|
@@ -11,6 +11,8 @@ module CleoQualityReview
|
|
|
11
11
|
DEFAULT_CONFIG_PATH = File.expand_path("../../config/default.yml", __dir__)
|
|
12
12
|
LOCAL_CONFIG_PATH = ".cleo_quality_review.yaml"
|
|
13
13
|
ALL_TOOLS = "AllTools"
|
|
14
|
+
LLM = "LLM"
|
|
15
|
+
MODEL = "Model"
|
|
14
16
|
INCLUDE = "Include"
|
|
15
17
|
EXCLUDE = "Exclude"
|
|
16
18
|
INHERIT_FROM = "inherit_from"
|
|
@@ -61,6 +63,12 @@ module CleoQualityReview
|
|
|
61
63
|
@data = data
|
|
62
64
|
end
|
|
63
65
|
|
|
66
|
+
##
|
|
67
|
+
# @return [String, nil] configured LLM model identifier
|
|
68
|
+
def llm_model
|
|
69
|
+
data.fetch(LLM) { {} }.fetch(MODEL, nil)&.to_s
|
|
70
|
+
end
|
|
71
|
+
|
|
64
72
|
##
|
|
65
73
|
# @return [Array<String>] glob patterns for files to include
|
|
66
74
|
def include_patterns
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require_relative "configuration"
|
|
3
4
|
require_relative "llm_providers/open_ai_config"
|
|
4
5
|
|
|
5
6
|
module CleoQualityReview
|
|
@@ -10,8 +11,10 @@ module CleoQualityReview
|
|
|
10
11
|
|
|
11
12
|
##
|
|
12
13
|
# @param [Hash{String => String}] env environment variables
|
|
13
|
-
|
|
14
|
+
# @param [Configuration] configuration repository configuration
|
|
15
|
+
def initialize(env: ENV, configuration: Configuration.load)
|
|
14
16
|
@env = env
|
|
17
|
+
@configuration = configuration
|
|
15
18
|
end
|
|
16
19
|
|
|
17
20
|
##
|
|
@@ -23,7 +26,7 @@ module CleoQualityReview
|
|
|
23
26
|
##
|
|
24
27
|
# @return [LlmProviders::OpenAi::Config]
|
|
25
28
|
def open_ai_config
|
|
26
|
-
@open_ai_config ||= LlmProviders::OpenAi::Config.new(env: env)
|
|
29
|
+
@open_ai_config ||= LlmProviders::OpenAi::Config.new(env: env, model: configuration.llm_model)
|
|
27
30
|
end
|
|
28
31
|
|
|
29
32
|
##
|
|
@@ -35,6 +38,6 @@ module CleoQualityReview
|
|
|
35
38
|
|
|
36
39
|
private
|
|
37
40
|
|
|
38
|
-
attr_reader :env
|
|
41
|
+
attr_reader :env, :configuration
|
|
39
42
|
end
|
|
40
43
|
end
|
|
@@ -15,8 +15,10 @@ module CleoQualityReview
|
|
|
15
15
|
|
|
16
16
|
##
|
|
17
17
|
# @param [Hash{String => String}] env environment variables
|
|
18
|
-
|
|
18
|
+
# @param [String, nil] model OpenAI model identifier
|
|
19
|
+
def initialize(env: ENV, model: DEFAULT_MODEL)
|
|
19
20
|
@env = env
|
|
21
|
+
@model = model
|
|
20
22
|
end
|
|
21
23
|
|
|
22
24
|
##
|
|
@@ -40,7 +42,7 @@ module CleoQualityReview
|
|
|
40
42
|
|
|
41
43
|
##
|
|
42
44
|
# @return [String] the model identifier to use
|
|
43
|
-
def model = DEFAULT_MODEL
|
|
45
|
+
def model = @model || DEFAULT_MODEL
|
|
44
46
|
|
|
45
47
|
##
|
|
46
48
|
# @return [Integer] timeout in seconds for OpenAI HTTP requests
|