diff --git a/llama/main.go b/llama/main.go index d186ad1eebcd77198fc3e3249d71361e9884fb08..84d29d80c6552385d019cdadddfbb71d5e73b09e 100644 --- a/llama/main.go +++ b/llama/main.go @@ -48,15 +48,13 @@ func main() { // Update the conversation context with the response conversationContext = updatedContext - var generatedCode = extraction.Extract(response) + generatedCode, _ := extraction.Extract(response) // Handle error with string fmt.Println("Ollama's response:", generatedCode) - var output string - var er error - output, er = compiler.CompileStringToGo(generatedCode) + output, err := compiler.CompileStringToGo(generatedCode) - if er != nil { + if err != nil { userPrompt = output + "\nFollowing are the errors, please fix the code. Write it again, and write only source code along with same test cases with no further explanation. The format should be ```rust <yourcode + testcases> ```" } else { fmt.Println("Compiled successfully. Here is the output: %v", output) @@ -65,7 +63,3 @@ func main() { } } - -// Following will be the suffix string for fixing the errors: - -// \nFollowing are the errors, please fix the code. Write it again, and write only source code along with same test cases with no further explanation. The format should be ```rust <yourcode + testcases> ```"