12
12
13
13
try :
14
14
from llm_change_agent .cli import execute
15
- from llm_change_agent .utils .llm_utils import extract_commands
15
+ from llm_change_agent .utils .llm_utils import (
16
+ extract_commands ,
17
+ get_anthropic_models ,
18
+ get_lbl_cborg_models ,
19
+ get_ollama_models ,
20
+ get_openai_models ,
21
+ )
22
+
23
+ from ontobot_change_agent .constants import (
24
+ ANTHROPIC_PROVIDER ,
25
+ CBORG_PROVIDER ,
26
+ OLLAMA_PROVIDER ,
27
+ OPENAI_PROVIDER ,
28
+ OWL_EXTENSION ,
29
+ )
16
30
17
31
llm_change_agent_available = True
32
+ ALL_AVAILABLE_PROVIDERS = [OPENAI_PROVIDER , OLLAMA_PROVIDER , ANTHROPIC_PROVIDER , CBORG_PROVIDER ]
33
+ ALL_AVAILABLE_MODELS = (
34
+ get_openai_models () + get_ollama_models () + get_anthropic_models () + get_lbl_cborg_models ()
35
+ )
18
36
except ImportError :
19
37
# Handle the case where the package is not installed
20
38
llm_change_agent_available = False
29
47
process_issue_via_jar ,
30
48
process_issue_via_oak ,
31
49
)
32
- from ontobot_change_agent .constants import OPEN_AI_MODEL , OPENAI_PROVIDER , OWL_EXTENSION
33
50
34
51
__all__ = [
35
52
"main" ,
@@ -123,6 +140,12 @@ def main(verbose: int, quiet: bool):
123
140
default = False ,
124
141
help = "Use llm-change-agent for processing." ,
125
142
)
143
+ llm_provider_option = click .option (
144
+ "--provider" , type = click .Choice (ALL_AVAILABLE_PROVIDERS ), help = "Provider to use for generation."
145
+ )
146
+ llm_model_option = click .option (
147
+ "--model" , type = click .Choice (ALL_AVAILABLE_MODELS ), help = "Model to use for generation."
148
+ )
126
149
127
150
128
151
@main .command ()
@@ -188,6 +211,8 @@ def get_labels(repo: str, token: str):
188
211
@jar_path_option
189
212
@output_option
190
213
@use_llm_option
214
+ @llm_provider_option
215
+ @llm_model_option
191
216
def process_issue (
192
217
input : str ,
193
218
repo : str ,
@@ -200,6 +225,8 @@ def process_issue(
200
225
jar_path : str ,
201
226
output : str ,
202
227
use_llm : bool = False ,
228
+ provider : str = None ,
229
+ model : str = None ,
203
230
):
204
231
"""Run processes based on issue label.
205
232
@@ -249,8 +276,8 @@ def process_issue(
249
276
click .echo (f"Summoning llm-change-agent for { issue [TITLE ]} " )
250
277
with click .Context (execute ) as ctx :
251
278
ctx .params ["prompt" ] = issue [BODY ]
252
- ctx .params ["provider" ] = OPENAI_PROVIDER
253
- ctx .params ["model" ] = OPEN_AI_MODEL
279
+ ctx .params ["provider" ] = provider
280
+ ctx .params ["model" ] = model
254
281
response = extract_commands (execute .invoke (ctx ))
255
282
KGCL_COMMANDS = [
256
283
command .replace ('"' , "'" ) for command in ast .literal_eval (response )
0 commit comments