add log
This commit is contained in:
+1
-8
@@ -41,14 +41,7 @@ func (c Client) Chat(messages []*ChatMessage) (*ChatResponse, error) {
|
|||||||
return nil, fmt.Errorf("failed to query openai. Error: %s", err.Error())
|
return nil, fmt.Errorf("failed to query openai. Error: %s", err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
var test interface{}
|
fmt.Println("body response: ", string(res.Body()), res.Status())
|
||||||
if err := json.Unmarshal(res.Body(), &test); err != nil {
|
|
||||||
fmt.Println("ERROR: ", err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Println("Parsing response in interface:")
|
|
||||||
indent, _ := json.MarshalIndent(test, "\n", " ")
|
|
||||||
fmt.Printf("\n%+v\n", indent)
|
|
||||||
|
|
||||||
var r ChatResponse
|
var r ChatResponse
|
||||||
if err := json.Unmarshal(res.Body(), &r); err != nil {
|
if err := json.Unmarshal(res.Body(), &r); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user