Replies: 3 comments 1 reply
-
🤖 Hello @Re0NuM! 👋 I'm Dosu, a friendly bot here to assist you while we wait for a human maintainer. I can help you with bug fixes, answer questions, and guide you on your journey to becoming a contributor. Don't worry, we'll get through this together! 🤖😊 Based on the error message you're encountering, it seems like the 'engine' argument is not recognized. This could be due to a mismatch between the version of Langflow you're using and the version that supports Azure OpenAI integration. In the Azure OpenAI setup with Langflow 0.4.0 issue, the solution suggests using the {
"engine": "<YOUR AZURE DEPLOYMENT NAME>",
"api_version": "2023-05-15",
"api_type": "azure"
} Also, you need to set the Another similar issue, how to config azure openai in langflow, suggests setting a few environment variables: # 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> Please ensure that you have correctly set these parameters and that your version of Langflow supports Azure OpenAI integration. If the problem persists, it would be helpful to know the exact version of Langflow you're using and the steps you've taken to integrate Azure OpenAI. This will help in diagnosing the issue further. I hope this helps! If you have any other questions, feel free to ask. Best, SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
This is caused by the new version of |
Beta Was this translation helpful? Give feedback.
-
I built a new Custom Component, and it seems working fine for me: from typing import Optional
from langflow import CustomComponent
from langchain.llms.base import BaseLanguageModel
from langchain.chat_models.azure_openai import AzureChatOpenAI
class AzureChatOpenAIComponent(CustomComponent):
display_name: str = "Azure Chat OpenAI"
description: str = "LLM model from Azure OpenAI."
AZURE_OPENAI_MODELS = [
"gpt-35-turbo",
"gpt-35-turbo-16k",
"gpt-35-turbo-instruct",
"gpt-4",
"gpt-4-32k",
"gpt-4-vision",
]
def build_config(self):
return {
"model_name": {
"display_name": "Model Name",
"value": "gpt-35-turbo",
"options": self.AZURE_OPENAI_MODELS,
"required": True,
},
"azure_endpoint": {
"display_name": "Azure endpoint",
"required": True,
"info": "Your Azure endpoint, including the resource.. Example: `https://example-resource.azure.openai.com/`"
},
"deployment_name": {
"display_name": "Deployment Name",
"required": True,
},
"openai_api_version": {
"display_name": "OpenAI API Version",
"value": "2023-05-15",
"required": True,
"advanced": True,
},
"openai_api_key": {
"display_name": "API Key",
"required": True,
"password": True
},
"temperature": {
"display_name": "Temperature",
"value": 0.7,
"field_type": "float",
"required": False,
},
"max_tokens": {
"display_name": "Max tokens",
"value": 1000,
"required": False,
"field_type": "int",
"advanced": True,
},
"streaming": {
"display_name": "Streaming",
"field_type": "bool",
"advanced": True,
"required": False,
},
"code": {"show": False},
}
def build(
self,
model_name: str,
azure_endpoint: str,
deployment_name: str,
openai_api_key: str,
openai_api_version: Optional[str] = "2023-05-15",
temperature: Optional[float] = 0.7,
max_tokens: Optional[int] = 1000,
streaming: Optional[bool] = False,
) -> BaseLanguageModel:
return AzureChatOpenAI(
model_name=model_name,
azure_endpoint=azure_endpoint,
deployment_name=deployment_name,
openai_api_key=openai_api_key,
openai_api_version=openai_api_version,
temperature=temperature,
max_tokens=max_tokens,
streaming=streaming,
)
|
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm trying to setup AzureOpen AI in langflow with the
ChatOpenAI
componentI'm creating 1 model_kwargs per attribute :
But when I try to start the flow I get the following error : Completions.create() got an unexpected keyword argument 'engine'
If anyone has detailed instructions on how to make it work ?
Thanks a lot :)
Beta Was this translation helpful? Give feedback.
All reactions