C-Loftus / talon-ai-tools

Query LLMs and AI tools with voice commands
http://colton.place/talon-ai-tools/
MIT License
46 stars 17 forks source link

Getting errors trying to run `model explain this` #3

Closed jaresty closed 8 months ago

jaresty commented 8 months ago

I'm trying to use model explain this and getting the following error in my talon logs:

2023-12-20 20:08:53.247 ERROR TalonScript TypeError in: /Users/schwa/.talon/user/talon-ai-tools/GPT/gpt.talon:7
2023-12-20 20:08:53.248 ERROR Line 8: user.paste(text: str)
2023-12-20 20:08:53.248 ERROR Line 8:   parameter 1 (text) expects type <class 'str'>, got <class 'NoneType'>
C-Loftus commented 8 months ago

Can you provide more context (ie did the GPT command fail? Any other errors in the log?) Did any text get pasted? Is it just a type error? Is your API key valid?

If it is getting a nonetype that probably means it failed somewhere

jaresty commented 8 months ago

Nothing happened... I just opened the logs and saw that. I tried adding some more logs but didn't see those printed either. I can try again in a few days. I'm also open to doing a screen share/debug if it helps!

C-Loftus commented 8 months ago

Ok, you have pulled the latest version right? I just pushed a commit to log the API key failure so please pull again regardless. Since you say the command model explain this failed but the line number you are quoting is failing within the model ask command in the Talon file.

Do you have your system notifications turned off? Since if your API key isn't defined it will fail and only lets you know via app.notify which calls system notifications. I think this might be an API key issue. I have changed this to also log to the log file in addition to notify users.

I think this is best to do a quick call if the above info doesn't help. Feel free to PM me on Slack.

C-Loftus commented 8 months ago

I think I see the issue. I don't think you used the proper name for the key.

import os
os.environ["OPENAI_API_KEY"] = "YOUR-KEY-HERE"

In the readme that is the name of the env var, but yours, according to what you sent me on Slack is not the same name. You used OPENAPI_KEY instead of OPENAI_API_KEY

jaresty commented 8 months ago

That could do it! I'll give it a try when I get back. Thank you!

C-Loftus commented 8 months ago

Closing this since I assume it is fixed. If you have issues I will reopen