import os
from langtrace_python_sdk import langtrace # Must precede any llm module imports
langtrace.init(api_key = os.environ['LANGTRACE_API_KEY'])
from groq import Groq
client = Groq(
# This is the default and can be omitted
api_key=os.environ["GROQ_API_KEY"],
)
# Generate a simple output with the llama3 MODEL
chat_completion = client.chat.completions.create(
messages=[
{
"role": "user",
"content": "What is LangChain?",
}
],
model="llama3-8b-8192",
)
print(chat_completion.choices[0].message.content)