From 2ecca6931db965da872148f7525ef308f2b9ec08 Mon Sep 17 00:00:00 2001 From: ammar68 <ammaa@stud.ntnu.no> Date: Thu, 10 Oct 2024 14:28:35 +0200 Subject: [PATCH] fix type specification in main.go --- llama/main.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/llama/main.go b/llama/main.go index d186ad1..84d29d8 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> ```" -- GitLab