voice2VoiceAI / llm.py
sreejang's picture
Create llm.py
a4cb895 verified
raw
history blame contribute delete
352 Bytes
# llm.py
import os
from groq import Groq
# Read API key from environment variable
client = Groq(api_key=os.environ.get("GROQ_API_KEY"))
def ask_groq(text):
response = client.chat.completions.create(
model="llama-3.3-70b-versatile",
messages=[{"role": "user", "content": text}]
)
return response.choices[0].message.content