You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nextcloud-server/lib/public/LanguageModel/SummaryTask.php

40 lines
773 B

<?php
namespace OCP\LanguageModel;
/**
* @since 28.0.0
*/
final class SummaryTask extends AbstractLanguageModelTask {
/**
* @since 28.0.0
*/
public const TYPE = 'summarize';
/**
* @inheritDoc
* @since 28.0.0
*/
public function visitProvider(ILanguageModelProvider $provider): string {
if (!$provider instanceof ISummaryProvider) {
throw new \RuntimeException('SummaryTask#visitProvider expects ISummaryProvider');
}
return $provider->summarize($this->getInput());
}
/**
* @inheritDoc
* @since 28.0.0
*/
public function canUseProvider(ILanguageModelProvider $provider): bool {
return $provider instanceof ISummaryProvider;
}
/**
* @inheritDoc
* @since 28.0.0
*/
public function getType(): string {
return self::TYPE;
}
}