nextcloud / integration_openai

OpenAI integration in Nextcloud
GNU Affero General Public License v3.0
47 stars 9 forks source link

Automatically detect available features for LocalAI #78

Open mwinkens opened 5 months ago

mwinkens commented 5 months ago

Describe the feature you'd like to request

Currently you need to deselect features like image generation if the endpoint in your LocalAI is not available, because otherwise users are able to try to generate images and get an error 404. This could be automatically detected and deselected.

Describe the solution you'd like

I would like to automatically detect available features and disable unavailable ones.

Describe alternatives you've considered

You could also add a second OpenAI key and use OpenAI for features, that are not available yet

MB-Finski commented 5 months ago

This is actually a really good idea to implement! It'd also make sense to not register the providers if they're not available to avoid any confusing errors down the road.

mwinkens commented 5 months ago

Also you could detect if you receive a 401 unauthroized, so your api key is invalid (or you didn't enter any). I got this one while configuring this app in the nextcloud logs