Log Shihab transcripts when enabled
Browse files
server/shihab-realtime-recognizer.ts
CHANGED
|
@@ -210,6 +210,11 @@ export class ShihabRealtimeRecognizer implements RealtimeSttRecognizer {
|
|
| 210 |
const text = String(message.transcript ?? "").trim();
|
| 211 |
if (!text) return;
|
| 212 |
const isFinal = message.is_final === true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
const event: Record<string, unknown> = {
|
| 214 |
type: isFinal ? "final" : "interim",
|
| 215 |
sessionId: this.sessionId,
|
|
|
|
| 210 |
const text = String(message.transcript ?? "").trim();
|
| 211 |
if (!text) return;
|
| 212 |
const isFinal = message.is_final === true;
|
| 213 |
+
if (this.environment.STT_LOG_TRANSCRIPTS?.trim().toLowerCase() === "true") {
|
| 214 |
+
console.log(
|
| 215 |
+
`[voice-ws][shihab][${this.sessionId}] ${isFinal ? "final" : "interim"}: ${JSON.stringify(text)}`,
|
| 216 |
+
);
|
| 217 |
+
}
|
| 218 |
const event: Record<string, unknown> = {
|
| 219 |
type: isFinal ? "final" : "interim",
|
| 220 |
sessionId: this.sessionId,
|