add api_url param in init function#40
Conversation
|
Will this support Azure OpenAI API? |
It doesn't look like it would support Azure because of the base URL configs for the various endpoints include openai.ex/lib/openai/completions.ex Line 6 in ff48a96 |
|
It would be amazing if this would support Azure. I'd be happy to help but it seems like a trivial change. Just dropping a vote in favour of moving that |
|
Hi @tiankonglan! Thanks for this PR The def init(_opts) do
config = %{
api_key: get_config_value(:api_key),
organization_key: get_config_value(:organization_key),
http_options: get_config_value(:organization_key),
api_url: get_config_value(:api_url, @openai_url)
}
{:ok, config}
endand remove the Azure integration topic@howard0su @talk2MeGooseman @cigrainger To support azure in a proper way we should create a specific client for it, that share the logic of the existing one for handling the response, but pass specific url and headers for authentication. I don't think that moving the v1 to the API base url is a good idea, because it can impact future releases of the APIs that can have different versions for different actions. FYI I converted the original issue about Azure in a discussion thread here |
|
Hey @mgallo @howard0su @cigrainger @talk2MeGooseman, I started to work on the Azure support and I have something roughly working on a branch inside my fork, I currently have tested only the If you are interested I can open a PR here where we can discuss what should be changed and added to have something mergeable. |
in some sence api_url is not "https://api.openai.com", so I commit the pr.