Skip to content

Commit

Permalink
feat: don't ask for password if backend is localai
Browse files Browse the repository at this point in the history
Signed-off-by: Aris Boutselis <aris.boutselis@senseon.io>
  • Loading branch information
Aris Boutselis committed Apr 25, 2023
1 parent c365c53 commit 74d9a75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var AuthCmd = &cobra.Command{
os.Exit(1)
}

if password == "" {
if ai.NeedPassword(backend) && password == "" {
fmt.Printf("Enter %s Key: ", backend)
bytePassword, err := term.ReadPassword(int(syscall.Stdin))
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions pkg/ai/iai.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@ func (p *AIProvider) GetPassword() string {
func (p *AIProvider) GetModel() string {
return p.Model
}

func NeedPassword(backend string) bool {
return backend != "localai"
}

0 comments on commit 74d9a75

Please sign in to comment.