#API Producing A Blank Response.

48 messages · Page 1 of 1 (latest)

silver axle
#

[SOLVED] - Thank you @remote turtle
The solution is to delete the line containing a stop sequence. The CLI works! I am trying to implement a CLI version of the bot and then implement speech activation. Something like Alexa but using the ChatGPT bot. I am using the Davinci model since ChatGPT API isn't out yet.

So far I have successfully gotten a response for the API but it is blank. The code is located in this termbin link. (The API key in the code has been deactivated) https://termbin.com/1dz7o

Thank you and if any other hobbyist would like to collaborate with me post here and we shall make a discord channel for programming with the API.

remote turtle
#

is this an OLD key you deleted?

silver axle
#

Yrd

remote turtle
#

Also, try changing the temperature parameter to 1 in the completion call and see if that changes things

silver axle
#

Yes

#

I just deactivated it. I can delete it completely if it's a problem though. I'm just being lazy.

#

ChatGPT bot has made me lazy.

#

Okay I will try that thank you.

remote turtle
#

As long as it's not usable and that's a stale key that won't work 🙂

silver axle
#

Yeah it's gone.

remote turtle
#

after the temperature change to 1, try also getting rid of the stop sequence parameter

#

the stop= line

silver axle
#

Where does the value choices come from do you know? This code was generated by the bot

remote turtle
#

One of those two things should fix the issue

silver axle
#

Awesome I'm so excited

remote turtle
#

The 'choices' is just the location in the JSON response of the API that contains the completion result

silver axle
#

After I get this working where you can type commands. I want to add voice input via the microphone of the laptop. And have the output be from the speakers.

#

Got you.

remote turtle
silver axle
#

Yeah that's gonna be the hard part.

remote turtle
#

Definitely doable though! not super difficult by any means, just a bit more involved

silver axle
#

I could save the speech input as a variable called user input and submit that to the API then save the response to a variable and just output that as speech.text(response) maybe.

#

I'm sure they're going to release this thing as an Alexa like device too right if they havent already

remote turtle
#

You need to first record the audio from the speech input, then, you need to transcribe the audio into text using something like OpenAI Whisper, then, you need to clean up that text and send it to GPT3, then you need to take the result from GPT3 and synthesize it into voice with a text to speech library, or something like elevenlabs

remote turtle
silver axle
#

What do you mean like an option to use preprogrammed Alexa stuff?

remote turtle
#

Like I think there's Alexa skills already where u can ask GPT questions through voice

silver axle
#

oh wow

#

I havent gotten past the first page of the API as I'm just trying to take it one step at a time, once I get this working. I'll move on to harder stuff.

remote turtle
#

Yeah absolutely

silver axle
#

I got a habit of making huge complicated programs where I dont make sure I have each part working then it takes a ton of debugging.

#

You work for OpenAI or you're admin of the discord server?

remote turtle
remote turtle
silver axle
#

Awesome, well I'm glad to meet you. I joined here to meet other people who code. I've been programming on my own and it's hard.

#

My name's John I'm from Tennessee.

#

So I've set temperature to 1 and I've got stop=[""] instead of stop=[\n] or should I just remove the stop line completely?

remote turtle
#

Glad to meet you as well! Lots of programmers here!

remote turtle
#

if that still doesn't work, keep temperature as 1 and remove stop line entirely

silver axle
#

Alright so leave \n

#

Gotta change the API key now lol and I'll let you know how it goes.

#

You just became my new best friend

#

└─# python3 Sabia
What would you like to ask me?
What is the square root of 9?
Bot:

3

#

Deleting the stop line entirely was the answer.

#

YAY!

remote turtle
#

Great! Looks like after the prompt because of the stop /n, it never allowed itself to generate text because it thought it was already done since it was at the stop sequence, that's why you were getting empty responses