Skip to content

Add MultimodalChatWithToolsProvider#400

Open
lukasdotcom wants to merge 7 commits into
mainfrom
multimodal-provider
Open

Add MultimodalChatWithToolsProvider#400
lukasdotcom wants to merge 7 commits into
mainfrom
multimodal-provider

Conversation

@lukasdotcom

@lukasdotcom lukasdotcom commented Jul 8, 2026

Copy link
Copy Markdown
Member

Adds multimodal chat and also switches to enable also settings to enable different kinds of attachments. The new multimodal settings are also used for audio2audio chat and analyze image.
image
Look at nextcloud/assistant#602 to see all relevant pr's for this

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
@lukasdotcom
lukasdotcom force-pushed the multimodal-provider branch from 852adf4 to 9254c32 Compare July 8, 2026 19:11
…on for older providers

Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
@lukasdotcom
lukasdotcom marked this pull request as ready for review July 14, 2026 16:56
…context agent

Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
@lukasdotcom
lukasdotcom force-pushed the multimodal-provider branch from bb8863b to 1808448 Compare July 15, 2026 20:11
Comment thread lib/Service/OpenAiAPIService.php
$content = [];
foreach ($message['content'] as $item) {
if ($item['type'] === 'file') {
$content = array_merge($content, $this->openAiFileService->buildFileContentFromId($item['file_id'], $userId, $item['ocp_task_id'] ?? null));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$userId may be null here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how to handle it for the fileId only path, but if it is from a task the getUserTask accepts a null value for userId.

throw new ProcessingException('File is not readable');
}
// Maximum file size for openai is 50MB.
if ($this->isUsingOpenAi() && $file->getSize() > self::MAX_FILE_SIZE_BYTES) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a file size limit fro the general case as well?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do the exact same limit as for openai unless you think a different one is better.

$unset = '__unset__';
$newValue = $this->appConfig->getValueString(Application::APP_ID, 'multimodal_image_enabled', $unset);
if ($newValue !== $unset) {
return;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shifts the default state from 0 to 1, I think. Ideally, if it has been unset previously, we should set it to what used to be the default.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Back when analyze image was created I don't think IONOS had a model with support for image input, but now that they do I think it might be worth it to change the default to on instead of off.

Comment thread lib/TaskProcessing/MultimodalChatWithToolsProvider.php Outdated
@lukasdotcom
lukasdotcom force-pushed the multimodal-provider branch from d6a95cb to 87ec6d9 Compare July 16, 2026 12:44
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
@lukasdotcom
lukasdotcom force-pushed the multimodal-provider branch from 87ec6d9 to 1902b7f Compare July 16, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants