Skip to content

Commit

Permalink
wrap openai moderations
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinpad committed Jan 14, 2025
1 parent e914851 commit 82cd2cc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion py/autoevals/moderation.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(
super().__init__(api_key=api_key, base_url=base_url, client=client)
self.threshold = threshold

def _run_eval_sync(self, output, __expected=None):
def _run_eval_sync(self, output, expected=None, **kwargs):
moderation_response = run_cached_request(
client=self.client, request_type=REQUEST_TYPE, input=output, **self.extra_args
)["results"][0]
Expand Down
4 changes: 2 additions & 2 deletions py/autoevals/oai.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ def prepare_openai(client: Optional[LLMClient] = None, is_async=False, api_key=N
if is_async:
complete_fn = openai_obj.ChatCompletion.acreate
embedding_fn = openai_obj.Embedding.acreate
moderation_fn = openai_obj.Moderations.acreate
moderation_fn = openai_obj.Moderation.acreate
else:
complete_fn = openai_obj.ChatCompletion.create
embedding_fn = openai_obj.Embedding.create
moderation_fn = openai_obj.Moderations.create
moderation_fn = openai_obj.Moderation.create
client = Client(
openai=openai,
complete=complete_fn,
Expand Down
2 changes: 1 addition & 1 deletion py/autoevals/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "0.0.115"
VERSION = "0.0.116"

0 comments on commit 82cd2cc

Please sign in to comment.