Google Bard API Project

done!

not totally.
you can use 'get value at key path' with one block:

1 Like

Thanks, Kevinkun. Can you show the 'Do it' of those blocks? I can't get them to work for me.
The quote or quotes should be returned.

sorry the responseContent you supplied seems to be not valid json format. I can not test it.

Thanks, everyone for the help. It is indeed possible to extract the text with one Dictionary block!

and @Kevinkun 's more streamlined solution:


END

While Version 2 works fine, the support staff suggested a simpler solution for handling responseContent in the Web component's GotText event block which uses one Dictionary block. This is very instructive when you have the kind of json object response often returned by LLMs that contains nested lists.

Gemini_ProV3.aia (6.6 KB)

END

I think, the only relevant request header is the Content-Type, the others are optional
And: the Content-Length usually is the length of the text from the PostText method and not some constant value... but as there is no error, this header also seams to be optional

Taifun

Taifun has pointed out that the only header blocks required are the Content-Type. I have confirmed this so further simplification was possible. The new header blocks are now:

and the updated aia file is:

Gemini_ProV4.aia (6.4 KB)


END

1 Like

Hey, why it's not working? I am using ur V4 version. I am from Italy btw

Ciao. I believe you need to select Italian as your language for the text to speech component. See the Properties section for the TTS component here: https://ai2.appinventor.mit.edu/reference/components/media.html#TextToSpeech.AvailableLanguages

i am not using it as text to speech

i was just testing while chatting with the AI but it gives an error sayingError: 400application/json

I have reworked the code and version 4 is working for me.
Gemini_ProV3.aia (5.4 KB)