From a549412eacff66f495db347bc57371de99219b33 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Sat, 9 Dec 2023 11:25:12 -0500 Subject: web/openai/moderation: constructor method Signed-off-by: Xe Iaso --- web/openai/moderation/moderation.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'web') diff --git a/web/openai/moderation/moderation.go b/web/openai/moderation/moderation.go index 7f73bf2..0476b1c 100644 --- a/web/openai/moderation/moderation.go +++ b/web/openai/moderation/moderation.go @@ -97,6 +97,13 @@ type Client struct { apiKey string } +func New(httpCli *http.Client, apiKey string) *Client { + return &Client{ + httpCli: httpCli, + apiKey: apiKey, + } +} + func (c Client) Check(ctx context.Context, input string) (*Response, error) { data := Request{ Input: input, -- cgit v1.2.3