Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -58,10 +58,16 @@ def magic_function(input_text):
|
|
58 |
# Extract content from a standard chat completion response structure.
|
59 |
# This may need adjustment if the API has a different format.
|
60 |
content = response_json.get("choices", [{}])[0].get("message", {}).get("content", "Error: Could not parse response.")
|
|
|
|
|
61 |
|
62 |
content = extract_suggestion_value(content)
|
63 |
|
64 |
-
|
|
|
|
|
|
|
|
|
65 |
|
66 |
except requests.exceptions.RequestException as e:
|
67 |
return f"API Request Error: {e}"
|
|
|
58 |
# Extract content from a standard chat completion response structure.
|
59 |
# This may need adjustment if the API has a different format.
|
60 |
content = response_json.get("choices", [{}])[0].get("message", {}).get("content", "Error: Could not parse response.")
|
61 |
+
|
62 |
+
print(content)
|
63 |
|
64 |
content = extract_suggestion_value(content)
|
65 |
|
66 |
+
print("----")
|
67 |
+
|
68 |
+
print(content)
|
69 |
+
|
70 |
+
return content
|
71 |
|
72 |
except requests.exceptions.RequestException as e:
|
73 |
return f"API Request Error: {e}"
|