IManager
in
API surface for apps interacting with and making use of LanguageModel providers without known which providers are installed
Tags
Table of Contents
Methods
- deleteTask() : void
- Delete a task that has been scheduled before
- getAvailableTaskTypes() : array<string|int, string>
- getProviders() : array<string|int, IProvider>
- getTask() : Task
- getUserTask() : Task
- getUserTasksByApp() : array<string|int, mixed>
- hasProviders() : bool
- runOrScheduleTask() : bool
- If the designated provider for the passed task provides an expected average runtime, we check if the runtime fits into the max execution time of this php process and run it synchronously if it does, if it doesn't fit (or the provider doesn't provide that information) execution is deferred to a background job
- runTask() : string
- scheduleTask() : void
- Will schedule an LLM inference process in the background. The result will become available with the \OCP\LanguageModel\Events\TaskSuccessfulEvent If inference fails a \OCP\LanguageModel\Events\TaskFailedEvent will be dispatched instead
Methods
deleteTask()
Delete a task that has been scheduled before
public
deleteTask(Task $task) : void
Parameters
- $task : Task
-
The task to delete
Tags
getAvailableTaskTypes()
public
getAvailableTaskTypes() : array<string|int, string>
Tags
Return values
array<string|int, string>getProviders()
public
getProviders() : array<string|int, IProvider>
Tags
Return values
array<string|int, IProvider>getTask()
public
getTask(int $id) : Task
Parameters
- $id : int
-
The id of the task
Tags
Return values
TaskgetUserTask()
public
getUserTask(int $id, string|null $userId) : Task
Parameters
- $id : int
-
The id of the task
- $userId : string|null
-
The user id that scheduled the task
Tags
Return values
TaskgetUserTasksByApp()
public
getUserTasksByApp(string $userId, string $appId[, string|null $identifier = null ]) : array<string|int, mixed>
Parameters
- $userId : string
- $appId : string
- $identifier : string|null = null
Tags
Return values
array<string|int, mixed>hasProviders()
public
hasProviders() : bool
Tags
Return values
boolrunOrScheduleTask()
If the designated provider for the passed task provides an expected average runtime, we check if the runtime fits into the max execution time of this php process and run it synchronously if it does, if it doesn't fit (or the provider doesn't provide that information) execution is deferred to a background job
public
runOrScheduleTask(Task $task) : bool
Parameters
- $task : Task
-
The task to schedule
Tags
Return values
boolrunTask()
public
runTask(Task $task) : string
Parameters
- $task : Task
-
The task to run
Tags
Return values
stringscheduleTask()
Will schedule an LLM inference process in the background. The result will become available with the \OCP\LanguageModel\Events\TaskSuccessfulEvent If inference fails a \OCP\LanguageModel\Events\TaskFailedEvent will be dispatched instead
public
scheduleTask(Task $task) : void
Parameters
- $task : Task
-
The task to schedule