Skip to content

Commit a626a54

Browse files
committed
docs(examples): Add canonical OpenAI starter example (#2082)
1 parent f0feb61 commit a626a54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/openai/run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# 1. Initialize the `instructor` client using `from_provider`
1313
# This sets up the OpenAI client with `instructor`'s patching automatically.
1414
# Replace "gpt-3.5-turbo" with your desired OpenAI model.
15-
client = instructor.from_provider("openai/gpt-3.5-turbo")
15+
client = instructor.from_provider("openai/gpt-4o-mini")
1616

1717
# 2. Define a simple Pydantic `response_model`
1818
# The LLM's response will be automatically parsed and validated into this model.
@@ -25,7 +25,7 @@ class UserDetail(BaseModel):
2525
# Instructor ensures the LLM's response conforms to the UserDetail schema.
2626
try:
2727
user_data = client.chat.completions.create(
28-
model="gpt-3.5-turbo", # Ensure this matches the model in from_provider if specific
28+
model="gpt-4o-mini", # Ensure this matches the model in from_provider if specific
2929
response_model=UserDetail,
3030
messages=[
3131
{

0 commit comments

Comments
 (0)