Skip to content

Commit

Permalink
doc: Update self_critique.md (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrimee authored May 6, 2024
1 parent ef0d0b0 commit 9ea022f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/examples/self_critique.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,17 @@ Lets integrate `llm_validator` into the model and see the error message. Its imp
from pydantic import BaseModel, BeforeValidator
from typing_extensions import Annotated
from instructor import llm_validator
from openai import OpenAI
import instructor

client = instructor.from_openai(OpenAI())

class QuestionAnswerNoEvil(BaseModel):
question: str
answer: Annotated[
str,
BeforeValidator(
llm_validator("don't say objectionable things", allow_override=True)
llm_validator("don't say objectionable things", client=client, allow_override=True)
),
]

Expand Down

0 comments on commit 9ea022f

Please sign in to comment.