AppFlowy-IO / AppFlowy

Bring projects, wikis, and teams together with AI. AppFlowy is an AI collaborative workspace where you achieve more without losing control of your data. The best open source alternative to Notion.
https://www.appflowy.io
GNU Affero General Public License v3.0
58.5k stars 3.87k forks source link

[FR] Support OpenAI baseurl/proxies in some form #3855

Open AsafMah opened 1 year ago

AsafMah commented 1 year ago

Description

Currently the openai api points are hardcoded into the code (api.openai.com ...).

This prevents usage over proxies where the normal site may be blocked, or usage with compatible apis such as azure's openai or localai.

I suggest adding a baseurl option along with the openai key option, that will default to the openai endpoint but will let users choose.

Impact

Users that can't use the normal openai endpoint can still benefit from the AI features in appflowy.

Additional Context

No response

Stinosko commented 1 year ago

I'm also interested in this feature!

leleogere commented 10 months ago

Yes! That would also allow to use API for Mistral AI for example which is compatible with OpenAI's one!

However, it would also require to be able to specify the model to use, not only the baseurl (mistral-tiny, mistral-small or mistral-medium). Being able to change the model would also allow OpenAI users to choose the model they want to use. Currently, it seems that only gpt-3.5-turbo-instruct is usable as it is hardcoded:

https://github.com/AppFlowy-IO/AppFlowy/blob/90516b6adca50013b776ec1987753f877c1366c8/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/openai/service/openai_client.dart#L100-L107