Closed hustshawn closed 4 months ago
Example code
import os from groq import Groq client = Groq( api_key=os.environ.get("GROQ_API_KEY"), ) chat_completion = client.chat.completions.create( messages=[ { "role": "user", "content": "Explain the importance of fast language models", } ], model="mixtral-8x7b-32768", ) print(chat_completion.choices[0].message.content)
after pip install, and run the code, will face below error. Tested same with Python 3.8 and 3.11
ImportError: cannot import name 'Groq' from partially initialized module 'groq' (most likely due to a circular import)
You probably put the code in a file named groq.py, which shadows the groq module. Try changing the name of your sample file and running the code again.
ah, you are right. Thank you.
Example code
after pip install, and run the code, will face below error. Tested same with Python 3.8 and 3.11