-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rudimentary copywriter functionality, implement assistant metatask wrapper #34
Conversation
Signed-off-by: MB-Finski <[email protected]>
Signed-off-by: MB-Finski <[email protected]>
Signed-off-by: MB-Finski <[email protected]>
e830f7b
to
46e43ae
Compare
Oh, and task "modality" has not yet been renamed: I'm open for suggestions! |
Suggestions:
|
Signed-off-by: MB-Finski <[email protected]>
Signed-off-by: MB-Finski <[email protected]>
@marcelklehr Which ones? |
Signed-off-by: MB-Finski <[email protected]>
Nevermind, may have been a Github glitch |
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: MB-Finski <[email protected]>
Signed-off-by: MB-Finski <[email protected]>
Signed-off-by: MB-Finski <[email protected]>
Signed-off-by: MB-Finski <[email protected]>
Signed-off-by: MB-Finski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huge work 👍
I reviewed half of the PR approximately. The rest is coming this afternoon.
$tasks = $this->taskMapper->getTasksByOcpTaskIdAndCategory($file->getId(), Application::TASK_GATEGORY_SPEECH_TO_TEXT); | ||
|
||
// Find a matching etag: | ||
$etag = $file->getEtag(); | ||
$assistantTask = null; | ||
foreach ($tasks as $task) { | ||
$taskEtag = $task->getInputsAsArray()['eTag']; | ||
if ($taskEtag === $etag) { | ||
$assistantTask = $task; | ||
break; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would there be multiple tasks with the same ocp_task_id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an issue specific to the speech-to-text API; it doesn't have task ids so the only way to resolve the notification event back to the assistant task is by using the file id which is substituted for the ocpTaskId in this case. Then it's possible that you could have multiple tasks for the same file id (and possibly multiple different file versions)..?
Co-authored-by: Julien Veyssier <[email protected]> Signed-off-by: Sami Finnilä <[email protected]>
Signed-off-by: MB-Finski <[email protected]>
Signed-off-by: MB-Finski <[email protected]>
Signed-off-by: MB-Finski <[email protected]>
Signed-off-by: MB-Finski <[email protected]>
} catch (NotFoundException $e) { | ||
// Ocp task not found, so we can't update the status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should even return null if the OCP task can't be found. Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's conceivable that an assistant meta task is stored for longer than the corresponding ocp task. This would be the case, for example, with generated images, if we unify the routes and front-end for all task categories at some point in the future. That's why I initially considered the generic catching of all exceptions acceptable here, since the primary task of the method has already been completed (although it definitely makes sense to do some debug logging).
lib/Service/AssistantService.php
Outdated
$task = new TextProcessingTask($type, $input, $appId, $userId, $identifier); | ||
$this->textProcessingManager->runTask($task); | ||
return $task; | ||
public function runTextProcessingTask(string $type, array $inputs, string $appId, ?string $userId, string $identifier): Task { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For later: We should avoid this trick to use "copywriter" as the task type because it's a category.
We could have 2 params to the run/schedule/run-or-schedule methods: category and textProcessingType (used for text processing only).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that's true! I always thought of copywriter as just another text processing task but it might as well be considered another task category...
Signed-off-by: MB-Finski <[email protected]>
Signed-off-by: MB-Finski <[email protected]>
Signed-off-by: MB-Finski <[email protected]>
Signed-off-by: MB-Finski <[email protected]>
Signed-off-by: MB-Finski <[email protected]>
Signed-off-by: MB-Finski <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
b448135
to
42167ad
Compare
Signed-off-by: Julien Veyssier <[email protected]>
…isplay the results without the modal in the dedicated result page Signed-off-by: Julien Veyssier <[email protected]>
…rop the old one Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
…t for retro compatibility Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
This pr implements rudimentary copywriter functionality for assistant.
Known issues: