Merge pull request #10611 from nextcloud/fix/use-text2text
fix(summarizeMessages): use TextToText
This commit is contained in:
Коммит
e052cb66d9
|
@ -23,7 +23,7 @@ use OCP\IConfig;
|
|||
use OCP\TaskProcessing\Exception\Exception as TaskProcessingException;
|
||||
use OCP\TaskProcessing\IManager as TaskProcessingManager;
|
||||
use OCP\TaskProcessing\Task as TaskProcessingTask;
|
||||
use OCP\TaskProcessing\TaskTypes\TextToTextSummary;
|
||||
use OCP\TaskProcessing\TaskTypes\TextToText;
|
||||
use OCP\TextProcessing\FreePromptTaskType;
|
||||
use OCP\TextProcessing\IManager;
|
||||
use OCP\TextProcessing\SummaryTaskType;
|
||||
|
@ -67,7 +67,7 @@ PROMPT;
|
|||
*/
|
||||
public function summarizeMessages(Account $account, array $messages): void {
|
||||
try {
|
||||
$this->taskProcessingManager->getPreferredProvider(TextToTextSummary::ID);
|
||||
$this->taskProcessingManager->getPreferredProvider(TextToText::ID);
|
||||
} catch (TaskProcessingException $e) {
|
||||
$this->logger->info('No text summary provider available');
|
||||
return;
|
||||
|
@ -104,7 +104,7 @@ PROMPT;
|
|||
"Here is the ***E-MAIL*** for which you must generate a helpful summary: \r\n" .
|
||||
"***START_OF_E-MAIL***\r\n$messageBody\r\n***END_OF_E-MAIL***\r\n";
|
||||
$task = new TaskProcessingTask(
|
||||
TextToTextSummary::ID,
|
||||
TextToText::ID,
|
||||
[
|
||||
'max_tokens' => 1024,
|
||||
'input' => $prompt,
|
||||
|
|
Загрузка…
Ссылка в новой задаче