davidmigloz / pixels2flutter

Convert a screenshot to a working Flutter app.
https://pixels2flutter.dev
GNU Affero General Public License v3.0
158 stars 39 forks source link

Add third-party relay #2

Open Dough-su opened 9 months ago

Dough-su commented 9 months ago

Is it possible to customize the relay function to help those users who don't have the official api? For example: The official api is: api.openai.com The third-party api is a different address, you just need to replace it with another one.

davidmigloz commented 9 months ago

Good one, I can do that.

In your case, would the third-party api require some kind of authentication?

Dough-su commented 9 months ago

Good one, I can do that.

In your case, would the third-party api require some kind of authentication?

It is the same as openai official, the only difference is the url address,The authentication method is the same as the official one, but the transfer station provides their own API key,Currently many transfers are using https://github.com/songquanpeng/one-api/blob/main/README.en.md

davidmigloz commented 9 months ago

ah you meant using one-api gotcha. I can add some fields to add custom headers or query params as well in case you want to use a proxy that requires them.

Dough-su commented 9 months ago

ah you meant using one-api gotcha. I can add some fields to add custom headers or query params as well in case you want to use a proxy that requires them.

Yes, there are many Chinese users who cannot directly access the official API of OpenAI. They need additional relays to help them use it. Thank you.

davidmigloz commented 9 months ago

Awesome, I'll try to implement it in the following days.