@@ -38,9 +38,13 @@ public function getForm(): TemplateResponse {
38
38
39
39
$ taskProcessingAvailable = $ this ->taskProcessingManager ->hasProviders ();
40
40
41
- $ freePromptTaskTypeAvailable = in_array (TextToText::ID , $ availableTaskTypes );
42
- $ speechToTextAvailable = in_array (AudioToText::ID , $ availableTaskTypes );
43
- $ textToImageAvailable = in_array (TextToImage::ID , $ availableTaskTypes );
41
+ $ freePromptTaskTypeAvailable = array_key_exists (TextToText::ID , $ availableTaskTypes );
42
+ $ speechToTextAvailable = array_key_exists (AudioToText::ID , $ availableTaskTypes );
43
+ $ textToImageAvailable = array_key_exists (TextToImage::ID , $ availableTaskTypes );
44
+
45
+ $ audioChatAvailable = (class_exists ('OCP \\TaskProcessing \\TaskTypes \\AudioToAudioChat ' ) && array_key_exists (\OCP \TaskProcessing \TaskTypes \AudioToAudioChat::ID , $ availableTaskTypes ))
46
+ || (class_exists ('OCP \\TaskProcessing \\TaskTypes \\ContextAgentAudioInteraction ' ) && array_key_exists (\OCP \TaskProcessing \TaskTypes \ContextAgentAudioInteraction::ID , $ availableTaskTypes ));
47
+ $ autoplayAudioChat = $ this ->config ->getUserValue ($ this ->userId , Application::APP_ID , 'autoplay_audio_chat ' , '1 ' ) === '1 ' ;
44
48
45
49
$ assistantAvailable = $ taskProcessingAvailable && $ this ->appConfig ->getValueString (Application::APP_ID , 'assistant_enabled ' , '1 ' ) === '1 ' ;
46
50
$ assistantEnabled = $ this ->config ->getUserValue ($ this ->userId , Application::APP_ID , 'assistant_enabled ' , '1 ' ) === '1 ' ;
@@ -63,6 +67,8 @@ public function getForm(): TemplateResponse {
63
67
'free_prompt_picker_enabled ' => $ freePromptPickerEnabled ,
64
68
'speech_to_text_picker_available ' => $ speechToTextPickerAvailable ,
65
69
'speech_to_text_picker_enabled ' => $ speechToTextPickerEnabled ,
70
+ 'audio_chat_available ' => $ audioChatAvailable ,
71
+ 'autoplay_audio_chat ' => $ autoplayAudioChat ,
66
72
];
67
73
$ this ->initialStateService ->provideInitialState ('config ' , $ userConfig );
68
74
0 commit comments