Add more debugging info when OpenAI API returns zero responses for #167

This commit is contained in:
David Dworken 2024-02-04 17:32:20 -08:00
parent 212c24c30c
commit 80454d3859
No known key found for this signature in database

View File

@ -103,7 +103,7 @@ func GetAiSuggestionsViaOpenAiApi(query, shellName, osName string, numberComplet
return nil, OpenAiUsage{}, fmt.Errorf("failed to parse OpenAI API response=%#v: %w", bodyText, err)
}
if len(apiResp.Choices) == 0 {
return nil, OpenAiUsage{}, fmt.Errorf("OpenAI API returned zero choices, resp=%#v", apiResp)
return nil, OpenAiUsage{}, fmt.Errorf("OpenAI API returned zero choices, parsed resp=%#v, resp body=%#v", apiResp, bodyText)
}
ret := make([]string, 0)
for _, item := range apiResp.Choices {