Repository navigation
feat(MultimodalChatWithTools): Expose fileIds of attached files to the LLM - #464
Conversation
…e LLM Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Marcel Klehr <mklehr@gmx.net>
|
Nice! A few notes from reading the diff… The permission boundary looks right (user folder only, appdata files stay unlabeled). Two small things:
One thing worth a line in the label or the system prompt (which I'm naively assuming): nothing tells the model the id is for tool calls only, so replies like "your file (file ID: 42)" would be likely. |
| /** | ||
| * Only files in the user's folder can be used by tools, files in appdata (e.g. task outputs) cannot | ||
| */ | ||
| private function isInUserFolder(File $file, ?string $userId): bool { | ||
| if ($userId === null) { | ||
| return false; | ||
| } | ||
| try { | ||
| return $this->rootFolder->getUserFolder($userId)->getFirstNodeById($file->getId()) !== null; | ||
| } catch (NotPermittedException $e) { | ||
| return false; | ||
| } | ||
| } |
There was a problem hiding this comment.
nit: maybe it's enough to check the file path here if it's in appdata or not
I think that's acceptable, there are strict rules for file names in nextcloud.
I think that's acceptable, as there is a very small cap on the number of attachments per chat session. |
it's a normal nextcloud file id so I suppose it can be used for any purpose by the agent |
in order for the model to call tools with the fileIds.
this is part of a pack of PRs:
🤖 AI (if applicable)