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

Dynamic Agent template: OpenAI key error #4395

Closed
L-Huber opened this issue Nov 5, 2024 · 18 comments · Fixed by #4555
Closed

Dynamic Agent template: OpenAI key error #4395

L-Huber opened this issue Nov 5, 2024 · 18 comments · Fixed by #4555
Assignees
Labels
bug Something isn't working

Comments

@L-Huber
Copy link

L-Huber commented Nov 5, 2024

Bug Description

I currently want to expand the Dymanic Agent of langflow. However, I get the following error:
AuthenticationError: litellm.AuthenticationError: AuthenticationError: OpenAIException - Error code: 401 - {'error':
{'message': 'Incorrect API key provided: dummy. You can find your API key at
https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code':
'invalid_api_key'}}

Reproduction

  1. Choose the Dynamic Agent template as a new project in langflow
  2. Add your openAI KI
  3. Run the flow

Expected behavior

There should not be an error and the flow should be working

Who can help?

@ogabrielluiz @nicoloboschi @zzzming @jo

Operating System

MacOS

Langflow Version

1.3.5

Python Version

3.11

Screenshot

Bildschirmfoto 2024-11-05 um 10 06 21

Flow File

No response

@L-Huber L-Huber added the bug Something isn't working label Nov 5, 2024
Copy link

dosubot bot commented Nov 5, 2024

Hey @L-Huber! 👋 I'm here to help you with any bugs, questions, or contributions for langflow. Let's work together to solve the issue you're facing.

To resolve the OpenAI key error (AuthenticationError: OpenAIException - Error code: 401) when using the Dynamic Agent template in Langflow version 1.3.5, ensure that you have correctly added your OpenAI API key to the Global Variables in Langflow. Follow these steps:

  1. Open Langflow and navigate to Settings.
  2. Go to Global Variables.
  3. Click Add New.
  4. Name your variable and paste your OpenAI API key in the Value field.
  5. In the Apply To Fields field, select the field to apply this variable to.
  6. Click Save Variable.

Make sure that the API key is valid and correctly entered. This should resolve the authentication error [1].

To continue talking to Dosu, mention @dosu.

@L-Huber
Copy link
Author

L-Huber commented Nov 5, 2024

Hey @L-Huber! 👋 I'm here to help you with any bugs, questions, or contributions for langflow. Let's work together to solve the issue you're facing.

To resolve the OpenAI key error (AuthenticationError: OpenAIException - Error code: 401) when using the Dynamic Agent template in Langflow version 1.3.5, ensure that you have correctly added your OpenAI API key to the Global Variables in Langflow. Follow these steps:

  1. Open Langflow and navigate to Settings.
  2. Go to Global Variables.
  3. Click Add New.
  4. Name your variable and paste your OpenAI API key in the Value field.
  5. In the Apply To Fields field, select the field to apply this variable to.
  6. Click Save Variable.

Make sure that the API key is valid and correctly entered. This should resolve the authentication error [1].

To continue talking to Dosu, mention @dosu.

I tried this, but it has not worked.

@carlosrcoelho
Copy link
Contributor

Hey @L-Huber

What version are you using?

I just tried on the latest version 1.0.19.post2 and worked as expected.

image

@carlosrcoelho carlosrcoelho self-assigned this Nov 6, 2024
@L-Huber
Copy link
Author

L-Huber commented Nov 6, 2024

@carlosrcoelho just updated it to Langflow-1.0.19.post2 langflow-base-0.0.99. I even created a new openai key and tested it. But it is still not working.

@carlosrcoelho
Copy link
Contributor

@L-Huber

Can you share your flow?

@L-Huber
Copy link
Author

L-Huber commented Nov 6, 2024

@carlosrcoelho
Copy link
Contributor

@L-Huber
Make sure all the OpenAI components have the API Key.

I tried to replicate it, but I didn't get the error.
image

However, if I forget to add an API Key to a component, the error appears.
image

@L-Huber
Copy link
Author

L-Huber commented Nov 6, 2024

@carlosrcoelho that is the funny thing: all previous steps until "Hierarchical Crew" work:
Bildschirmfoto 2024-11-06 um 23 17 58
so the API key should be correct.

@SavvySupport
Copy link

I have the same issue. I think it's an error with "Hierarchical Crew" component. I tried using Groq as the LLM, and there's an issue with that too.

Error building Component Hierarchical Crew:

litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=llama-3.2-1b-preview
Pass model as E.g. For 'Huggingface' inference endpoints pass in completion(model='huggingface/starcoder',..) Learn more: https://docs.litellm.ai/docs/providers

@L-Huber
Copy link
Author

L-Huber commented Nov 7, 2024

@SavvySupport Do you have any solution to this?

@yannisTr
Copy link

yannisTr commented Nov 9, 2024

Hello,

Same error here with sequential crew and custom base url for the llm (to use with openrouter). All previous steps work fine, llm works with other types of components (like chains).

@austin-duff-prft
Copy link

Same issue.

@erichare erichare linked a pull request Nov 15, 2024 that will close this issue
@guilegarcia
Copy link

I'm experiencing the same issue. Has anyone found a solution? I believe it might be a bug.

@carlosrcoelho
Copy link
Contributor

Hey @L-Huber

Did you try using the new version 1.1.1? Test it out and let me know.

@L-Huber
Copy link
Author

L-Huber commented Nov 28, 2024

@carlosrcoelho I will try it out with the new version and let you know. I might actually be a version issue.

@carlosrcoelho
Copy link
Contributor

@L-Huber

Do you need any assistance with this case? If not, please let us know if this issue can be closed.

@L-Huber
Copy link
Author

L-Huber commented Dec 3, 2024

@carlosrcoelho I currently cannot even upgrade my langflow version. Is this is known issue?

@carlosrcoelho
Copy link
Contributor

@L-Huber

Sorry to hear that.

Please give a try using uv.

Doc: https://docs.langflow.org/get-started-installation

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

Successfully merging a pull request may close this issue.

6 participants