instructor icon indicating copy to clipboard operation
instructor copied to clipboard

AttributeError in examples/query_planner_execution

Open johnwlockwood opened this issue 10 months ago • 0 comments

  • [x] This is actually a bug report.
  • [ ] I am not getting good LLM Results
  • [ ] I have tried asking for help in the community on discord or discussions and have not received a response.
  • [ ] I have tried searching the documentation and have not found an answer.

What Model are you using?

  • [ ] gpt-3.5-turbo
  • [ ] gpt-4-turbo
  • [ ] gpt-4
  • [x] Other (please specify)

Describe the bug

AttributeError in query_planner_execution.py

% python examples/query_planner_execution/query_planner_execution.py
Traceback (most recent call last):
  File "/Users/john/repos/instructor/examples/query_planner_execution/query_planner_execution.py", line 162, in <module>
    plan = query_planner(
        "What is the difference in populations of Canada and the Jason's home country?",
        plan=False,
    )
  File "/Users/john/repos/instructor/examples/query_planner_execution/query_planner_execution.py", line 150, in query_planner
    functions=[QueryPlan.openai_schema],
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/john/repos/instructor/.venv/lib/python3.13/site-packages/pydantic/_internal/_model_construction.py", line 320, in __getattr__
    raise AttributeError(item)
AttributeError: openai_schema

To Reproduce Steps to reproduce the behavior, including code snippets of the model and the input data and openai response.

python examples/query_planner_execution/query_planner_execution.py

Expected behavior

Expect no AttributeError

Screenshots If applicable, add screenshots to help explain your problem.

johnwlockwood avatar Jun 03 '25 19:06 johnwlockwood