mirror of
https://github.com/kennethreitz/instructor.git
synced 2026-06-05 22:50:18 +00:00
updat docs
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user