diff --git a/llama/main.go b/llama/main.go index 84d29d80c6552385d019cdadddfbb71d5e73b09e..7e2b774cc682571797c15c259fadb9a2f46f6500 100644 --- a/llama/main.go +++ b/llama/main.go @@ -48,7 +48,13 @@ func main() { // Update the conversation context with the response conversationContext = updatedContext - generatedCode, _ := extraction.Extract(response) // Handle error with string + generatedCode, err_extract := extraction.Extract(response) // Handle error with string + + if err_extract != nil { + fmt.Printf("The LLM gave a improper string in response: %v", response) + userPrompt = "exit" + continue + } fmt.Println("Ollama's response:", generatedCode) @@ -57,7 +63,7 @@ func main() { 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) + fmt.Printf("Compiled successfully. Here is the output: %v", output) userPrompt = "exit" }