nextcloud / assistant

✨ Nextcloud Assistant
GNU Affero General Public License v3.0
30 stars 5 forks source link

Assistant not working with LocalAI #23

Closed manuelkamp closed 1 week ago

manuelkamp commented 9 months ago

Which version of assistant are you using?

1.0.3

Which version of Nextcloud are you using?

28.0.1

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

Edge 120.0.2210.77

Describe the Bug

RuntimeException ExApp class not found, please install the AppAPI app from the Nextcloud AppStore Temporary problem with indexing, trying again soon

Expected Behavior

Assistant works

To Reproduce

Klick the assistant right top, select any option (does not matter if you select free prompt, context chat...), enter text in textbox and start the assistant. you will recieve a failed notification and see error in logs.

tomchiverton commented 5 months ago

I can't get this to work at all either.

I have llamafile from Mozilla ( https://github.com/Mozilla-Ocho/llamafile ) running on a separate Raspberry Pi server.

I have set http://pi5.local:3333 as the server in the Nextcloud Settings.

The server is able to resolve and connect to this e.g. with curl http://pi5.local:3333/v1/chat/completions .... fine.

Anything I type in the Nextcloud Assistant's " Generate text " box just leads to brief "Assistant error" toast notification.

Nothing in the web server error logs. The browser request is below

curl 'https://nextcloud.falkensweb.com/ocs/v2.php/apps/assistant/api/v1/task/run-or-schedule' -X POST -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-GB,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' -H 'requesttoken: f3LbtIjQCi1jNjczaxyV2ksf3B0EasKyFO69kGPZnR8=:HTqOm8SiWEcvd1RkWFvttgpwiXV2HY2DXtzNyTevyX0=' -H 'Origin: https://nextcloud.falkensweb.com' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Connection: keep-alive' -H 'Cookie: __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true; oc_sessionPassphrase=flv53nePCRK00iMU0WXX%2FQcm9hjpK%2BwSD5OxbfmrpDi0dHZcZ%2Bto0vXmFbQmQmqPLbCEW%2Fm8rA1hbazpRyb43guIuRtx61EyzXueefIBN2yTqAzcXqQ%2FlnXd8omUlPc0; oc72lkbouxn8=5a780b6fa5f335a0c20c3e15cb28f714; nc_username=nextcloud_admin; nc_token=W9MF4SScdzTq140KQZK9zRRcydTO%2Fxsr; nc_session_id=5a780b6fa5f335a0c20c3e15cb28f714' -H 'TE: trailers' --data-raw '{"inputs":{"prompt":"qwe"},"type":"OCP\\TextProcessing\\FreePromptTaskType","appId":"assistant","identifier":""}'

The response contains the following

{"ocs":{"meta":{"status":"failure","statuscode":400,"message":""},"data":"LanguageModel call using provider Local on Pi5 failed: OpenAI\/LocalAI request failed: Unknown API request error."}}
tomchiverton commented 5 months ago

tshark -d tcp.port==8000,http port 3333

claims

    4 0.001935725 192.168.11.2 → 192.168.11.150 HTTP/JSON 358 POST /v1/completions HTTP/1.1 , JavaScript Object Notation (application/json)
....
    8 0.005210109 192.168.11.150 → 192.168.11.2 HTTP 80 HTTP/1.1 404 Not Found  (text/plain)

note missing "chat" in URL. Is this Llama's fault or yours ? Is it just a configuration setting I've not made right in Assistant ?

tomchiverton commented 5 months ago

Maybe "text generation endpoint" settings has helped.

Errors need to be surfaced better.