instructor icon indicating copy to clipboard operation
instructor copied to clipboard

Creating client with `from_openai` leads to AttributeError: 'Instructor' object has no attribute 'moderations' in moderation example

Open absolutelyNoWarranty opened this issue 8 months ago • 1 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
  • [ ] Other (please specify)

Describe the bug Moderation example https://github.com/jxnl/instructor/blob/1.3.3/examples/validators/moderation.py does not work and fails with

AttributeError: 'Instructor' object has no attribute 'moderations'

However, it works if I use .patch instead of .from_openai.

Using: openai==1.35.1 instructor==1.3.3

Additionally, the help comment for openai_moderation refers to a non-existant OpenAIModeration.

absolutelyNoWarranty avatar Jun 20 '24 09:06 absolutelyNoWarranty