We want to use aictl in CI so that we can get a review of PR or specified files and so on
What is the issue?
We have two types of output format: json, text.
In json, it's more easy to handle if we parse a response from OpenAI but need to be aware of field and types (requires a support for handling JSON Schema)
In text, we can just print a response from OpenAI but it's more difficult to process the response than json because it is not structured.
examples
response in json
$ aictl query -ojson 'In Golang, we got an error when you write `fmt.Print("test")` but how can we fix it?'
{
"error": "The function fmt.Print requires the fmt package to be imported. Please make sure to include 'import \"fmt\"' at the beginning of your Go file.",
"suggestion": "Add the following line at the top of your Go file:\n\nimport \"fmt\"",
"correct_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n fmt.Print(\"test\")\n}"
}
response in text
$ aictl query 'In Golang, we got an error when you write `fmt.Print("test")` but how can we fix it?'
In Go, if you're encountering an error with `fmt.Print("test")`, it likely means that you haven't imported the `fmt` package. To resolve the issue, make sure to include the `fmt` package at the beginning of your Go file. Here’s how you can do it:
```go
package main
import "fmt"
func main() {
fmt.Print("test")
}
Make sure you have the package main declaration and the necessary import for fmt. This should fix the error, and you should be able to run your program without issues.
Goal
What is the issue?
We have two types of output format: json, text.
examples
response in json
response in text
Make sure you have the
package main
declaration and the necessary import forfmt
. This should fix the error, and you should be able to run your program without issues.