diff --git a/docs/examples/entity_resolution.md b/docs/examples/entity_resolution.md index 5394a08..da766ce 100644 --- a/docs/examples/entity_resolution.md +++ b/docs/examples/entity_resolution.md @@ -54,6 +54,8 @@ The **`ask_ai`** function utilizes OpenAI's API to extract and resolve entities import openai import instructor +# Adds response_model to ChatCompletion +# Allows the return of Pydantic model rather than raw JSON instructor.patch() def ask_ai(content) -> DocumentExtraction: diff --git a/docs/examples/knowledge_graph.md b/docs/examples/knowledge_graph.md index ec2561e..d100591 100644 --- a/docs/examples/knowledge_graph.md +++ b/docs/examples/knowledge_graph.md @@ -35,6 +35,11 @@ The **`generate_graph`** function leverages OpenAI's API to generate a knowledge ```python import openai +import instructor + +# Adds response_model to ChatCompletion +# Allows the return of Pydantic model rather than raw JSON +instructor.patch() def generate_graph(input) -> KnowledgeGraph: return openai.ChatCompletion.create(