code-review-gpt icon indicating copy to clipboard operation
code-review-gpt copied to clipboard

Azure OpenAI Support?

Open PeterDaveHello opened this issue 1 year ago • 3 comments

I saw Azure AI in the project description, but didn't find any example or configs about Azure OpenAI, not sure if that's not the same thing? Would like to see Azure OpenAI supported 👍

Your personal code reviewer powered by LLMs (OpenAI GPT-3.5/4, Llama, Falcon, Azure AI)

PeterDaveHello avatar Aug 09 '23 11:08 PeterDaveHello

Hey, thanks for your issue. It is in the roadmap to add support for different LLMs.

We can do what we did with Gitlab here... if this gets more than 20 upvotes I'll do it as priority :)

mattzcarey avatar Aug 10 '23 07:08 mattzcarey

HI @mattzcarey ! Just to simplify the request here, it's not really about adding support to another LLM it's just a matter of allowing users to select a different endpoint for OpenAI Service as Azure mirrors the exact API interface of OpenAI so it's just a matter of pointing the requests to a different endpoint.

I see you are using langchain and it supports switching the endpoint using the parameter openai_api_base when initializing OpenAIChat as well as sending the deployment name from azure in model_name instead of the actual model name.

Hope this helps scope this request.

Example of a configuration change to use Azure Open AI: `# Configure the baseline configuration of the OpenAI library for Azure OpenAI Service. OPENAI_API_KEY = "PLEASE_ENTER_YOUR_OWNED_AOAI_SERVICE_KEY" OPENAI_DEPLOYMENT_NAME = "PLEASE_ENTER_YOUR_OWNED_AOAI_TEXT_MODEL_NAME" MODEL_NAME = "text-davinci-003" openai.api_type = "azure" openai.api_base = "https://PLESAE_ENTER_YOUR_OWNED_AOAI_RESOURCE_NAME.openai.azure.com/" openai.api_version = "2022-12-01" openai.api_key = "PLEASE_ENTER_YOUR_OWNED_AOAI_SERVICE_KEY"

Initiate a connection to the LLM from Azure OpenAI Service via LangChain.

llm = AzureOpenAI( openai_api_key=OPENAI_API_KEY, deployment_name=OPENAI_DEPLOYMENT_NAME, model_name=MODEL_NAME, )`

jpdom avatar Nov 17 '23 11:11 jpdom

I'd also love to use my Azure deployments for this. Does someone maybe already have fork with Azure compatibility?

bassner avatar Dec 04 '23 10:12 bassner