diff --git a/general/ai/cli.go b/general/ai/cli.go index 7209e6553..5d513b6fd 100644 --- a/general/ai/cli.go +++ b/general/ai/cli.go @@ -50,6 +50,10 @@ func HowCmd(c *cli.Context) error { if err != nil { return err } + if strings.ToLower(llmAnswer) == "i dont know" { + log.Output("The current version of the AI model does not support this type of command yet.") + return nil + } log.Output("AI generated JFrog CLI command:") err = coreutils.PrintTable("", "", coreutils.PrintTitle(llmAnswer), false) if err != nil { @@ -123,7 +127,7 @@ func sendRequestToCliAiServer(content interface{}, apiCommand ApiCommand) (respo if errorutils.CheckError(err) != nil { return } - response = string(body) + response = strings.TrimSpace(string(body)) } return } diff --git a/go.mod b/go.mod index 2637bd04f..b9b1b1a5d 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/agnivade/levenshtein v1.1.1 github.com/buger/jsonparser v1.1.1 github.com/go-git/go-git/v5 v5.12.0 - github.com/gocarina/gocsv v0.0.0-20231116093920-b87c2d0e983a + github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1 github.com/jfrog/archiver/v3 v3.6.0 github.com/jfrog/build-info-go v1.9.26 github.com/jfrog/gofrog v1.7.1 diff --git a/go.sum b/go.sum index 4538fcd4c..443210ade 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,8 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/gocarina/gocsv v0.0.0-20231116093920-b87c2d0e983a h1:RYfmiM0zluBJOiPDJseKLEN4BapJ42uSi9SZBQ2YyiA= -github.com/gocarina/gocsv v0.0.0-20231116093920-b87c2d0e983a/go.mod h1:5YoVOkjYAQumqlV356Hj3xeYh4BdZuLE0/nRkf2NKkI= +github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1 h1:FWNFq4fM1wPfcK40yHE5UO3RUdSNPaBC+j3PokzA6OQ= +github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1/go.mod h1:5YoVOkjYAQumqlV356Hj3xeYh4BdZuLE0/nRkf2NKkI= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= diff --git a/main.go b/main.go index ecdcbbdb7..873e6a594 100644 --- a/main.go +++ b/main.go @@ -140,7 +140,7 @@ func setUberTraceIdToken() error { return err } httpclient.SetUberTraceIdToken(traceID) - clientlog.Debug("Trace ID for JFrog Platform logs: ", traceID) + clientlog.Debug("Trace ID for JFrog Platform logs:", traceID) return nil }