Skip to content

Commit dc0b0ed

Browse files
committed
adjust AudioToAudioChatTaskType
Signed-off-by: Julien Veyssier <[email protected]>
1 parent c9fa7c1 commit dc0b0ed

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

lib/TaskProcessing/AudioToAudioChatProvider.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Exception;
1313
use OCA\OpenAi\AppInfo\Application;
1414
use OCA\OpenAi\Service\OpenAiAPIService;
15-
use OCA\OpenAi\Service\OpenAiSettingsService;
1615
use OCP\Files\File;
1716
use OCP\IAppConfig;
1817
use OCP\IL10N;
@@ -27,7 +26,6 @@ class AudioToAudioChatProvider implements ISynchronousProvider {
2726

2827
public function __construct(
2928
private OpenAiAPIService $openAiAPIService,
30-
private OpenAiSettingsService $openAiSettingsService,
3129
private IL10N $l,
3230
private LoggerInterface $logger,
3331
private IAppConfig $appConfig,
@@ -125,11 +123,6 @@ public function getOptionalOutputShape(): array {
125123
$this->l->t('Input transcription'),
126124
EShapeType::Text,
127125
),
128-
'output_transcript' => new ShapeDescriptor(
129-
$this->l->t('Output transcript'),
130-
$this->l->t('Response transcription'),
131-
EShapeType::Text,
132-
),
133126
];
134127
}
135128

@@ -249,7 +242,7 @@ public function process(?string $userId, array $input, callable $reportProgress)
249242
'input_transcript' => $inputTranscription,
250243
];
251244
} catch (\Exception $e) {
252-
$this->logger->warning('OpenAI/LocalAI\'s text to image generation failed with: ' . $e->getMessage(), ['exception' => $e]);
245+
$this->logger->warning('OpenAI/LocalAI\'s text to speech generation failed with: ' . $e->getMessage(), ['exception' => $e]);
253246
throw new RuntimeException('OpenAI/LocalAI\'s text to image generation failed with: ' . $e->getMessage());
254247
}
255248
}

lib/TaskProcessing/AudioToAudioChatTaskType.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ public function getOutputShape(): array {
7777
$this->l->t('The generated response as part of the conversation'),
7878
EShapeType::Audio
7979
),
80+
'output_transcript' => new ShapeDescriptor(
81+
$this->l->t('Output transcript'),
82+
$this->l->t('Response transcription'),
83+
EShapeType::Text,
84+
),
8085
];
8186
}
8287
}

0 commit comments

Comments
 (0)