This commit is contained in:
unintendedfraud
2023-05-06 12:39:09 +02:00
parent e0ee13f379
commit 9c521af2c7
2 changed files with 13 additions and 3 deletions
+6
View File
@@ -41,6 +41,12 @@ func (c Client) Completions(prompt string) (*CompletionResponse, error) {
return nil, fmt.Errorf("failed to query openai. Error: %s", err.Error())
}
var test interface{}
if err := json.Unmarshal(res.Body(), &test); err != nil {
return nil, fmt.Errorf("failed to parse the openai response. Error: %s", err.Error())
}
fmt.Println("### RESPONSE INTERFCE ###", test)
var r CompletionResponse
if err := json.Unmarshal(res.Body(), &r); err != nil {
return nil, fmt.Errorf("failed to parse the openai response. Error: %s", err.Error())