[APP][Pro] OpenAI ChatGPT

Hmm… I have only tried with the HP2019 speaker like this:

For me the trigger after the “speech command” will only trigger once the “speech command” has fully completed executing.

I assume the problem you experience with Sonos or Chromecast then is that they give you an immediate response for the “speech command” instead of when “completely spoken”… If they do, and they don’t have any other way to signal to you that the command has been “completely spoken”, then I think this is a bug with the Sonos and Chromecast drivers (considering that Athom is the developer of both of those apps in addition to the working flow for HP2019 speech commands). You can report bugs to Athom here: https://homey.app/en-us/support/.

Alternatively, you can use the flow that waits for the full answer instead, though… you may be limited by the sonos/chromecast speech service text limitations then so I’m not sure if that will help you…

Hi there, and let me start by thanking you for your efforts to explore the possibilities to integrate ChatGPT with Homey!

I tried to set up a simple flow, but i’m either getting HTTP response 429 for chatgpt.35-turbo, or 404 for chatgpt-4.

I have set up an API key at openai.com and paid $10 to test out the possibilities.

Any pointers to what I might be doing wrong?

429 seems like rate limitation. As I read how this is documented, this is something the app should try to solve and not you. The 429 indicate how long to wait before trying again, currently which the app blatantly ignores. I can try to account for this in a new version, but unfortunately I am on holiday so you have to wait a bit before I can look at this. Meanwhile, if you are impatient, you are welcome to download the source code from github and try a fix on your own, which I would be more than happy to include :wink: Otherwise, a fix may occur no earlier than in 2-3 weeks time.

I’m getting this too - set up a new homey with openai API key, tried revoking and renewing key info - no luck. it gives 429 on 3.5, 404 on 4.
Doesn’t provide any more info to go on actually within the log. Is there any way to expose more info on what’s the problem with the connection. Happy to provide any info that helps , for instance diagnostic info within openai.

I’d love to help out, truly, but Javascript is far from my strongest suite so I guess that I’ll have to wait for your return. If it was written in C/C++ or Python, I’d be much more capable to contribute :sweat_smile: But Homey apps are expected to be written in js, right?

I’m back. I created this ticket to look into the 429 (Handle rate limitation 429 responses · Issue #8 · frodeheg/OpenAI · GitHub). However, I have a big backlog of other things, so I’m not sure if I can look at this very soon, but I’ll keep you posted. If anyone wants to contribute to get it resolved faster I can assist in setting up the development environment.

Yes

Ok, no worries. Just let me know when you need someone to test it or reproduce the issue.

That Danish is a bit hard to understand

It’s Norwegian and I agree with you, the Homey interface is utterly stupid as you can’t switch language in a jiffy to take snapshots. To make an English snapshot I would have to reboot the homey and that is out of the question.
Here is a quick translation for you (which you could have gotten faster from Google translate):

En webhook ble utløst med flagg og beskjed
→ A webhook was triggered with a flag and message

#Flagg er nøyaktig image
→ The tag #Flag is exactly equal to “image”

Lag et bilde med størrelse 1024x1024 fra teksten #Beskjed og returner det
→ Create an image of size 1024x1024 from the text within the #Message and return it

Cast a picture #DALL-E_Bilde
→ Cast the image #DALL-E_Image to the chromecast screen

Spør ChatGPT spørsmålet #Beskjed og utløs delsvar
→ Ask ChatGPT the question #Message and trigger partial responses

Send Error: #Error til Frode Heggelund
→ Send the error message to me

1 Like

Many thanks, sorry for the mishap

I did confirm that the key used is valid, one thing I noticed is that in validating with a query under ubuntu, I did have to specify the organizationID. That got me thinking - because in the configuration of the app it doesn’t require me to specify the organizationID ? OpenAI does let you configure if you want the API call to default to either the ‘personal’ organization or - in this case - my own business organization. Changing that setting did not result in a succesful query btw. So maybe I’m not actually on to something. But I thought it was worth sharing the effort…

429 is rate limitation, so it shouldn’t be related to the key.
You don’t get 429 every single time, do you?

depends on the model I choose. If i choose 4 I always get 404 errors, if i choose 3.5 - consistently the 429 error

Oh… 404 is “Not found”, so I guess they have changed the interface…

Frode - I have fixed it - because the rate limit thing kept me thinking. I do have a subscription (from the early days on) - but I missed the point where I’m supposed to buy separate credits for the API. I somehow thought that once I had defined a subscription - It would be pay-as-you-go besides the regular chatGPT subscription. So I fixed that. The free tier also didn’t apply to me - as all free credits expire after 3 months and that was long gone. I can confirm that it works now. I do realize that this means nothing for Guzzaaxxx - other then maybe looking into the credits once more within openAI as the behaviour seems to replicate my problem. So no issue here anymore - I am up up and away playing with your app - kudos and many thanks.

Ah, so now I have to expire my subscription so I can reproduce the issue to improve the feedback message when this occur again? :joy:
I’m glad you made it work @Vincent_Verbon. @Guzzaaxxx , does this apply to you as well?

Either that or hope that people actually read this thread :wink:
I sincerely hope I didn’t waste a serious amount of time on your end…

Lol, I was on vacation so I couldn’t look at it anyway, so no worries :wink:

Hey Guys, and thank you Frodeheg for this app.
I have some trouble to get response of chatgpt:

Network error. The API is working - i get some requests back:

This are my Settings - anybody can help me?

Do you always get “Network request failed”, or was this a one-time failure?

For your information, the flowcard that waits for the full answer involves many network requests as all the partial responses must be requested after each other. If you use partial responses instead then the likelihood of network error will probably decrease.

However, if this is a common problem, we probably should add automatic retries in the app itself to hide the issue with network problems.