diff --git a/go.mod b/go.mod index dfcf28f..3f3ca90 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/0x9ef/openai-go -go 1.19 +go 1.17 require github.com/go-playground/validator/v10 v10.11.1 diff --git a/openai.go b/openai.go index 7d81b5b..89e7751 100644 --- a/openai.go +++ b/openai.go @@ -99,7 +99,7 @@ func (e *Engine) doReq(req *http.Request) (*http.Response, error) { return resp, apiErr } -func unmarshal(resp *http.Response, v any) error { +func unmarshal(resp *http.Response, v interface{}) error { defer resp.Body.Close() if err := json.NewDecoder(resp.Body).Decode(&v); err != nil { return err @@ -107,7 +107,7 @@ func unmarshal(resp *http.Response, v any) error { return nil } -func marshalJson(body any) (io.Reader, error) { +func marshalJson(body interface{}) (io.Reader, error) { b, err := json.Marshal(body) if err != nil { return nil, err