mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-26 23:12:09 +02:00
Add more debugging info when OpenAI API returns zero responses for #167
This commit is contained in:
parent
212c24c30c
commit
80454d3859
@ -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)
|
return nil, OpenAiUsage{}, fmt.Errorf("failed to parse OpenAI API response=%#v: %w", bodyText, err)
|
||||||
}
|
}
|
||||||
if len(apiResp.Choices) == 0 {
|
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)
|
ret := make([]string, 0)
|
||||||
for _, item := range apiResp.Choices {
|
for _, item := range apiResp.Choices {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user