stt error fixed
This commit is contained in:
parent
e5d301cc9c
commit
013a033051
@ -74,7 +74,7 @@ class SttService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
flushMyCompletion() {
|
flushMyCompletion() {
|
||||||
if (!this.myCompletionBuffer.trim()) return;
|
if (!this.modelInfo || !this.myCompletionBuffer.trim()) return;
|
||||||
|
|
||||||
const finalText = this.myCompletionBuffer.trim();
|
const finalText = this.myCompletionBuffer.trim();
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ class SttService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
flushTheirCompletion() {
|
flushTheirCompletion() {
|
||||||
if (!this.theirCompletionBuffer.trim()) return;
|
if (!this.modelInfo || !this.theirCompletionBuffer.trim()) return;
|
||||||
|
|
||||||
const finalText = this.theirCompletionBuffer.trim();
|
const finalText = this.theirCompletionBuffer.trim();
|
||||||
|
|
||||||
@ -176,6 +176,11 @@ class SttService {
|
|||||||
// console.log(`[SttService] Initializing STT for provider: ${modelInfo.provider}`);
|
// console.log(`[SttService] Initializing STT for provider: ${modelInfo.provider}`);
|
||||||
|
|
||||||
const handleMyMessage = message => {
|
const handleMyMessage = message => {
|
||||||
|
if (!this.modelInfo) {
|
||||||
|
console.log('[SttService] Ignoring message - session already closed');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.modelInfo.provider === 'gemini') {
|
if (this.modelInfo.provider === 'gemini') {
|
||||||
const text = message.serverContent?.inputTranscription?.text || '';
|
const text = message.serverContent?.inputTranscription?.text || '';
|
||||||
if (text && text.trim()) {
|
if (text && text.trim()) {
|
||||||
@ -217,6 +222,11 @@ class SttService {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleTheirMessage = message => {
|
const handleTheirMessage = message => {
|
||||||
|
if (!this.modelInfo) {
|
||||||
|
console.log('[SttService] Ignoring message - session already closed');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.modelInfo.provider === 'gemini') {
|
if (this.modelInfo.provider === 'gemini') {
|
||||||
const text = message.serverContent?.inputTranscription?.text || '';
|
const text = message.serverContent?.inputTranscription?.text || '';
|
||||||
if (text && text.trim()) {
|
if (text && text.trim()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user