File size: 476 Bytes
fc341bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
from dotenv import load_dotenv
from langchain_groq import ChatGroq
from langchain.schema import HumanMessage

# Load environment variables from .env
load_dotenv()

# Initialize the Groq chat model with Qwen
llm = ChatGroq(
    temperature=0,
    model_name="qwen-qwq-32b",  # Updated to working model
    groq_api_key=os.getenv("GROQ_API_KEY")
)

# Send a test message
response = llm([HumanMessage(content="Hello Groq, how fast are you?")])

print(response.content)