diff options
| author | Xe Iaso <me@xeiaso.net> | 2023-12-09 11:25:12 -0500 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2023-12-14 11:47:18 -0500 |
| commit | a549412eacff66f495db347bc57371de99219b33 (patch) | |
| tree | cc42454e2bcf889a7b1c7044275c0550dbcf6873 | |
| parent | e3d3291226f3e76b6968d422262fe4398e35a936 (diff) | |
| download | x-a549412eacff66f495db347bc57371de99219b33.tar.xz x-a549412eacff66f495db347bc57371de99219b33.zip | |
web/openai/moderation: constructor method
Signed-off-by: Xe Iaso <me@xeiaso.net>
| -rw-r--r-- | web/openai/moderation/moderation.go | 7 |
1 files changed, 7 insertions, 0 deletions
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, |
