#GPT-3 + WhatsApp + Serverless + Low Code = 😎

163 messages · Page 1 of 1 (latest)

quiet crane
oblique cosmos
#

thanks, working really well since yesterday. i had to re-tick storage feature cuz i was getting a lot of error 400, then its working flawlessly.. newcomers.. remember this bot is using GPT-3 not chatgpt. dont expect long and explained awnser (as my whatsapp friends lol).. thanks for this Lolo

timber meteor
#

Is there a way to turn this into a full mobile app? Or is it just stuck running on lolo?

tough flint
timber meteor
tough flint
#

oh :/

quiet crane
tough flint
#

So I don't need a number for it

quiet crane
quiet crane
# tough flint So I don't need a number for it

You get a number from Meta, so you do need a number to send to but that one is free. Go through the start of the tutorial, create a meta dev account and set up whatsapp and you'll see a number you can use under Getting Started.

tough flint
#

ALr!

#

Thx

quiet crane
# timber meteor Lolo

Not sure exactly what you mean... You want to build a frontend to connect the bot to? Think of Lolo as your backend so in the case you'd like to build a mobile app, you could set up a websocket or create an api instead. You'll have to give me a bit more information on what you want to achieve though.

If you want to set up a websocket see this guide: https://docs.lolo.company/docs/draft-simple-websocket-application
If you want to create an api see this hello world guide: https://docs.lolo.company/docs/creating-an-application

Then you would just connect the OpenAI (beta) node in these workflows.

golden mesa
#

After following the tutorial, I see the bot receives the message but I get an error and don't get the response

raw whale
#

error 400 from post msg on lolo

timber meteor
timber meteor
#

Ok so I see there is no sms support

#

Hmm I can't really find what I need, so I will probably find a different tool (suggestions are welcome) but it looks like a great site that you have!

quiet crane
quiet crane
quiet crane
timber meteor
#

Instead of twillio

quiet crane
timber meteor
#

Ezpz

quiet crane
# raw whale error 400 from post msg on lolo

Yes don't store Prompt History with WhatsApp, doesn't seem to work all that well. We've used it with Slack a bit better. See if OpenAI will release the ability to send in conversion_id in the future to make it easier to get that feeling of a back and forth conversation. But for now, de-tick it and save/run your app again.

raw whale
#

sorry dont want to leak my number haha but thanks!

#

@quiet crane. How do I change the profile pic of the bot on WhatsApp? I never worked with meta apps...

quiet crane
# raw whale <@1028976285705322526>. How do I change the profile pic of the bot on WhatsApp? ...

Not sure this will work with test numbers, you'll need to get a real number. Then you should be able to configure the settings for that number under account tools and then phone numbers at https://business.facebook.com/

quiet crane
# raw whale <@1028976285705322526>. How do I change the profile pic of the bot on WhatsApp? ...

Writing to a test number is free though in WhatsApp, not sure about the pricing for buying a number via Facebook. Creating Slack apps seems to be a lot simpler in general. Check out a guide for creating slack apps with GPT here https://medium.com/aws-tip/take-6-minutes-to-create-a-free-openai-gpt-3-bot-via-a-slack-with-serverless-in-lolo-b99509ffbca and here https://medium.com/aws-tip/creating-a-question-answer-conversation-with-a-gpt-3-openai-bot-in-a-slack-channel-via-serverless-48a572abd124 - lot easier to customize and simpler to set up.

oblique cosmos
#

@quiet crane is still working? last days i been using and worked very well but today i tried and nothing happened.. i checked log and no error message, nothing happen. tried stop and run and same result..

#

i didnt change anything though.. just realized this is giving me bad request

quiet crane
fossil cradle
#

Hello @quiet crane .. I'm also facing the Bad request issue, tried your solution with no luck. any fixes yet?

charred vectorBOT
#

@quiet crane

You have been warned and muted by AutoMod.
errant lion
errant lion
quiet crane
quiet crane
quiet crane
quiet crane
#

We've improved the logs, so save your app again and then run it. You should be able to get more info from your error messages.

carmine wedge
#

this is amazing tutorial, thanks for making it, but the link for Discord in the article is expired

quiet crane
hollow igloo
#

hi! first of all, I want to say thank you! this bot works wonderful!

Now I'm thinking of adding dall-e support on this as well (seeing that at lolo, there is a dall-e support as well). Is there any way to do that in one business number? Or should I create two numbers? One for davinci, and one for dall-e?

hollow igloo
#

or, is it possible that the lolo console recognize some words entry (for ex. "/dalle") in front of a message, and when that happens, it resorts to sending the input to dall-e API instead of davinci (and resend it back to us via whatsapp)?

quiet crane
# hollow igloo or, is it possible that the lolo console recognize some words entry (for ex. "/d...

