intitni / CopilotForXcode

The first GitHub Copilot, Codeium and ChatGPT Xcode Source Editor Extension
https://copilotforxcode.intii.com
MIT License
7.84k stars 386 forks source link

[Enhancement]: OpenAI custom headers #594

Open mark-bradshaw opened 1 month ago

mark-bradshaw commented 1 month ago

Before Requesting

What feature do you want?

I would like the ability to specify a set of custom headers to send along with requests to any chat and embedding models.

My company requires that all requests to 3rd party hosted models be sent through an internal proxy. This allows us to have a way to anonymous personal and customer information, rate limit requests, and budget our spending. To make this work we need to be able to pass along a set of custom headers along with any request that specifies an internal proxy key, app id, username, etc.

We would like to be able to specify a set of headers to pass along with requests when setting up a chat or embedding model. Ideally it would also allow for using environment variables as part of the value of the header, but if it has to be just strings that's workable too. It'd also be nice to be able to set these as global settings, so they just got added to any models that were already configured, or were added later, without needing to copy/paste lots of headers.

intitni commented 5 days ago

Let‘s start with adding string values for each OpenAI compatible API models in 0.35.0