[F/OS] 🧠 Artificial Intelligence and OpenAI!

I'm getting "No value for choices".
Even on your provided AIA, the same error is coming.

Hi, did you provide a valid API key? Make sure you added a valid API key from OpenAI. Share with me your project in PM if you still find the error. Check the FAQ Q4 for this as well.

1 Like

Yes, I provided the API.

1 Like

I'm contacting you in PM. Hope we can sort out the errors.

EDIT: Sorted out, this user has their account expired before today. Please check and make sure your accounts are still available.

2 Likes

Hi @manyone,

@fahadboss10 has confirmed that the extension is working. Can you try again and see if there are errors?

2 Likes

There's nothing wrong with the extension. It works. I'm just saying that it's misnamed. The title implies that it's connecting to ChatGPT but it is actually connecting to GPT-3.
So you cannot really do all those wonderful things that you read about that you can do with ChatGPT.

2 Likes

No value for choices

1 Like

Is your API key expired already?

1 Like

How to change the model from ada to davinci?

1 Like

It's not possible with this version yet, but I will add this feature in the next release.


Corresponding to @fahadboss10's question about how to format the answers with new lines, it's still not possible with this release, as the result returned from the OpenAI server adds line breakers () in weird locations. However, I'll try to figure out a way to sort things out.

3 Likes

Hello everyone, I hereby present you the :star2: version 2 update of this extension.

New features:

  • Better error detection. The "no value for choices" error should be eliminated, and should be related to an error message including more detail, such as, "You exceeded your current quota, please check your plan and billing details.".

  • Choose your models. Previously I have set the only model to Ada, but now you can choose three more models, i.e. Babbage, Curie and Davinci.

    image

  • Renamed extension to OpenAI to stop the confusion around. @Taifun, please kindly update your directory and @Peter, please update the links in your replies in other communities of this extension. Please remember to update the old extension, convert the blocks to the new one and delete the old extension. Thank you for your kindness.

Plans for next release:

  • Include options to resize images to 256 square and 512 square.

@manyone Is this OK now?

5 Likes

yes - it's looking good thank you - it's nice to be able to select the language model.
i want to suggest something too - the informative parameter seems too restricitive if there are only 2 values - straight and exact answers or "mildly creative" answers. i looked at the code and apparently, this is passed to gpt-3 as the temperature parameter which has a value, respectively, of 0 for exact answers and 0.9 for creative answers. i was wondering if it makes sense to replace the informative parameter with the temperature parameter - so the user can select the wildness of the responses as he wishes. it can be presented as a slider , 0.0 to 1.0 (extremely wild to boring).
also, the first demo didn't have an example for image generation. will the new demo show it this time?

2 Likes

It's on Screen2; please check again.

i tried the new program - here are my results:

let me start with image generation (from screen2 of demo):
my prompt was
robot wearing grass skirt, green hills in background, in style of stained glass

not bad! it may have missed the grass skirt but the rendition is close enough to the prompt!

now here's my test for text generation:
my prompt was
tell me, in a poem, why I should learn Python

as you can see, it CAN do poems! that's because i picked Davinci for language model - it is more capable of conversational style than the Ada model - plus i set Informative to false (meaning "be a little creattive in your response"). the only problem is it dropped all the newlines (\n)! so the response came back with all text strung together and no breaks. i had to cut n paste the contents and hand edited it to split the lines at the right places - here's the resulting poem:

You: tell me, in a poem, why I should learn Python

AI: *A powerful language, Python you should learn
To unlock a world of programming to yearn  
No need to worry, no need to stress
For Python is simple, easy, and best  
It is all around, coding jobs galore
From web to data, it can explore  
Whether starts fresh or already know
Python can take you far, for sure  
Be it beginners or advanced coders
Python is ideal for all to ponder  
The language of choice, to any age
A chance to code and will engage

also i had to change the design and replaced the original destination of the conversation from Label1 to TextBox2 because the label won't let me do cut-n-paste but textbox will.

overall, the demo reveals how easy it is to connect to OpenAI (GPT-3) but something needs to be done about those disappearing newlines!

get yourself an API key and start playing - in all the time i've been playing with demo here since it was released, i've only spent 10 cents!

thanks for the demo @Gordon_Lu !

here's my version (with output set to a textbox instead of label)
myOpenAI.aia (118.3 KB)

2 Likes

For some reason, sometimes OpenAI returns data with line-breakers placed in weird places, such as in the middle of a sentence. I'll try to figure out a way to make the line-breakers organized, as in the previous versions, I removed all line-breakers in the output.

1 Like

Gordon,
Thank you for this excellent update.
Regards,
Peter

2 Likes

Thank you so much for your efforts :heart: I have detected a bug in the extension ...When network is not connected,and you try to Prompt. the app crushes with runtime error please fix it

1 Like

This of course does not work; OpenAI connects with the Internet...

1 Like

The app exit automatically with a crush Can you add a fix so as to show Error occurred instead of Exit the app suddenly

1 Like

@Abbas_Gasri Why not just check for an Internet connection prior to calling OpenAI? You might use Sajal's recommendation Check Internet Connection In App Inventor | Imagnity or use an extension to check for an Internet connection. :astonished:

3 Likes