Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAI component validation error #6063

Open
mch97 opened this issue Feb 1, 2025 · 4 comments
Open

OpenAI component validation error #6063

mch97 opened this issue Feb 1, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@mch97
Copy link

mch97 commented Feb 1, 2025

Bug Description

I have update on langflow version 1.1.3
Since this the OpenAI component get following error
The error happens in the basic prompting example too

                         ValidationError: 1 validation error for ChatOpenAI
                         api_key
                           Input should be a valid string [type=string_type, input_value=SecretStr('**********'),
                         input_type=SecretStr]
                             For further information visit https://errors.pydantic.dev/2.10/v/string_type

Reproduction

.

Expected behavior

.

Who can help?

No response

Operating System

Windows

Langflow Version

1.1.3

Python Version

None

Screenshot

No response

Flow File

No response

@mch97 mch97 added the bug Something isn't working label Feb 1, 2025
Copy link

dosubot bot commented Feb 1, 2025

I found a similar unsolved discussion regarding a validation error with the OpenAI component in Langflow. The error message in that discussion was about not finding the openai_api_key and suggested adding it as an environment variable or passing it as a named parameter [1].

In your case, the error indicates that the api_key should be a valid string. Ensure that the OPENAI_API_KEY is correctly set as a string in your environment variables or passed directly to the component. Double-check that there are no issues with how the key is being stored or retrieved, such as incorrect formatting or encoding.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@severfire
Copy link

Hi,

Can you check out Flow execution order in your flow or langflow?
May be related: #6062

@mch97
Copy link
Author

mch97 commented Feb 1, 2025

i dont knwo how to to this. I just try the basic prompting exmample and get the same error. Look like the key will not set in the component

@severfire
Copy link

observe when flow is executing what highlights first and what is connecting to what

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants