Skip to content

Commit

Permalink
Change the "code-repair" task prompt to enforce the generated code to…
Browse files Browse the repository at this point in the history
… be inside code fences, to ensure we can extract the code from the LLMs response

Closes #257
  • Loading branch information
ruiAzevedo19 committed Jul 11, 2024
1 parent 56930f7 commit 2c01b18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model/llm/llm.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ type llmCodeRepairSourceFilePromptContext struct {
// llmCodeRepairSourceFilePromptTemplate is the template for generating an LLM code repair prompt.
var llmCodeRepairSourceFilePromptTemplate = template.Must(template.New("model-llm-code-repair-source-file-prompt").Parse(bytesutil.StringTrimIndentations(`
Given the following {{ .Language.Name }} code file "{{ .FilePath }}" with package "{{ .ImportPath }}" and a list of compilation errors, modify the code such that the errors are resolved.
The response must contain only the source code and nothing else.
The response must contain only the source code in a fenced code block and nothing else.
` + "```" + `{{ .Language.ID }}
{{ .Code }}
Expand Down

0 comments on commit 2c01b18

Please sign in to comment.