Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instructor groq example not working #556

Closed
rabem00 opened this issue Apr 3, 2024 · 2 comments
Closed

Instructor groq example not working #556

rabem00 opened this issue Apr 3, 2024 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@rabem00
Copy link
Contributor

rabem00 commented Apr 3, 2024

  • [x ] I have tried searching the documentation and have not found an answer.

What Model are you using?

  • [ x] Other : groq with mixtral

Describe the bug
Trying the example from instructor hub or described on https://python.useinstructor.com/hub/groq/ , but getting an error.

% python groq_example.py 
Traceback (most recent call last):
  File "/Users/Development/lab/structured-output/instructor/groq_example.py", line 16, in <module>
    client = instructor.from_openai(client, mode=instructor.Mode.MD_JSON)
  File "/opt/homebrew/Caskroom/miniconda/base/envs/instructor/lib/python3.10/site-packages/instructor/client.py", line 274, in from_openai
    assert isinstance(
AssertionError: Client must be an instance of openai.OpenAI or openai.AsyncOpenAI

To Reproduce
Get the described example on https://python.useinstructor.com/hub/groq/ and run.
It seems instructor client.py is expecting openai.OpenAI as described on line 274 of client.py, so the example will never work.

Maybe I'm missing something?

@jxnl
Copy link
Collaborator

jxnl commented Apr 3, 2024

ad this is due to the new client, are you able to make a PR thats just from_groq?

@jxnl jxnl added the help wanted Extra attention is needed label Apr 3, 2024
@rabem00
Copy link
Contributor Author

rabem00 commented Apr 3, 2024

I just created a pull request #561 with a possible from_groq solution.

jxnl added a commit that referenced this issue Apr 3, 2024
Co-authored-by: m. rabelink <m.rabelink@belastingdienst.nl>
Co-authored-by: Jason Liu <jason@jxnl.co>
@jxnl jxnl closed this as completed Apr 3, 2024
PrathamSoni pushed a commit to EndexAI/instructor that referenced this issue Apr 10, 2024
Co-authored-by: m. rabelink <m.rabelink@belastingdienst.nl>
Co-authored-by: Jason Liu <jason@jxnl.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants