Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Sverdlov <[email protected]>
  • Loading branch information
sverdlov93 committed Mar 28, 2024
1 parent 3597be6 commit 03c6d3b
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions general/ai/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const (
type questionBody struct {
Question string `json:"question"`
}

type feedbackBody struct {
questionBody
LlmAnswer string `json:"llm_answer"`
Expand Down Expand Up @@ -57,8 +58,7 @@ func HowCmd(c *cli.Context) error {

feedback := feedbackBody{questionBody: question, LlmAnswer: llmAnswer}
feedback.getUserFeedback()
err = sendFeedback(feedback)
if err != nil {
if err = sendFeedback(feedback); err != nil {
return err
}
log.Output("Thank you for your feedback!")
Expand All @@ -68,14 +68,7 @@ func HowCmd(c *cli.Context) error {
func (fb *feedbackBody) getUserFeedback() {
fb.IsAccurate = coreutils.AskYesNo(coreutils.PrintLink("Is the provided command accurate?"), true)
if !fb.IsAccurate {
for {
ioutils.ScanFromConsole("Please provide the exact command you expected", &fb.ExpectedAnswer, "")
if strings.HasPrefix(fb.ExpectedAnswer, "jf ") {
break
} else {
log.Output("Please provide a valid JFrog CLI command that start with jf. (Example: 'jf rt u ...')")
}
}
ioutils.ScanFromConsole("Please provide the exact command you expected (Example: 'jf rt u ...')", &fb.ExpectedAnswer, "")
}
}

Expand Down

0 comments on commit 03c6d3b

Please sign in to comment.