Skip to content

Commit

Permalink
fix: fix related code format to instructions issues
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 19, 2023
1 parent 59b194e commit a66d8b1
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,15 @@ class RelatedCodeStrategyBuilder(private val context: JobContext) :

override fun unique(list: List<RelatedCodeCompletionIns>): List<Instruction> {
return list.map {
val relatedCode = if (it.relatedCode.isNotBlank() || it.relatedCode.isNotEmpty()) {
"\n// Compare this snippets: \n ```${it.language}\n${it.relatedCode}\n```"
} else {
""
}
Instruction(
instruction = "Complete ${it.language} code, return rest code, no explaining",
output = it.output,
input = """
|```${it.language}
|${it.relatedCode}
|```
|
|Code:
|```${it.language}
|${it.beforeCursor}
|```""".trimMargin()
input = "$relatedCode\n\nCode:\n```${it.language}\n${it.beforeCursor}\n```"
)
}
}
Expand Down

0 comments on commit a66d8b1

Please sign in to comment.