Skip to content
Back

Prompt ChatGPT Function Not Working

  • 0
  • Web
  • Cloud
Aditya Oberai
19 Oct, 2023, 17:41

Are you facing this with any other function as well? (the stuck processing)

TL;DR
User is reporting that the Prompt ChatGPT function is not working. They have followed the provided documentation and checked environment variables, but the bot is not coming online. The user is advised to update the function and add an additional error log. They are also asked to check if necessary headers are being sent in the POST request. The user has checked the build logs and executions tab, but there are no logs or errors. When accessing the deployment link, they receive an "Invalid request signature" error. The user is asked if there are any failures in the error logs of the discord bot function. They are also advised to try importing the prompt
Aditya Oberai
19 Oct, 2023, 17:42

Can we, in the meantime, try one thing and use the same generated GitHub repo to create another function?

Skidee
19 Oct, 2023, 17:42

yes i made another project using discord bot function template, i added proper env values but it didnt worked

Skidee
19 Oct, 2023, 17:43

the discord bot one went through, it says its deployed but my bot is not coming online

Aditya Oberai
19 Oct, 2023, 17:43

I mean the prompt chatgpt repo

Can you try and import that as a function rather than going through templates?

Skidee
19 Oct, 2023, 17:44

oh ok imma go try do that

Aditya Oberai
19 Oct, 2023, 17:44

Are you getting any failures in the error logs of the discord bot function?

Skidee
19 Oct, 2023, 17:45

but idk why its just happening to me like during yesterdays workshop, i was following along. your project was deployed and was up and running perfectly

Skidee
19 Oct, 2023, 17:47

it says build finished but when i open the deployment link, it says {"error":"Invalid request signature"}

Aditya Oberai
19 Oct, 2023, 17:48

Instead of the build logs, let's go to the Executions tab once. We should have logs there for each execution of the function.

Skidee
19 Oct, 2023, 17:49
Skidee
19 Oct, 2023, 17:51

and on the executions tab of chat gpt app, logs and errors are empty

Aditya Oberai
19 Oct, 2023, 17:54

@Skidee are you sending in the necessary headers as well in your POST request here?

https://github.com/appwrite/templates/tree/main/node/discord-command-bot

Aditya Oberai
19 Oct, 2023, 17:54

Does the Errors tab show a log?

Skidee
19 Oct, 2023, 17:54

nope

Skidee
19 Oct, 2023, 17:54

oh let me see

Aditya Oberai
19 Oct, 2023, 17:55

Wait with the newly generated function, did you add both the Environment Variables?

Skidee
19 Oct, 2023, 18:03

yes i rechecked the environment variables i even generated a new token then replaced it with old one just too see if it work by doing that but the bot didnt came online

Skidee
19 Oct, 2023, 18:04

also just tried redoplying the chat gpt project once more it still giving this alert

Aditya Oberai
19 Oct, 2023, 18:06

I'm afraid I'm a bit stumped there

Are you okay updating your function? We can add an additional error log there once in the catch block to get a more specific error message

Skidee
19 Oct, 2023, 18:07

yea sure

Skidee
19 Oct, 2023, 18:10

@Aditya Oberai you got the api key from this page right? or am i using the wrong key

Aditya Oberai
19 Oct, 2023, 18:11

Yes, that's right

Skidee
19 Oct, 2023, 19:32

i did this but not the getting logs

Aditya Oberai
20 Oct, 2023, 07:42

console.log would not work directly like that

We have a dedicated logging function for this purpose

Here you can see https://appwrite.io/docs/products/functions/development

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more