Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -10,11 +10,12 @@ import groq
|
|
10 |
import os
|
11 |
|
12 |
api_key = os.getenv('groq')
|
13 |
-
|
14 |
-
|
15 |
|
16 |
# Use Llama 3 70B powered by Groq for answering
|
17 |
-
def update(message):
|
|
|
18 |
try:
|
19 |
completion = client_groq.chat.completions.create(
|
20 |
model="llama3-70b-8192",
|
@@ -28,13 +29,9 @@ def update(message):
|
|
28 |
return f"Error in response generation: {str(e)}"
|
29 |
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
def parse_links_and_content(ort):
|
35 |
base_url = "https://vereine-in-deutschland.net"
|
36 |
-
all_links = []
|
37 |
-
|
38 |
# Konstruiere die vollständige URL
|
39 |
initial_url = f"{base_url}/vereine/Bayern/{ort}/"
|
40 |
|
@@ -84,6 +81,7 @@ def parse_links_and_content(ort):
|
|
84 |
def scrape_links(links):
|
85 |
links=links
|
86 |
contact_details= []
|
|
|
87 |
for verein in links:
|
88 |
result = client.predict(
|
89 |
prompt=f"{verein}",
|
|
|
10 |
import os
|
11 |
|
12 |
api_key = os.getenv('groq')
|
13 |
+
|
14 |
+
|
15 |
|
16 |
# Use Llama 3 70B powered by Groq for answering
|
17 |
+
def update(message):
|
18 |
+
client_groq = groq.Client(api_key=api_key)
|
19 |
try:
|
20 |
completion = client_groq.chat.completions.create(
|
21 |
model="llama3-70b-8192",
|
|
|
29 |
return f"Error in response generation: {str(e)}"
|
30 |
|
31 |
|
|
|
|
|
|
|
32 |
def parse_links_and_content(ort):
|
33 |
base_url = "https://vereine-in-deutschland.net"
|
34 |
+
all_links = []
|
|
|
35 |
# Konstruiere die vollständige URL
|
36 |
initial_url = f"{base_url}/vereine/Bayern/{ort}/"
|
37 |
|
|
|
81 |
def scrape_links(links):
|
82 |
links=links
|
83 |
contact_details= []
|
84 |
+
client = Client("mgokg/PerplexicaApi")
|
85 |
for verein in links:
|
86 |
result = client.predict(
|
87 |
prompt=f"{verein}",
|