SwiftOpenAI icon indicating copy to clipboard operation
SwiftOpenAI copied to clipboard

Custom domain not allowed

Open chenlidongorg opened this issue 1 year ago • 3 comments
trafficstars

Custom domain not allowed

chenlidongorg avatar Apr 25 '24 19:04 chenlidongorg

Could you provide more information? For example, could you provide a direct link to the documentation?

SwiftBeta avatar Apr 25 '24 21:04 SwiftBeta

I'd like to replace api.openai.com with my own domain, www.mydomain.com. I have set up www.mydomain.com as an AI Gateway, directly pointing to OpenAI's servers.

chenlidongorg avatar May 10 '24 17:05 chenlidongorg

struct OpenAIEnvironmentV1: BaseEnvironmentType { var url: String = "https://api.openai.com/v1/" }

We need to make this interface public to allow for customization. One reason is that the API structures of many other companies' large models are similar to that of OpenAI, making them compatible with OpenAI. This way, we can simply modify the domain name to use them.

需要公开这个接口,让我们自定义。一个原因是现在很多其他公司的大模型api跟 OpenAI 语法结构一样,兼容OpenAI ,这样我们修改一下域名就可以使用。

chenlidongorg avatar May 11 '24 02:05 chenlidongorg