Skip to content

Commit

Permalink
Change the "write-tests" 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

Part of #257
  • Loading branch information
ruiAzevedo19 committed Jul 11, 2024
1 parent ca25797 commit 56930f7
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 @@ -77,7 +77,7 @@ type llmSourceFilePromptContext struct {
var llmGenerateTestForFilePromptTemplate = template.Must(template.New("model-llm-generate-test-for-file-prompt").Parse(bytesutil.StringTrimIndentations(`
Given the following {{ .Language.Name }} code file "{{ .FilePath }}" with package "{{ .ImportPath }}", provide a test file for this code{{ with $testFramework := .Language.TestFramework }} with {{ $testFramework }} as a test framework{{ end }}.
The tests should produce 100 percent code coverage and must compile.
The response must contain only the test code and nothing else.
The response must contain only the test code in a fenced code block and nothing else.
` + "```" + `{{ .Language.ID }}
{{ .Code }}
Expand Down

0 comments on commit 56930f7

Please sign in to comment.