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

Bug: NoneType object is not subscriptable with ChatOpenAI + SQLAgent #1427

Closed
scheung38 opened this issue Feb 12, 2024 · 9 comments · Fixed by #2847
Closed

Bug: NoneType object is not subscriptable with ChatOpenAI + SQLAgent #1427

scheung38 opened this issue Feb 12, 2024 · 9 comments · Fixed by #2847
Assignees
Labels
bug Something isn't working

Comments

@scheung38
Copy link

scheung38 commented Feb 12, 2024

Describe the bug
A clear and concise description of what the bug is.

Browser and Version

  • Browser: chrome
  • Version Version 121.0.6167.160 (Official Build) (x86_64)

To Reproduce
Steps to reproduce the behavior:

  1. ChatOpenAI with OpenAI API Key
  2. gpt-4-turbo-preview
  3. 256 tokens
  4. Default

SQLAgent
Entered Database URI:
postgresql+psycopg2:https://:@:5432/<DATABASE_NAME>

Screenshot 2024-02-12 at 14 21 03

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Also are there examples from marketplace to use as starting templates?

Copy link

dosubot bot commented Feb 12, 2024

🤖

Thank you for providing the detailed steps to reproduce the issue. The error message "NoneType object is not subscriptable" typically occurs when you're trying to access an item from a NoneType object, which is not possible. This could be due to a variable or object that is expected to be a certain type (like a list or a dictionary), but is actually None.

Given the steps you've provided, it seems like the error might be occurring when the ChatOpenAI or SQLAgent is trying to access an item from an object that is None. This could be due to a variety of reasons, such as a missing or incorrect OpenAI API Key, an issue with the gpt-4-turbo-preview model, an incorrect token limit, or an issue with the Database URI.

Unfortunately, I can't see the screenshot you've provided, but here are a few things you can check:

  1. Make sure your OpenAI API Key is correct and has the necessary permissions.
  2. Check if the gpt-4-turbo-preview model is available and working as expected.
  3. Try changing the token limit to see if that resolves the issue.
  4. Make sure the Database URI is correct and the database is accessible.

If you're still experiencing the issue after checking these, it would be helpful if you could provide more information about the error. Specifically, the full error message and stack trace, and any additional information about what you're trying to do when the error occurs.

As for your question about examples from the marketplace, I'm afraid I don't have that information. However, you can check the Langflow Marketplace for available examples and templates. Please note that the availability of examples and templates may vary depending on the current state of the marketplace.

I hope this helps! If you have any more questions or need further clarification, feel free to ask. Dosu

Sources

About Dosu

This 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.

@dosubot dosubot bot added the bug Something isn't working label Feb 12, 2024
@mcathena
Copy link

mcathena commented Mar 7, 2024

I have the same bug. Did anyone solve this?

@ogabrielluiz
Copy link
Contributor

Hi @scheung38 !
Have you tried without the +psycopg2?

@rubrix
Copy link

rubrix commented May 2, 2024

same bug, without psycopg2

@N3XPW
Copy link

N3XPW commented Jun 5, 2024

Do we have any solution for the problem?
Im facing the exact same issue.

@HShawnSun
Copy link

same issue here, using ollama + SQLAgent

@anovazzi1
Copy link
Contributor

Hello, @HShawnSun,
Sorry for the delay. What version are you using? Does the error still persist?

@HShawnSun
Copy link

HShawnSun commented Jul 2, 2024 via email

@anovazzi1
Copy link
Contributor

Thanks for the feedback! I'll take a look and fix it ASAP.

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.

8 participants