add testable json marshaller (#161)

This commit is contained in:
sashabaranov
2023-03-15 12:16:47 +04:00
committed by GitHub
parent ba77a6476e
commit 53d195cf5a
10 changed files with 102 additions and 18 deletions

View File

@@ -3,7 +3,6 @@ package openai
import (
"bytes"
"context"
"encoding/json"
"errors"
"net/http"
)
@@ -107,7 +106,7 @@ func (c *Client) CreateCompletion(
}
var reqBytes []byte
reqBytes, err = json.Marshal(request)
reqBytes, err = c.marshaller.marshal(request)
if err != nil {
return
}