Skip to content

Commit

Permalink
refactor: update prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 4, 2023
1 parent 9e0e247 commit 2c6ecb4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
12 changes: 6 additions & 6 deletions prompts/autodev/code-completion.vm
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
Complete ${context.lang} code, return rest code, no explaining
## check by controler,service, model
#set($isController = $!{MvcUtil.isController($fileName, $lang)})
#set($isService = $!{MvcUtil.isService($fileName, $lang)})
#set($isController = $!{ArchUtil.isController(${context.fileName}, ${context.lang})})
#set($isService = $!{ArchUtil.isService(${context.fileName}, ${context.lang})})

#if ($isController)
#set($spec = $!{CustomPromptConfig.load().spec["controller"]})
#set($spec = $!{PromptConfig.load().spec["controller"]})
#if (!$spec.isEmpty())
#set($additionContext = "requirements: \n$spec")
#end
#set($additionContext = "$additionContext$mvcContextService.controllerPrompt($file)")
## get service and model code by imports ?
#elseif ($isService)
#set($spec = $!{CustomPromptConfig.load().spec["service"]})
#set($spec = $!{PromptConfig.load().spec["service"]})
#if (!$spec.isEmpty())
#set($additionContext = "requirements: \n$spec")
#end
#set($additionContext = "$additionContext$mvcContextService.servicePrompt($file)")
#set($additionContext = "${context.servicePrompt($file)}")
## get service and model code by imports ?
#else
#set($additionContext = $!{SimilarChunksWithPaths.createQuery($file)})
#set($additionContext = $!{Smart.simliarChunk($file)})
#end
3 changes: 3 additions & 0 deletions prompts/autodev/explain-code.vm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
${context.instruction}

${context.code}
10 changes: 10 additions & 0 deletions prompts/autodev/test-generate.vm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Write unit test for following code.

${context.coc}
${context.framework}

${context.related_model}

```${context.language}
${context.selection}
```
5 changes: 2 additions & 3 deletions prompts/custom/explain-code.vm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
```user```
${context.instruction}


${context.before_cursor}
${context.code}

0 comments on commit 2c6ecb4

Please sign in to comment.