langflow-ai / langflow

⛓️ Langflow is a visual framework for building multi-agent and RAG applications. It's open-source, Python-powered, fully customizable, model and vector store agnostic.
http://www.langflow.org
MIT License
20.4k stars 3.02k forks source link

[a58 bug] Chat Input stopped working with Azure OpenAI model/embedding component #2182

Open msmygit opened 3 weeks ago

msmygit commented 3 weeks ago

Describe the bug When a chat input component is connected to Azure Open AI embedding/model, we currently get the below error with a58 version,

Error building vertex Azure OpenAI: 2 validation errors for HumanMessage content str type expected (type=type_error.str) content value is not a valid list (type=type_error.list)

Browser and Version All

To Reproduce Steps to reproduce the behavior:

  1. Create a very basic flow with Chat Input -> Azure Open AI Embedding -> Chat Output
  2. Run each component and you'll end up with this error. Console will show error as below:
    ValueError: Error building vertex Azure OpenAI: 2 validation errors for HumanMessage                                                                                                    
                             content                                                                                                                                                                                 
                               str type expected (type=type_error.str)                                                                                                                                               
                             content                                                                                                                                                                                 
                               value is not a valid list (type=type_error.list) 

Screenshots

Screenshot 2024-06-15 at 03 37 18

Additional context This used to work somewhere with <= a48 version.

dosubot[bot] commented 3 weeks ago

The error you're encountering occurs because the input_value parameter in the build method of the AzureChatOpenAISpecsComponent class is expected to be a string, but it is being provided as a list. To resolve this issue, ensure that the input_value parameter is passed as a string when using the Chat Input component with the Azure OpenAI embedding/model [1][2][3][4][5].

To continue talking to Dosu, mention @dosu.

DonPabs commented 3 weeks ago

@dosu How is this fix implemented in the code of the Chat Input ? I have tried changing the code but it doesnt work. Please provide an example based on the issue that was described before.

nicoloboschi commented 1 week ago

Is the problem still there with langflow 1.0.5?