alibaba / spring-cloud-alibaba

Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
https://sca.aliyun.com
Apache License 2.0
28.01k stars 8.35k forks source link

Hope to increase custom host function #3766

Open jaychoubaby opened 5 months ago

jaychoubaby commented 5 months ago

Sometimes we access OpenAI not necessarily through https://api.openai.com/. Due to network reasons, sometimes we will build a proxy domain for requests. We hope to support custom host functionality, not just for OpenAI, but also for other AI language models. In most cases, we use this method for proxy access. Thank you very much for your efforts and hope you can consider this feature, which is really important for users in China and some other countries.

jaychoubaby commented 5 months ago

When there is a network blockade, we cannot make requests through https://api.openai.com/v1/chat/completions. However, we have set up a domain proxy ourselves, and it is possible to access it normally through https://${my-domain}/v1/chat/completions. I noticed that the current code has hardcoded "https://api.openai.com/" as a fixed value, which prevents us from using spring-cloud-alibaba-ai properly.