Skip to content

Commit

Permalink
Beg for money on billing related error for image gen
Browse files Browse the repository at this point in the history
  • Loading branch information
rcy committed Dec 24, 2024
1 parent 74d1521 commit 1698d0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"log"
"net/http"
"os"
"strings"

openai "github.com/sashabaranov/go-openai"
)
Expand Down Expand Up @@ -47,6 +48,9 @@ func GenerateDALLE(ctx context.Context, prompt string) (*GeneratedImage, error)

imgResp, err := client.CreateImage(ctx, req)
if err != nil {
if strings.Contains(strings.ToLower(err.Error()), "billing") {
return nil, fmt.Errorf("I need money: https://rcy.sh/fundannie")
}
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion internal/ai/complete.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func Complete(ctx context.Context, model string, system string, message string)
})
if err != nil {
if strings.Contains(err.Error(), "billing") {
return "", fmt.Errorf("I need money: https://ko-fi.com/rcyemb")
return "", fmt.Errorf("I need money: https://rcy.sh/fundannie")
}

return "", err
Expand Down

0 comments on commit 1698d0a

Please sign in to comment.