Simple Api call to chatgpt

I have completed installing Open SaaS template and I start to play around with it. I found the AI Day Scheduler example quite difficult to me to understand. if it possible . if someone can create an example app that taking input from user ( as form , upload pdf ) and sending to chatgpt api to return the output of chatgpt that will display to user. i want to use the app within Open SaaS template to use " authintication as well I dont want to reinvent the weel
5 Replies
kapa.ai
kapa.ai3mo ago
Hi @Muhanned. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the knowledge sources provided, there isn't a direct example of an app that takes user input and sends it to the ChatGPT API within the OpenSaaS template. However, you can create this functionality by combining different parts of the OpenSaaS template and the Wasp framework. Here's a general guide on how you can achieve this: 1. User Input: You can create a form in React to take user input. This can be done in a new page or an existing page within the OpenSaaS template. You can refer to the DemoAppPage.tsx page in the OpenSaaS template for an example of how to create a form in React (source (https://discord.com/channels/686873244791210014/1222074172499431468)). 2. File Upload: If you want to allow users to upload PDF files, you'll need to create a file upload functionality. Unfortunately, the knowledge sources provided do not contain information on how to implement file upload in Wasp or the OpenSaaS template. 3. ChatGPT API Call: Once you have the user input, you can send it to the ChatGPT API. You can do this in the actions.ts file in the OpenSaaS template. There's an example of how to use the GPT API in the actions.ts file in the old version of the SaaS template (source (https://discord.com/channels/686873244791210014/1196842660938399744)). 4. Display Output: After getting the response from the ChatGPT API, you can display it to the user in your React app. This can be done in the same page where you created the form. 5. Authentication: The OpenSaaS template comes with authentication functionality. You can use this to ensure that only authenticated users can use your app. You can refer to the OpenSaaS template for more details on how to use the authentication functionality (source (https://wasp-lang.dev/docs/project/starter-templates#available-templates)). Please note that this is a high-level guide and you'll need to write the actual code to implement these functionalities. If you're not familiar with React, Node.js, or Wasp, you might find it challenging. You might want to learn more about these technologies before attempting to create this app. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Muhanned, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
miho
miho2mo ago
Pls take a look at Wasp's tutorial first to better understand Wasp and then the Open SaaS template will be easier to get: https://wasp-lang.dev/docs/tutorial/create
1. Creating a New Project | Wasp
You'll need to have the latest version of Wasp installed locally to follow this tutorial. If you haven't installed it yet, check out the QuickStart guide!
Muhanned
Muhanned2mo ago
I did. new migration kind make me lost. I appreciate if you could republish https://github.com/wasp-lang/SaaS-Template-GPT with new migration
GitHub
GitHub - wasp-lang/SaaS-Template-GPT
Contribute to wasp-lang/SaaS-Template-GPT development by creating an account on GitHub.
miho
miho2mo ago
@Vinny (@Wasp) one for you
Vinny (@Wasp)
Vinny (@Wasp)2mo ago
this is our old template which we no longer use. it's now deprecated. What are you having trouble with in the Tutorial?
Want results from more Discord servers?
Add your server