Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -26,6 +26,18 @@ def chat_with_groq(user_input):
|
|
26 |
else:
|
27 |
return f"Error: {response.json()}"
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
# Function to generate and visualize CIF files
|
30 |
def generate_and_visualize_cifs(application):
|
31 |
# Get response from Groq API
|
|
|
26 |
else:
|
27 |
return f"Error: {response.json()}"
|
28 |
|
29 |
+
|
30 |
+
def parse_response(response):
|
31 |
+
# Dummy parser - replace this with a proper LLM response parser as needed
|
32 |
+
lines = response.split('\n')
|
33 |
+
materials = []
|
34 |
+
for line in lines:
|
35 |
+
if any(keyword in line.lower() for keyword in ["1.", "2.", "3."]):
|
36 |
+
name = line.split(".")[1].split("-")[0].strip()
|
37 |
+
materials.append(name)
|
38 |
+
return materials
|
39 |
+
|
40 |
+
|
41 |
# Function to generate and visualize CIF files
|
42 |
def generate_and_visualize_cifs(application):
|
43 |
# Get response from Groq API
|