LLM OCP API: Fix type errors
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
(cherry picked from commit b6a95e35b0)
This commit is contained in:
@@ -6,6 +6,7 @@ use OC\LanguageModel\Db\Task;
|
||||
|
||||
abstract class AbstractLanguageModelTask implements ILanguageModelTask {
|
||||
protected ?int $id;
|
||||
protected ?string $output;
|
||||
protected int $status = ILanguageModelTask::STATUS_UNKNOWN;
|
||||
|
||||
final public function __construct(
|
||||
@@ -26,6 +27,20 @@ abstract class AbstractLanguageModelTask implements ILanguageModelTask {
|
||||
|
||||
abstract public function getType(): string;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
final public function getOutput(): ?string {
|
||||
return $this->output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $output
|
||||
*/
|
||||
final public function setOutput(?string $output): void {
|
||||
$this->output = $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
|
||||
@@ -16,6 +16,11 @@ interface ILanguageModelTask extends \JsonSerializable {
|
||||
TopicsTask::TYPE => TopicsTask::class,
|
||||
];
|
||||
|
||||
public function visitProvider(ILanguageModelProvider $provider): string;
|
||||
|
||||
public function canUseProvider(ILanguageModelProvider $provider): bool;
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
@@ -47,14 +52,14 @@ interface ILanguageModelTask extends \JsonSerializable {
|
||||
public function getInput(): string;
|
||||
|
||||
/**
|
||||
* @param string $output
|
||||
* @param string|null $output
|
||||
*/
|
||||
public function setOutput(string $output): void;
|
||||
public function setOutput(?string $output): void;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return null|string
|
||||
*/
|
||||
public function getOutput(): string;
|
||||
public function getOutput(): ?string;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
|
||||
Reference in New Issue
Block a user