Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,19 +37,12 @@ def analyze_book(title, reviews_text, avg_units_sold):
|
|
| 37 |
None,
|
| 38 |
)
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
summary = (
|
| 46 |
-
f"Book: {title}\n\n"
|
| 47 |
-
f"Pricing Decision: {result.get('pricing_decision', 'Error')}\n"
|
| 48 |
-
f"Sentiment: {result.get('sentiment', 'N/A')}"
|
| 49 |
)
|
| 50 |
|
| 51 |
-
return summary, "Processed via n8n", None
|
| 52 |
-
|
| 53 |
except Exception as e:
|
| 54 |
return f"Error: {str(e)}", "Request failed", None
|
| 55 |
|
|
|
|
| 37 |
None,
|
| 38 |
)
|
| 39 |
|
| 40 |
+
return (
|
| 41 |
+
f"Status code: {response.status_code}\nParsed JSON:\n{data}",
|
| 42 |
+
f"Type: {type(data).__name__}",
|
| 43 |
+
None,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
)
|
| 45 |
|
|
|
|
|
|
|
| 46 |
except Exception as e:
|
| 47 |
return f"Error: {str(e)}", "Request failed", None
|
| 48 |
|