Spaces:
Running
Running
Update index.html
Browse files- index.html +10 -3
index.html
CHANGED
@@ -79,7 +79,7 @@
|
|
79 |
<p id="result"></p>
|
80 |
</div>
|
81 |
<div class="response-container">
|
82 |
-
<h3>
|
83 |
<p id="api-response"></p>
|
84 |
</div>
|
85 |
<div>
|
@@ -109,8 +109,15 @@
|
|
109 |
}
|
110 |
);
|
111 |
const result = await response.json();
|
112 |
-
|
113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
return result;
|
115 |
} catch (error) {
|
116 |
displayStatus(`API Error: ${error.message}`, true);
|
|
|
79 |
<p id="result"></p>
|
80 |
</div>
|
81 |
<div class="response-container">
|
82 |
+
<h3>S.A.N.J.A.Y Response:</h3>
|
83 |
<p id="api-response"></p>
|
84 |
</div>
|
85 |
<div>
|
|
|
109 |
}
|
110 |
);
|
111 |
const result = await response.json();
|
112 |
+
|
113 |
+
// Extract just the text from the response and display it
|
114 |
+
if (result && result.text) {
|
115 |
+
document.getElementById('api-response').innerText = result.text;
|
116 |
+
} else {
|
117 |
+
document.getElementById('api-response').innerText = "No text response received from S.A.N.J.A.Y";
|
118 |
+
}
|
119 |
+
|
120 |
+
displayStatus("Response received");
|
121 |
return result;
|
122 |
} catch (error) {
|
123 |
displayStatus(`API Error: ${error.message}`, true);
|