Difficulty
intermediate
Average duration
4 hrs
Technologies
Javascript
React.js
Generative AI
prompt-engineer
Difficulty
intermediate
Average duration
4 hrs
Technologies
Javascript
React.js
Generative AI
prompt-engineer
Do not clone this repository because we will be using a different template.
We recommend opening the react template
using a provisioning tool like Codespaces (recommended) or Gitpod. Alternatively, you can clone the GitHub repository on your local computer using the git clone
command.
This is the repository you need to open or clone:
https://github.com/4GeeksAcademy/react-hello
⚠ You will need to have Node.js installed if you do it locally, but all of that is already installed on Codespaces or Gitpod!
Example:
1const handleGenerateIdeas = async (topic) => { 2 const prompt = `Provide me with three project ideas in the field of ${topic}.`; 3 4 try { 5 const response = await fetch('https://api.openai.com/v1/engines/text-davinci-003/completions', { 6 method: 'POST', 7 headers: { 8 'Authorization': `Bearer YOUR_OPENAI_API_KEY`, 9 'Content-Type': 'application/json', 10 }, 11 body: JSON.stringify({ 12 prompt: prompt, 13 max_tokens: 150, 14 n: 1, 15 stop: null, 16 temperature: 0.7, 17 }), 18 }); 19 20 const data = await response.json(); 21 const generatedText = data.choices[0].text.trim(); 22 const ideaList = generatedText.split('\n').filter(idea => idea.trim() !== ''); 23 } catch (error) { 24 console.error('Error generating ideas:', error); 25 } 26};
Note: Remember to replace
'YOUR_OPENAI_API_KEY'
with your actual OpenAI API key.
Explore different enhancements to make your Project Ideas Generator more interactive and user-friendly!
Difficulty
intermediate
Average duration
4 hrs
Technologies
Javascript
React.js
Generative AI
prompt-engineer
Difficulty
intermediate
Average duration
4 hrs
Technologies
Javascript
React.js
Generative AI
prompt-engineer
Difficulty
intermediate
Average duration
4 hrs
Technologies
Javascript
React.js
Generative AI
prompt-engineer
Difficulty
intermediate
Average duration
4 hrs
Technologies
Javascript
React.js
Generative AI
prompt-engineer
Difficulty
intermediate
Average duration
4 hrs
Technologies
Javascript
React.js
Generative AI
prompt-engineer
Difficulty
intermediate
Average duration
4 hrs
Technologies
Javascript
React.js
Generative AI
prompt-engineer
In order to prepare better for completing this exercises, we suggest the following materials