Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -39,15 +39,19 @@ if assistant_api_key == '':
|
|
39 |
else:
|
40 |
gpt_assistant = GPTAssistant(assistant_api_key)
|
41 |
|
42 |
-
|
43 |
-
html_content = st.text_input("Paste the HTML tags of the item you want to extract:", max_chars=10000, help="example: <li>Product 1 </li>, watch the video above")
|
44 |
# check if html_content is an url, and show error if it is
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
html_content
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
-
extract_button =
|
51 |
|
52 |
if html_content and extract_button:
|
53 |
try:
|
|
|
39 |
else:
|
40 |
gpt_assistant = GPTAssistant(assistant_api_key)
|
41 |
|
42 |
+
html_content = None
|
|
|
43 |
# check if html_content is an url, and show error if it is
|
44 |
+
@traceable(run_type="tool")
|
45 |
+
def html_content_input:
|
46 |
+
html_content = st.text_input("Paste the HTML tags of the item you want to extract:", max_chars=10000, help="example: <li>Product 1 </li>, watch the video above")
|
47 |
+
if html_content:
|
48 |
+
if html_content.startswith("http"):
|
49 |
+
st.write("Please paste the HTML piece code, not the URL")
|
50 |
+
html_content = None
|
51 |
+
|
52 |
+
return st.button("Generate output format & code")
|
53 |
|
54 |
+
extract_button = html_content_input()
|
55 |
|
56 |
if html_content and extract_button:
|
57 |
try:
|