langflow icon indicating copy to clipboard operation
langflow copied to clipboard

how to config azure openai in langflow

Open romagedn opened this issue 1 year ago • 6 comments

Describe the bug I am new to this. But I can't find a way to config azure open ai.

can someone tell me how to do it?

romagedn avatar Apr 22 '23 07:04 romagedn

According to the Azure OpenAI docs in LangChain

All you have to do is change a few parameters:

# Set this to `azure`
export OPENAI_API_TYPE=azure
# The API version you want to use: set this to `2022-12-01` for the released version.
export OPENAI_API_VERSION=2022-12-01
# The base URL for your Azure OpenAI resource.  You can find this in the Azure portal under your Azure OpenAI resource.
export OPENAI_API_BASE=https://your-resource-name.openai.azure.com
# The API key for your Azure OpenAI resource.  You can find this in the Azure portal under your Azure OpenAI resource.
export OPENAI_API_KEY=<your Azure OpenAI API key>

ogabrielluiz avatar Apr 22 '23 15:04 ogabrielluiz

So use openai too?

qixiaobo avatar May 16 '23 13:05 qixiaobo

Yes. OpenAI and Azure are the same APIs just coming from different endpoints, I think.

ogabrielluiz avatar May 16 '23 13:05 ogabrielluiz

Yes. OpenAI and Azure are the same APIs just coming from different endpoints, I think.

With some azure config. Like Azure Deployment

qixiaobo avatar May 21 '23 14:05 qixiaobo

I think this is the choice https://github.com/stulzq/azure-openai-proxy

qixiaobo avatar May 21 '23 14:05 qixiaobo

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 05 '23 15:07 stale[bot]

According to the Azure OpenAI docs in LangChain

All you have to do is change a few parameters:

# Set this to `azure`
export OPENAI_API_TYPE=azure
# The API version you want to use: set this to `2022-12-01` for the released version.
export OPENAI_API_VERSION=2022-12-01
# The base URL for your Azure OpenAI resource.  You can find this in the Azure portal under your Azure OpenAI resource.
export OPENAI_API_BASE=https://your-resource-name.openai.azure.com
# The API key for your Azure OpenAI resource.  You can find this in the Azure portal under your Azure OpenAI resource.
export OPENAI_API_KEY=<your Azure OpenAI API key>

I tried doing this using a .env file and also using the set command in Windows but it didn't work. When I send a message, this message shows:

Error: Must provide an 'engine' or deployment_id' parameter to create a <class 'openai.api_resources.chat_completion.Ch... (but the rest of the message is cut off.

image

profplum700 avatar Aug 04 '23 17:08 profplum700