Yeah of course, you just need to set up an if statement in between the incoming message and then route the message by recognizing if the text is asking for an image or if it is a standard completion request. Create a new function and then use the event object in that function to decide where to route data. In the example screen I haven’t added DALLE yet but you can simply add it and route it just like you are doing with the OpenAI Completions node. Just remember that DALLE give you a slightly different output, I.e. an url ({event.response.data.data[0].url}).

solemn rover
#

why my bot acting weird?

quiet crane
# solemn rover why my bot acting weird?

Wow that looks really bad. Can you send me your logs? Also please de-tick the Store Prompt History in the OpenAI function for now. Test it again after you've saved and deployed again to see if that fixes it. Not sure if it is that causing issues with the Store Prompt History, if you change the topic it can have a hard time interpreting a new question with a new topic as that option is sending on your previous questions and answers within the prompt itself.

quiet crane
# solemn rover why my bot acting weird?

If it is a problem with the WhatsApp trigger going off multiple times which can happen if you've erased messages then join us in our Discord and I'll connect you to Jesper who built the trigger who can help you figure it out.

hollow igloo
hollow igloo
#

@quiet crane , turns out, not a code programmer I am, I still unable to connect things.. hahaha... I tried applicating the things you put on the "serverless slack to generate Dall-E" (which I tried and succeed) to the whatsapp side using if, but it doesn't work.

If possible, (and when you have time as well, of course) could you make a guide regarding combining davinci text and dall-e in one loloco app?

Or, if anyone here already made it, could you share what code I have to type on?

And before I forgot, I really appreciate the tutorial you make, since it really helped us who have almost zero experience in coding like this 👍

hollow igloo
#

