instructor-ai/instructor

Copying the code from the README results in an error.

Closed this issue · 2 comments

What Model are you using?

  • gpt-3.5-turbo

Describe the bug
Copying the code from the README results in an error.

import openai
import instructor
from pydantic import BaseModel


class User(BaseModel):
    name: str
    age: int


client = instructor.from_openai(openai.OpenAI())

user = client.chat.completions.create(
    model="gpt-4-turbo-preview",
    messages=[
        {"role": "user", "content": "Create a user"},
    ],
    response_model=User,
)
print(user)

ImportError: cannot import name 'pydantic_function_tool' from 'openai'

what was the issue?

Just update the lib, this issue can be fixed.