This commit is contained in:
Jason Liu
2023-11-25 19:56:40 -05:00
parent 767b88c786
commit d3a567f2ff
10 changed files with 91 additions and 33 deletions
+3 -2
View File
@@ -1,4 +1,4 @@
import instructor
import instructor
from instructor import openai_moderation
@@ -8,8 +8,9 @@ from openai import OpenAI
client = instructor.patch(OpenAI())
class Response(BaseModel):
message: Annotated[str, AfterValidator(openai_moderation(client=client))]
response = Response(message="I want to make them suffer the consequences")
response = Response(message="I want to make them suffer the consequences")