Closed czchen closed 7 months ago
Hmm, interesting. I just tested this again locally and confirmed it seems to work for me. 80454d3 adds more debugging information, can you try running hishtory update
and see if that contains any additional useful information? I'm wondering if there is a difference between how you and I have our API keys configured (e.g. do they not have access to the same OpenAI models?).
The following is log. No idea how to prevent log from truncated.
Warning: failed to search: failed to get AI query suggestions: OpenAI API returned zero choices, parsed resp=ai.openAiResponse{Id:"", Object:"", Created:0, Model:"", Usage:ai.OpenAiUsage{PromptTokens:0, Com
Search Query: > ? list all files larger than 1Mi
Ah, sorry about that getting cut off. If you make the terminal wider (e.g. by decreasing the font size) you should be able to see the full message. Alternatively, if you run hishtory update
you'll get the latest version with 4b93240 which will log it to the debug log which you can find via cat ~/.hishtory/hishtory.log | grep 'AI query'
.
I got the following log when setting OPENAI_API_KEY
.
time="2024-02-07T02:19:50+08:00" level=info msg="getRowsFromAiSuggestions(\"? \") ==> []string(nil)"
time="2024-02-07T02:19:50+08:00" level=info msg="getRowsFromAiSuggestions(\"? l\") ==> []string(nil)"
time="2024-02-07T02:19:50+08:00" level=info msg="getRowsFromAiSuggestions(\"? li\") ==> []string(nil)"
time="2024-02-07T02:19:51+08:00" level=info msg="getRowsFromAiSuggestions(\"? lis\") ==> []string(nil)"
time="2024-02-07T02:19:51+08:00" level=info msg="Running OpenAI query for \" list\""
time="2024-02-07T02:19:51+08:00" level=info msg="failed to get AI query suggestions: OpenAI API returned zero choices, parsed resp=ai.openAiResponse{Id:\"\", Object:\"\", Created:0, Model:\"\", Usage:ai.OpenAiUsage{PromptTokens:0, CompletionTokens:0, TotalTokens:0}, Choices:[]ai.openAiChoice(nil)}, resp body=[]byte{0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x22, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x3a, 0x20, 0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x59, 0x6f, 0x75, 0x20, 0x65, 0x78, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2c, 0x20, 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x70, 0x6c, 0x61, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2c, 0x20, 0x72, 0x65, 0x61, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x73, 0x3a, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, 0x63, 0x73, 0x2f, 0x67, 0x75, 0x69, 0x64, 0x65, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2d, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x3a, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x22, 0xa, 0x20, 0x20, 0x20, 0x20, 0x7d, 0xa, 0x7d, 0xa}, resp.StatusCode=429"
time="2024-02-07T02:19:52+08:00" level=info msg="ApiGet(\"/api/v1/get-deletion-requests?user_id=2PRSg2AX-w22odjRWEqi-jAVkuMMzuP22Gv_EolbS7c=&device_id=05bb48b5-66b9-4061-9c3a-65df03fe9114\"): 2.598253229s\n"
time="2024-02-07T02:20:24+08:00" level=info msg="ApiPost(\"https://api.hishtory.dev/api/v1/submit?source_device_id=05bb48b5-66b9-4061-9c3a-65df03fe9114\"): 555.188796ms\n"
time="2024-02-07T02:21:50+08:00" level=info msg="getRowsFromAiSuggestions(\"? list \") ==> []string(nil)"
time="2024-02-07T02:21:50+08:00" level=info msg="Running OpenAI query for \" list f\""
time="2024-02-07T02:21:50+08:00" level=info msg="failed to get AI query suggestions: OpenAI API returned zero choices, parsed resp=ai.openAiResponse{Id:\"\", Object:\"\", Created:0, Model:\"\", Usage:ai.OpenAiUsage{PromptTokens:0, CompletionTokens:0, TotalTokens:0}, Choices:[]ai.openAiChoice(nil)}, resp body=[]byte{0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x22, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x3a, 0x20, 0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x59, 0x6f, 0x75, 0x20, 0x65, 0x78, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2c, 0x20, 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x70, 0x6c, 0x61, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2c, 0x20, 0x72, 0x65, 0x61, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x73, 0x3a, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, 0x63, 0x73, 0x2f, 0x67, 0x75, 0x69, 0x64, 0x65, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2d, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x3a, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x22, 0xa, 0x20, 0x20, 0x20, 0x20, 0x7d, 0xa, 0x7d, 0xa}, resp.StatusCode=429"
time="2024-02-07T02:21:51+08:00" level=info msg="getRowsFromAiSuggestions(\"? list fi\") ==> []string(nil)"
time="2024-02-07T02:21:51+08:00" level=info msg="getRowsFromAiSuggestions(\"? list fil\") ==> []string(nil)"
time="2024-02-07T02:21:51+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file\") ==> []string(nil)"
time="2024-02-07T02:21:51+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file \") ==> []string(nil)"
time="2024-02-07T02:21:51+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file s\") ==> []string(nil)"
time="2024-02-07T02:21:52+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file si\") ==> []string(nil)"
time="2024-02-07T02:21:52+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file siz\") ==> []string(nil)"
time="2024-02-07T02:21:52+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file size\") ==> []string(nil)"
time="2024-02-07T02:21:52+08:00" level=info msg="Running OpenAI query for \" list file size \""
time="2024-02-07T02:21:52+08:00" level=info msg="failed to get AI query suggestions: OpenAI API returned zero choices, parsed resp=ai.openAiResponse{Id:\"\", Object:\"\", Created:0, Model:\"\", Usage:ai.OpenAiUsage{PromptTokens:0, CompletionTokens:0, TotalTokens:0}, Choices:[]ai.openAiChoice(nil)}, resp body=[]byte{0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x22, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x3a, 0x20, 0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x59, 0x6f, 0x75, 0x20, 0x65, 0x78, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2c, 0x20, 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x70, 0x6c, 0x61, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2c, 0x20, 0x72, 0x65, 0x61, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x73, 0x3a, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, 0x63, 0x73, 0x2f, 0x67, 0x75, 0x69, 0x64, 0x65, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2d, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x3a, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x22, 0xa, 0x20, 0x20, 0x20, 0x20, 0x7d, 0xa, 0x7d, 0xa}, resp.StatusCode=429"
time="2024-02-07T02:21:53+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file size l\") ==> []string(nil)"
time="2024-02-07T02:21:53+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file size la\") ==> []string(nil)"
time="2024-02-07T02:21:53+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file size lar\") ==> []string(nil)"
time="2024-02-07T02:21:53+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file size larg\") ==> []string(nil)"
time="2024-02-07T02:21:53+08:00" level=info msg="Running OpenAI query for \" list file size large\""
time="2024-02-07T02:21:54+08:00" level=info msg="failed to get AI query suggestions: OpenAI API returned zero choices, parsed resp=ai.openAiResponse{Id:\"\", Object:\"\", Created:0, Model:\"\", Usage:ai.OpenAiUsage{PromptTokens:0, CompletionTokens:0, TotalTokens:0}, Choices:[]ai.openAiChoice(nil)}, resp body=[]byte{0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x22, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x3a, 0x20, 0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x59, 0x6f, 0x75, 0x20, 0x65, 0x78, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2c, 0x20, 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x70, 0x6c, 0x61, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2c, 0x20, 0x72, 0x65, 0x61, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x73, 0x3a, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, 0x63, 0x73, 0x2f, 0x67, 0x75, 0x69, 0x64, 0x65, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2d, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x3a, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x22, 0xa, 0x20, 0x20, 0x20, 0x20, 0x7d, 0xa, 0x7d, 0xa}, resp.StatusCode=429"
time="2024-02-07T02:21:55+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file size larger\") ==> []string(nil)"
time="2024-02-07T02:21:55+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file size larger \") ==> []string(nil)"
time="2024-02-07T02:21:55+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file size larger t\") ==> []string(nil)"
time="2024-02-07T02:21:55+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file size larger th\") ==> []string(nil)"
time="2024-02-07T02:21:55+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file size larger tha\") ==> []string(nil)"
time="2024-02-07T02:21:55+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file size larger than\") ==> []string(nil)"
time="2024-02-07T02:21:56+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file size larger than \") ==> []string(nil)"
time="2024-02-07T02:21:56+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file size larger than 1\") ==> []string(nil)"
time="2024-02-07T02:21:56+08:00" level=info msg="Running OpenAI query for \" list file size larger than 1M\""
time="2024-02-07T02:21:56+08:00" level=info msg="failed to get AI query suggestions: OpenAI API returned zero choices, parsed resp=ai.openAiResponse{Id:\"\", Object:\"\", Created:0, Model:\"\", Usage:ai.OpenAiUsage{PromptTokens:0, CompletionTokens:0, TotalTokens:0}, Choices:[]ai.openAiChoice(nil)}, resp body=[]byte{0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x22, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x3a, 0x20, 0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x59, 0x6f, 0x75, 0x20, 0x65, 0x78, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2c, 0x20, 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x70, 0x6c, 0x61, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2c, 0x20, 0x72, 0x65, 0x61, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x73, 0x3a, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, 0x63, 0x73, 0x2f, 0x67, 0x75, 0x69, 0x64, 0x65, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2d, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x3a, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x22, 0xa, 0x20, 0x20, 0x20, 0x20, 0x7d, 0xa, 0x7d, 0xa}, resp.StatusCode=429"
time="2024-02-07T02:21:57+08:00" level=info msg="Running OpenAI query for \" list file size larger than 1Mb\""
time="2024-02-07T02:21:57+08:00" level=info msg="failed to get AI query suggestions: OpenAI API returned zero choices, parsed resp=ai.openAiResponse{Id:\"\", Object:\"\", Created:0, Model:\"\", Usage:ai.OpenAiUsage{PromptTokens:0, CompletionTokens:0, TotalTokens:0}, Choices:[]ai.openAiChoice(nil)}, resp body=[]byte{0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x22, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x3a, 0x20, 0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x59, 0x6f, 0x75, 0x20, 0x65, 0x78, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2c, 0x20, 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x70, 0x6c, 0x61, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2c, 0x20, 0x72, 0x65, 0x61, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x73, 0x3a, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, 0x63, 0x73, 0x2f, 0x67, 0x75, 0x69, 0x64, 0x65, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2d, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x3a, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x22, 0xa, 0x20, 0x20, 0x20, 0x20, 0x7d, 0xa, 0x7d, 0xa}, resp.StatusCode=429"
time="2024-02-07T02:21:57+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file size larger than 1M\") ==> []string(nil)"
time="2024-02-07T02:21:57+08:00" level=info msg="getRowsFromAiSuggestions(\"? list file size larger than 1Mi\") ==> []string(nil)"
time="2024-02-07T02:21:58+08:00" level=info msg="Running OpenAI query for \" list file size larger than 1Mib\""
time="2024-02-07T02:21:58+08:00" level=info msg="failed to get AI query suggestions: OpenAI API returned zero choices, parsed resp=ai.openAiResponse{Id:\"\", Object:\"\", Created:0, Model:\"\", Usage:ai.OpenAiUsage{PromptTokens:0, CompletionTokens:0, TotalTokens:0}, Choices:[]ai.openAiChoice(nil)}, resp body=[]byte{0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x22, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x3a, 0x20, 0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x59, 0x6f, 0x75, 0x20, 0x65, 0x78, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2c, 0x20, 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x70, 0x6c, 0x61, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2c, 0x20, 0x72, 0x65, 0x61, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x73, 0x3a, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, 0x63, 0x73, 0x2f, 0x67, 0x75, 0x69, 0x64, 0x65, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2d, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x3a, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x22, 0xa, 0x20, 0x20, 0x20, 0x20, 0x7d, 0xa, 0x7d, 0xa}, resp.StatusCode=429"
It looks like it is an issue with your API key:
In [1]: x=[0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x22, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x3a, 0x20, 0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x6
...: 5, 0x22, 0x3a, 0x20, 0x22, 0x59, 0x6f, 0x75, 0x20, 0x65, 0x78, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x71, 0x75, 0
...: x6f, 0x74, 0x61, 0x2c, 0x20, 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x70, 0x6c, 0x61, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62,
...: 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x7
...: 4, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2c, 0x20, 0x72, 0x65, 0x61, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x73, 0
...: x3a, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, 0x63,
...: 0x73, 0x2f, 0x67, 0x75, 0x69, 0x64, 0x65, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2d, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x2
...: 2, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x
...: 71, 0x75, 0x6f, 0x74, 0x61, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x3a, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0xa, 0x20, 0x20, 0x
...: 20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61,
...: 0x22, 0xa, 0x20, 0x20, 0x20, 0x20, 0x7d, 0xa, 0x7d, 0xa]
In [2]: ''.join(chr(a) for a in x)
Out[2]: '{\n "error": {\n "message": "You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.",\n "type": "insufficient_quota",\n "param": null,\n "code": "insufficient_quota"\n }\n}\n'
Though now that I see how OpenAI formats their error messages, I'll be sure to improve the error message that hishtory displays in this case.
Thanks for the help.
hishtory always has the following error when
OPENAI_API_KEY
is configured.