Open cpfiffer opened 7 months ago
I think this is OpenAI specific, so it would be better to upstream to OpenAI.jl for others.
All API provider kwargs (‘api_kwargs=(; a=1…)’) from ai* functions are passed directly, so it should just work.
After considering, I think it might be best to adapt the Providers in OpenAI.jl (eg, OpenAIProvider) to have the optional org key and then customize OpenAI.auth_header
to add it to your HTTP header if available.
Then on the PT side, I'll probably need to allow the api_key
kwarg to be not only a string but also an OpenAI.Provider object.
That's the "easiest" way I can think of, because api_kwargs
actually just send parameters directly to the model. They don't tend to change the headers etc.
I have a personal & private account with OpenAI, and I would like to set an organization key when requesting usage from OpenAI. See the docs for more.
Looks like I just need to add a header to the
llm_openai.jl
code. Here's the curl stuff from OpenAI:Should this be addressed in this library or upstream in OpenAI.jl? Either way I suspect it's a pretty easy task (I can do it) but would love some input.