MCPcopy
hub / github.com/FlowiseAI/Flowise / shouldAutoPlayTTS

Function shouldAutoPlayTTS

packages/server/src/utils/buildChatflow.ts:76–91  ·  view source on GitHub ↗
(textToSpeechConfig: string | undefined | null)

Source from the content-addressed store, hash-verified

74import { Organization } from '../enterprise/database/entities/organization.entity'
75
76const shouldAutoPlayTTS = (textToSpeechConfig: string | undefined | null): boolean => {
77 if (!textToSpeechConfig) return false
78 try {
79 const config = typeof textToSpeechConfig === 'string' ? JSON.parse(textToSpeechConfig) : textToSpeechConfig
80 for (const providerKey in config) {
81 const provider = config[providerKey]
82 if (provider && provider.status === true && provider.autoPlay === true) {
83 return true
84 }
85 }
86 return false
87 } catch (error) {
88 logger.error(`Error parsing textToSpeechConfig: ${getErrorMessage(error)}`)
89 return false
90 }
91}
92
93const generateTTSForResponseStream = async (
94 responseText: string,

Callers 2

executeAgentFlowFunction · 0.90
executeFlowFunction · 0.85

Calls 2

getErrorMessageFunction · 0.90
parseMethod · 0.65

Tested by

no test coverage detected