Skip to content

Commit

Permalink
openai: trying to account for helicone's crap
Browse files Browse the repository at this point in the history
  • Loading branch information
ProducerMatt committed Sep 20, 2023
1 parent 72727f9 commit 12fb944
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import openai
from openai import Moderation
import discord
import requests
import json # moderation response dump

CURL_REQUEST: bool # helicone breaks some moderation attribute of openai module
Expand Down Expand Up @@ -130,7 +131,7 @@ def is_text_risky(self, text: str) -> bool:
self.log.debug(self.class_name, msg=f"OpenAI moderation response: {json.dumps(response)}")
return True
else:
self.log.info(self.class_name, msg=f"Text looks clean")
self.log.info(self.class_name, msg=f"Checked with content filter, it says the text looks clean")
return False

def get_engine(self, message: ServiceMessage) -> OpenAIEngines:
Expand Down

0 comments on commit 12fb944

Please sign in to comment.