Support for Flexible URL Configuration with Cloudflare AI Gateway #214
-
Hello, I am seeking support for integrating with the Cloudflare AI gateway service, which involves using their proxy URL: https://gateway.ai.cloudflare.com/v1/xxx/xxx/openai. When this URL is passed into the proxy domain, due to the underlying mechanism of the OpenAISettings class, the URL gets concatenated to https://gateway.ai.cloudflare.com/v1/xxx/xxx/openai/v1/chat/xxxx. As can be seen, the API version gets duplicated, resulting in an incorrect URL. I am reaching out to inquire if there's a way to flexibly modify this behavior to accommodate such services without the URL path components being redundantly appended. This would greatly enhance the flexibility and usability of the service integration. Thank you for considering this improvement. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
What are the steps to configure the cloudflare proxy? |
Beta Was this translation helpful? Give feedback.
-
I downloaded the source code and tried to solve the problem, using a hard-coded form.
Fortunately, it seems to have solved my problem. |
Beta Was this translation helpful? Give feedback.
I downloaded the source code and tried to solve the problem, using a hard-coded form.
In the constructor on line 33 of the file OpenAISettingsInfo.cs, the following code snippet was added:
Fortunately, it seems to have solved my problem.
These idiosyncratic issues may occur in a very small number of developers; after all, AI Gateway is a beta feature offered by Cloudflare. Downloading the source code and reconfiguring the environment took a bit more time, but it seems to have solved my immediate problem. I may try to modify the other code and apply it to my personal o…