phidatahq / phidata

Build AI Assistants with memory, knowledge and tools.
https://docs.phidata.com
Mozilla Public License 2.0
10.45k stars 1.51k forks source link

Groq error #1003

Open gamercoder153 opened 3 weeks ago

gamercoder153 commented 3 weeks ago

I was having error while running this code code: `from phi.assistant import Assistant from phi.llm.groq import Groq

assistant = Assistant( llm=Groq(model="mixtral-8x7b-32768"), description="You help people with their health and fitness goals.",

debug_mode=True,

) assistant.print_response("Share a quick healthy breakfast recipe.", markdown=True)`

error:

from groq.types.chat.chat_completion import ChatCompletion, ChoiceMessage ImportError: cannot import name 'ChoiceMessage' from 'groq.types.chat.chat_completion'

anuragts commented 3 weeks ago

Hey @gamercoder153 Everything looks fine in your code.

Can you setup the local env again.

1.Making virtual env and installing libraries.

source ~/.venvs/groqenv/bin/activate
pip install -U groq phidata 
  1. Export Groq api key,

export GROQ_API_KEY=

  1. Run your code python main.py

Also which Operating system are you in?

If you still facing issues, you can join our discord for dedicated support.

https://discord.gg/GRd89RTmBJ

gamercoder153 commented 3 weeks ago

@anuragts I use Windows 10 and have set up a virtual environment, installed all required packages and exported the API key.

anuragts commented 3 weeks ago

Did it worked?, if not then lets hop into discord for fixing it.

ysolanky commented 3 weeks ago

@gamercoder153 not able to replicate this error. Can you please share your Groq and Phidata versions?