Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,8 +22,8 @@ groq_api_key = os.getenv("GROQ_API_KEY")
|
|
22 |
if not groq_api_key:
|
23 |
raise ValueError("GROQ_API_KEY environment variable not set")
|
24 |
|
25 |
-
# Initialize Groq client
|
26 |
-
client = groq.
|
27 |
|
28 |
# Function to generate crystal structures
|
29 |
def generate_crystal_structure(material_name):
|
@@ -132,6 +132,7 @@ def get_material_recommendations(query):
|
|
132 |
Ensure your response is strictly in this JSON format with no additional text."""
|
133 |
|
134 |
try:
|
|
|
135 |
completion = client.chat.completions.create(
|
136 |
model="deepseek-r1",
|
137 |
messages=[
|
|
|
22 |
if not groq_api_key:
|
23 |
raise ValueError("GROQ_API_KEY environment variable not set")
|
24 |
|
25 |
+
# Initialize Groq client - using a simpler initialization to avoid proxies parameter issue
|
26 |
+
client = groq.Client(api_key=groq_api_key)
|
27 |
|
28 |
# Function to generate crystal structures
|
29 |
def generate_crystal_structure(material_name):
|
|
|
132 |
Ensure your response is strictly in this JSON format with no additional text."""
|
133 |
|
134 |
try:
|
135 |
+
# Updated to use the chat.completions API with the correct client method
|
136 |
completion = client.chat.completions.create(
|
137 |
model="deepseek-r1",
|
138 |
messages=[
|