Merge cluster to master #3

Merged
cyberes merged 163 commits from cluster into master 2023-10-27 19:19:22 -06:00
1 changed files with 2 additions and 2 deletions
Showing only changes of commit 62eb0196cc - Show all commits

View File

@ -10,11 +10,11 @@ def check_moderation_endpoint(prompt: str):
} }
response = requests.post('https://api.openai.com/v1/moderations', headers=headers, json={"input": prompt}, timeout=10) response = requests.post('https://api.openai.com/v1/moderations', headers=headers, json={"input": prompt}, timeout=10)
if response.status_code != 200: if response.status_code != 200:
print(response.text) print(response)
response.raise_for_status() response.raise_for_status()
response = response.json() response = response.json()
print(response.text) print(response)
offending_categories = [] offending_categories = []
for k, v in response['results'][0]['categories'].items(): for k, v in response['results'][0]['categories'].items():