Databingo / aih

Talk to AI modes in terminal. Bard|GPT3.5|Llama2
MIT License
157 stars 11 forks source link

Mistakingly used uncorrect input for bing cookies, now aih panic every time I invoke it #1

Closed moisestohias closed 1 year ago

moisestohias commented 1 year ago

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]: github.com/Databingo/EdgeGPT-Go/internal/CookieManager.(Manager).findMinIndex(...) /Users/chengang/go/pkg/mod/github.com/!databingo/!edge!g!p!t-!go@v0.0.0-20230430071734-8b14b987728f/internal/CookieManager/manager.go:92 github.com/Databingo/EdgeGPT-Go/internal/CookieManager.(Manager).GetBestCookie(0x1?) /Users/chengang/go/pkg/mod/github.com/!databingo/!edge!g!p!t-!go@v0.0.0-20230430071734-8b14b987728f/internal/CookieManager/manager.go:76 +0x131 github.com/Databingo/EdgeGPT-Go.NewGPT(0xc0000baf80) /Users/chengang/go/pkg/mod/github.com/!databingo/!edge!g!p!t-!go@v0.0.0-20230430071734-8b14b987728f/gpt.go:46 +0x3d github.com/Databingo/EdgeGPT-Go.(*Storage).GetOrSet(0xc00011d4b8, {0xa359d1, 0x7}) /Users/chengang/go/pkg/mod/github.com/!databingo/!edge!g!p!t-!go@v0.0.0-20230430071734-8b14b987728f/storage.go:31 +0xab main.main() /usr/local/projects/aih/main.go:166 +0xbd8

Databingo commented 1 year ago

Hi thanks for replay. You could remove the cookie file manually from the folder(suppose you put it in /usr/local/projects/aih) of Aih for now: rm -rf /usr/local/projects/aih/cookies Then restart Aih you could reset bing cookies via bingkey. I would add cookie value checking to the code as soon as possible. Thanks.

Databingo commented 1 year ago

Hi, I have added bing cookie checking. Rebuild or download binary will fix the problem. Thanks for your reports.

moisestohias commented 1 year ago

Thanks legend 😘