You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: code-generator/simple/src/main/kotlin/com/javaaidev/easyllmtools/codegenerator/simple/SimpleCodeGenerator.kt
+35-13Lines changed: 35 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,7 @@ data class GeneratedFile(
52
52
valtemplateName:String,
53
53
valdir:Path,
54
54
valoverwrite:Boolean = true,
55
+
valskip:Boolean = false,
55
56
valfileNameSupplier:Supplier<String>,
56
57
)
57
58
@@ -79,16 +80,23 @@ object SimpleCodeGenerator {
79
80
overwriteToolImplementation:Boolean,
80
81
overwritePomFile:Boolean,
81
82
toolIdPrefix:String,
83
+
modelFilesOnly:Boolean,
84
+
noModelFiles:Boolean,
82
85
parentGroupId:String,
83
86
parentArtifactId:String,
84
87
parentArtifactVersion:String,
88
+
customToolName:String,
89
+
toolDescription:String,
90
+
customModelPackageName:String,
85
91
) {
86
92
logger.info("Generate code from {}", inputSpec.toPath().toAbsolutePath().normalize())
87
93
val jsonNode = objectMapper.readTree(inputSpec)
88
94
val definitionNode =
89
95
jsonNode.get("definition") ?:throwInvalidToolSpecException("Definition is a required")
90
-
val name = definitionNode.get("name")?.textValue() ?:""
91
-
val description = definitionNode.get("description")?.textValue() ?:""
Copy file name to clipboardExpand all lines: code-generator/simple/src/main/kotlin/com/javaaidev/easyllmtools/codegenerator/simple/SimpleCodeGeneratorCommand.kt
+40Lines changed: 40 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,41 @@ class SimpleCodeGeneratorCommand : Callable<Int> {
31
31
)
32
32
var toolIdPrefix =""
33
33
34
+
@CommandLine.Option(
35
+
names = ["--model-files-only"],
36
+
defaultValue ="false",
37
+
description = ["Only generate model files"]
38
+
)
39
+
var modelFilesOnly:Boolean=false
40
+
41
+
@CommandLine.Option(
42
+
names = ["--no-model-files"],
43
+
defaultValue ="false",
44
+
description = ["Skip generation of model files"]
45
+
)
46
+
var noModelFiles:Boolean=false
47
+
48
+
@CommandLine.Option(
49
+
names = ["--tool-name"],
50
+
defaultValue ="",
51
+
description = ["Override tool name in the spec file"]
52
+
)
53
+
var toolName:String=""
54
+
55
+
@CommandLine.Option(
56
+
names = ["--tool-description"],
57
+
defaultValue ="",
58
+
description = ["Override tool description in the spec file"]
59
+
)
60
+
var toolDescription:String=""
61
+
62
+
@CommandLine.Option(
63
+
names = ["--model-package-name"],
64
+
defaultValue ="",
65
+
description = ["Override default model package name"]
66
+
)
67
+
var modelPackageName:String=""
68
+
34
69
overridefuncall(): Int {
35
70
SimpleCodeGenerator.generate(
36
71
options.inputSpec,
@@ -42,9 +77,14 @@ class SimpleCodeGeneratorCommand : Callable<Int> {
0 commit comments