@quiet crane , finally I am succeed in generating dalle images, but I can only send it as a text link (as shown in pic). Well, if I click the image, it is showing the image, but is there any way to send the image instead of a hyperlink? what command should I put in here? (since changing "text" to "image" doesn't work)

quiet crane
hollow igloo
#

@quiet crane

#

If I click the image, it will show the image generated by dalle

#

But is there any way so the object sent is image instead of a hyperlink to the image as shown above?

quiet crane
quiet crane
# hollow igloo <@1028976285705322526>

Looks like the function we've built doesn't support this at the moment. Jesper the guy who build the WhatsApp trigger just let me know. I'll get back to you if we manage to fix this or have a workaround.

solemn rover
#

anyway, can we make it respond reply massage?

hollow igloo
inland rivet
#

Hi, how can get this Whatsapp bot?

hollow igloo
hollow igloo
#

btw, @quiet crane , is it possible to share the test business number to other person? Or is it connected only to the "registered" number that is put on FB Business? Since I encounter "AxiosError" when other number try to send a message there (I share the FB test number to one of my family to test as well).

If I check the log, it shows that the data is processed, but giving error response when trying to send the OPENAI response back via whatsapp to other number.

quiet crane
hollow igloo
desert glade
#

Is there a guide to getting this on my whatsapp?

quiet crane
golden gate
#

it is giving me this error

quiet crane
# golden gate it is giving me this error

Yes we just found out this one is giving auth errors. Engineer is back tomorrow to check it out EU time. Might have been changes to the Meta docs. Will let you know once this is sorted.

stuck mortar
#

Soon chatgpt api will be released so im expecting great things from this

crisp hill
hollow igloo
#

@quiet crane , just a heads up, suddenly the dall-e extension doesn't work. It stuck on the process generate with the message said { error: [Object] }

the davinci one still works on me.

quiet crane
hollow igloo
#

wait a sec

#

1/18/2023, 4:51:30 PM INFO Generate { error: [Object] }

1/18/2023, 4:51:30 PM INFO Generate calling OpenAI with: {
prompt: '/dalle a brand new ipad in 3d rendering, highly detailed, white, clear, crisp image, high quality, highly detailed'
}

1/18/2023, 4:51:30 PM INFO Option generate image

#

eh, wait, i tried another prompt and it shows

#

weird

#

but if I input the same prompt, it went error

#

could you try this prompt @quiet crane ?

/dalle a brand new ipad in 3d rendering, highly detailed, white, clear, crisp image, high quality, highly detailed

quiet crane
hollow igloo
#

ah, I see... perhaps just a kind of bug I think then

#

thank you for the fast response!

quiet crane
hollow igloo
#

yeah, it only went error if I put some prompt, while for other it works

#

perhaps some prompts somehow triggered a false flag

quiet crane
quiet crane
hollow igloo
#

WOAH, niceee

hollow igloo
#

ok, just tried it and it works!! Thanks @quiet crane

vestal spire
#

@quiet crane does the Lolo App capture any conversation? I am very new to this, so trying to get a grip

quiet crane
vestal spire
#

Say if I make my own bot using the above information, and start chatting with the bot, will that chat be captured?

hollow igloo
#

Do you mean "capture" as in logged by the system?

#

Or do you mean "capture" as, the bot able to "capture" information you provide in the message and messages before that?

vestal spire
#

Logged

#

Say if I ask, Who will be going to Mars first ? Will that conversation be logged

quiet crane
hollow igloo
vestal spire
#

Ah yes it’s OpenAI which will respond

#

Thanks

hollow igloo
#

@quiet crane , is there any way to add negative prompts to the dalle input?

quiet crane
hollow igloo
# quiet crane If the API supports it, it should work. It's just making an API call to the imag...

also, I encountered a lot of these errors:

s Error: Request failed with status code 400
at createError (/usr/src/node_modules/openai/node_modules/axios/lib/core/createError.js:16:15)
at settle (/usr/src/node_modules/openai/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/usr/src/node_modules/openai/node_modules/axios/lib/adapters/http.js:322:11)
at IncomingMessage.emit (events.js:412:35)
at endReadableNT (internal/streams/readable.js:1333:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
config: [Object],
request: [ClientRequest],
response: [Object],
isAxiosError: true,
toJSON: [Function: toJSON]
}

what causes it?
Is there any way to re-prompt the last message when we encounter this error? Code suggestion?

quiet crane
quiet crane
# hollow igloo also, I encountered a lot of these errors: s Error: Request failed with stat...

We've identified a bit of an issue with longer prompts/and prompts with spaces and special characters in the OpenAI library function. We'll figure it out for the library function after the weekend but until then if you want to create a new function and parse in this code:

`const { Configuration, OpenAIApi } = require("openai");

// The export handler will run every time the event is triggered
exports.handler = async(ev, ctx) => {
const { route, log } = ctx;

// good practice to use variables via ctx.env but this is just a demo
const configuration = new Configuration({
apiKey: 'APIKEYHERE',
});
const openai = new OpenAIApi(configuration);

try {
const response = await openai.createCompletion({
model: "text-davinci-003",
prompt: ev.message + "\n",
temperature: 0.7,
max_tokens: 256,
top_p: 1,
frequency_penalty: 0,
presence_penalty: 0,
});
ev.response = response;
route(ev)
} catch (err) {
log.info(err)
}

};`

Use it instead of the OpenAI Library Function for now and set your settings within the code. Remember to add openai under modules within the app's settings. See if this is a temporary fix.

opal quarry
#

i am getting this error can someone help me

quiet crane
# opal quarry i am getting this error can someone help me

👋 are all of your request like this? Try to insert the meta token again and make sure there are no white spaces. Also make sure you have the phone number id correctly inserted. We have a discord channel where the engineer that built this one should be able to help you out directly. You should see a link within the console to the left.

solemn rover
#

why sometimes bot doesn't respond the command so i need to type it twice so he understand/respond the command?

quiet crane
hollow igloo
#

Dang, I literally got so busy last week I haven't had time to open discord... Thanks for the heads up, gonna try it in several days since job is still piling up.

fresh zinc
#

dannggg nice project right here

timber meteor
#

.

solemn rover
quiet crane
quiet crane
quiet crane
quiet crane
hollow igloo
#

So many updates and I have still no time to check D:

solemn rover
hollow igloo
#

btw, just want to gave this post with a bump since this still runs pretty good 👍

silk ingot
#

Hi

vestal spire
#

@quiet crane is there any way we can user our own number instead of Meta Test?

hollow igloo
#

Also, how to implement the gpt 3.5 turbo api? When I change from text-davinci-003 to turbo 3.5, the input returns error

hollow igloo
hollow igloo
#

hopefully @quiet crane can help 👍

timber meteor
#

An architectural design for a smart, sustainable, vertical, carbon-free city that has renewable energy resources and encourages people to walk, exercise, and use electric cars in it instead of fuel cars, and it contains large green spaces

vestal spire
#

Meta disabled my business account

#

as I dont have any business....

#

any ideas how to keep it going?

dim tangle
#

how create twilio api key

hollow igloo
little saffron
#

Hi

hollow igloo
#

hello as well @little saffron

#

really waiting for @quiet crane to help out fixing openai's GPT 3.5 turbo end point

hollow igloo
#

Is the development still active?

#

@quiet crane

tropic iris
hollow igloo
#

@tropic iris nice!

#

is this unlimited or no? I'm actually using this loloco because I do quite a lot of text prompting

hollow igloo
#

Oh, turns out the max_token set is quite low. understandable though due to the nature of this free app

#

thanks a lot though

eternal rivet
#

Wouldn't you get banned on wsp?

hollow igloo
#

Been using that since quite a long time, no issue at all

#

Do you use proper API key?

tropic iris
tropic iris
hollow igloo
hollow igloo
#

The sad thing is, I don't know how to configure Loloco to make it compatible with gpt 3.5 turbo

vestal spire
#

@tropic iris how did you manage to keep whatsapp number active, mine got disabled due to needing to do business verification