Skip to content

AI summarization doesn't work for the PDFs shipping with Nextcloud ("Nextcloud Manual.pdf") #499

@hybridherbst

Description

@hybridherbst

Which version of assistant are you using?

3.3.0

Which version of Nextcloud are you using?

v33.0.0

Which browser are you using? In case you are using the phone App, specify the Android or iOS version and device please.

Chrome 146.0.7680.80

Describe the Bug

Nextcloud ships with PDFs, e.g. the Nextcloud Manual.pdf.
Nextcloud Assistant comes with "Summarize this document", so naturally I tried that on the manual.

Turns out the built-in PDF parser (smalot/pdfparser as far as I can see) fails for the built-in manual, so summarization throws an error:

Image

The response I see is

{
    "ocs": {
        "meta": {
            "status": "failure",
            "statuscode": 400,
            "message": ""
        },
        "data": {
            "error": "Malformed UTF-8 characters, possibly incorrectly encoded"
        }
    }
}

and in the browser console:

xhr.js:198  POST http://localhost:8080/ocs/v2.php/apps/assistant/api/v1/file-action/68/core:text2text:summary 400 (Bad request)
(anonymous) @ xhr.js:198
xhr @ xhr.js:15
xe @ dispatchRequest.js:49
_request @ Axios.js:194
request @ Axios.js:41
(anonymous) @ Axios.js:233
(anonymous) @ bind.js:12
exec @ fileActions.js:65
await in exec
At @ actionUtils.ts:48
onActionClick @ FileEntryActions.vue:187
click @ FileEntryActions.vue:9
sn @ vue.runtime.esm.js:3033
n @ vue.runtime.esm.js:1832
sn @ vue.runtime.esm.js:3033
(anonymous) @ vue.runtime.esm.js:3732
onClick @ actionText-BMig9Egt.mjs:78
handleClick @ NcActionButton-1gSJfFUC.mjs:145
sn @ vue.runtime.esm.js:3033
n @ vue.runtime.esm.js:1832
push.85471.Mr.i._wrapper @ vue.runtime.esm.js:7500Understand this error
fileActions.js:72 AxiosError: Request failed with status code 400
    at Ke (settle.js:19:12)
    at XMLHttpRequest.C (xhr.js:59:7)
    at rt.request (Axios.js:46:41)
    at async Object.exec (fileActions.js:65:5)
    at async At (actionUtils.ts:48:15)
    at async o.onActionClick (FileEntryActions.vue:185:48)

Expected Behavior

PDF summarization works at least for the PDFs that ship with Nextcloud, people (like me!) are likely to try it out with the PDFs that are already there.

To Reproduce

  • Install Nextcloud 33 and AI assistant
  • Go to the files app, http://localhost:8080/apps/files/
  • Rightclick on the "Nextcloud Manual.pdf" and select AI > Summarize
  • Note nothing happens
  • Check browser console and find errors/response about malformed characters there

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions