File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -128,8 +128,21 @@ public function register(IRegistrationContext $context): void {
128
128
if ($ this ->appConfig ->getValueString (Application::APP_ID , 't2i_provider_enabled ' , '1 ' ) === '1 ' ) {
129
129
$ context ->registerTaskProcessingProvider (TextToImageProvider::class);
130
130
}
131
- $ context ->registerTaskProcessingTaskType (AudioToAudioChatTaskType::class);
132
- $ context ->registerTaskProcessingProvider (AudioToAudioChatProvider::class);
131
+
132
+ // only register audio chat stuff if we're using OpenAI or stt+llm+tts are enabled
133
+ $ serviceUrl = $ this ->appConfig ->getValueString (Application::APP_ID , 'url ' );
134
+ $ isUsingOpenAI = $ serviceUrl === '' || $ serviceUrl === Application::OPENAI_API_BASE_URL ;
135
+ if (
136
+ $ isUsingOpenAI
137
+ || (
138
+ $ this ->appConfig ->getValueString (Application::APP_ID , 'stt_provider_enabled ' , '1 ' ) === '1 '
139
+ && $ this ->appConfig ->getValueString (Application::APP_ID , 'llm_provider_enabled ' , '1 ' ) === '1 '
140
+ && $ this ->appConfig ->getValueString (Application::APP_ID , 'tts_provider_enabled ' , '1 ' ) === '1 '
141
+ )
142
+ ) {
143
+ $ context ->registerTaskProcessingTaskType (AudioToAudioChatTaskType::class);
144
+ $ context ->registerTaskProcessingProvider (AudioToAudioChatProvider::class);
145
+ }
133
146
134
147
$ context ->registerCapability (Capabilities::class);
135
148
}
You can’t perform that action at this time.
0 commit comments