*/
\ No newline at end of file
diff --git a/src/Components/BasicQuestions.tsx b/src/Components/BasicQuestions.tsx
new file mode 100644
index 000000000..fa7c3ee90
--- /dev/null
+++ b/src/Components/BasicQuestions.tsx
@@ -0,0 +1,606 @@
+import React, { useState } from 'react';
+import '../App.css';
+import { Button, Col, Container, Form, Row} from 'react-bootstrap';
+//import { Link } from 'react-router-dom';
+import { BasicExample } from '../progressBar';
+import { useNavigate } from 'react-router-dom';
+//import OpenAI from 'openai';
+import GIF from './gif.gif';
+import olivia from './logo-removebg-preview.png'
+import sunrise from './lavender.png'
+// function App(){
+// return There is actually something here
+// }
+//local storage and API Key: key should be entered in by the user and will be stored in local storage (NOT session storage)
+let keyData = "";
+
+const saveKeyData = "MYKEY";
+const prevKey = localStorage.getItem(saveKeyData); //so it'll look like: MYKEY: in the local storage when you inspect
+if (prevKey !== null) {
+ keyData = JSON.parse(prevKey);
+}
+
+function BasicQuestions() {
+ const [key, setKey] = useState(keyData); //for api key input
+ const [progress, setProgress] = useState(0)
+
+ const [finished, setFinished] = useState (false);
+
+ const [choice1, setChoice1] = useState("Select an option");
+ const [choice2, setChoice2] = useState("Select an option");
+ const [choice3, setChoice3] = useState("Select an option");
+ const [choice4, setChoice4] = useState("Select an option");
+ const [choice5, setChoice5] = useState("Select an option");
+ const [choice6, setChoice6] = useState("Select an option");
+ const [choice7, setChoice7] = useState("Select an option");
+
+ //sets the local storage item to the api key the user inputed
+ function handleSubmit() {
+ localStorage.setItem(saveKeyData, JSON.stringify(key));
+ window.location.reload(); //when making a mistake and changing the key again, I found that I have to reload the whole site before openai refreshes what it has stores for the local storage variable
+ }
+
+ //function handleIncrease() {
+ // setProgress(progress + 20);
+ //}
+ function updateProgress(originalValue: string, event: string){
+ if (originalValue === "Select an option" && event !== "Select an option") {
+ setProgress(progress + 15)
+ }
+ else if (originalValue !== "Select an option" && event === "Select an option") {
+ setProgress(progress - 15)
+ }
+ }
+
+ //HEADER FUNCTIONS
+ const navigate = useNavigate();
+
+ const goToHome = () => {
+ // This will navigate to first component
+ navigate('/Home');
+ };
+
+ const goToAbout = () => {
+
+ // This will navigate to second component
+ navigate('/About');
+ };
+ const goToSurvey = () => {
+
+ // This will navigate to second component
+ navigate('/Survey');
+ };
+
+ // function to handle get career choices button
+ //Validation Check #1: Make sure the user submits an API Key
+
+ function handleGetCareerChoices() {
+ if (key === "") {
+ alert("Please submit an API Key!");
+ }
+ else {
+ callOpenAIAPI();
+ }
+ }
+
+ //Gpt Integration:
+ /*const [response, setResponse] = useState(""); // Response from GPT*/
+
+ // send message to GPT function
+
+ const API_KEY = key;
+
+ //const openai = new OpenAI(
+ //{apiKey: API_KEY, dangerouslyAllowBrowser: true}
+ //);
+ // JSON Data storing 3 Different Career Options
+ const [career1Title, setCareer1Title] = useState(""); // Response from GPT
+ const [career2Title, setCareer2Title] = useState(""); // Response from GPT
+ const [career3Title, setCareer3Title] = useState(""); // Response from GPT
+
+ const [career1, setCareer1] = useState(""); // Response from GPT
+ const [career2, setCareer2] = useState(""); // Response from GPT
+ const [career3, setCareer3] = useState(""); // Response from GPT
+
+
+
+ let gptData = {
+ 'name': "gptData",
+ 'description': "data to be passed to gpt",
+ 'parameters': {
+ 'type': 'object',
+ 'properties': {
+ "CareerChoice1Title": {
+ "type": "string",
+ "description": "The title of your first career suggestion"
+ },
+ "CareerChoice1": {
+ "type": "string",
+ "description": "A description of a career that would be a good fit for the user based on their responses to the questions. Do not list the title here."
+ },
+ "CareerChoice2Title": {
+ "type": "string",
+ "description": "The title of your second career suggestion"
+ },
+ "CareerChoice2": {
+ "type": "string",
+ "description": "A description of a career that would be a good fit for the user based on their responses to the questions. Do not list the title here."
+ },
+ "CareerChoice3Title": {
+ "type": "string",
+ "description": "The title of your third career suggestion"
+ },
+ "CareerChoice3": {
+ "type": "string",
+ "description": "A description of a career that would be a good fit for the user based on their responses to the questions. Do not list the title here."
+ }
+ },
+ 'required': ['CareerChoice1Title', 'CareerChoice1', 'CareerChoice2', 'CareerChoice3']
+ }
+}
+
+ async function callOpenAIAPI() {
+
+ setFinished(true);
+ //const response = await getResponse(input);
+ await fetch('https://api.openai.com/v1/chat/completions', {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ "Authorization": "Bearer " + API_KEY,
+
+ },
+
+ body: JSON.stringify({
+ "model": 'gpt-4-turbo',
+ "tools": [{"type": "function", "function": gptData}],
+ "messages": [{
+ "role": "system",
+ "content": "You are an assistant that give career advise like a specialist"},
+ {"role": "user",
+ "content": "Give a list of 3 potential career options based on the users responses to these questions. The title of the career in the CareerXTitle field must match the description of the career given. The questions and user's responses are listed below:" +
+
+ `Which work environment aligns best with your interests?: ${choice1}` +
+ `Which personality traits do you resonate with the most?: ${choice2}` +
+ `Which of the following is true about you?: ${choice3}` +
+ `Which career-related activities do you find most fulfilling?: ${choice4}` +
+ `Which challenges are you eager to take on?: ${choice5}` +
+ `What would you do on a weekend?: ${choice6}` +
+ `Which academic area do you prefer?: ${choice7}`
+
+
+ }],
+ "temperature": 0.7,
+
+ })
+ }).then(response => response.json())
+ .then(data => {
+ if (choice1&&choice2&&choice3&&choice4&&choice5&&choice6&&choice7 === "None of the above"){
+ console.log("answer a question please")
+ alert("answer one question please");
+ }
+ else{
+ console.log('Response:', data);
+ const obj = JSON.parse(data.choices[0].message.tool_calls[0].function.arguments.toString());
+ setCareer1Title(obj.CareerChoice1Title);
+ setCareer2Title(obj.CareerChoice2Title);
+ setCareer3Title(obj.CareerChoice3Title);
+ setCareer1(obj.CareerChoice1);
+ setCareer2(obj.CareerChoice2);
+ setCareer3(obj.CareerChoice3);
+ }
+
+
+ })
+ .catch(error => {
+ console.error('Error:', error);
+ if (key === "") {
+ alert("No API Key submitted. Please submit an API Key!");
+ }
+ else{
+ alert("Invalid API key submitted. Please submit a valid API Key!");
+ }
+ })
+};
+
+
+// code to test whether the api key validation checks are working or not
+// comment in and out as needed
+
+// if (career1 !== "") {
+// localStorage.clear();
+// }
+
+ //whenever there's a change it'll store the api key in a local state called key but it won't be set in the local storage until the user clicks the submit button
+ function changeKey(event: React.ChangeEvent) {
+ setKey(event.target.value);
+ }
+
+ function updateChoice1(event: React.ChangeEvent) {
+ updateProgress(choice1, event.target.value);
+ setChoice1(event.target.value);
+ }
+
+ function updateChoice2(event: React.ChangeEvent) {
+ updateProgress(choice2, event.target.value);
+ setChoice2(event.target.value);
+}
+function updateChoice3(event: React.ChangeEvent) {
+ updateProgress(choice3, event.target.value);
+ setChoice3(event.target.value);
+}
+function updateChoice4(event: React.ChangeEvent) {
+ updateProgress(choice4, event.target.value);
+ setChoice4(event.target.value);
+}
+function updateChoice5(event: React.ChangeEvent) {
+ updateProgress(choice5, event.target.value);
+ setChoice5(event.target.value);
+}
+function updateChoice6(event: React.ChangeEvent) {
+ updateProgress(choice6, event.target.value);
+ setChoice6(event.target.value);
+}
+function updateChoice7(event: React.ChangeEvent) {
+ updateProgress(choice7, event.target.value);
+ setChoice7(event.target.value);
+}
+
+/*const navigate = useNavigate();
+
+const goToHome = () => {
+ // This will navigate to first component
+ navigate('/Home');
+ };*/
+
+// function OurHeader(){
+// const navigate = useNavigate();
+
+// const goToHome = () => {
+// // This will navigate to first component
+// navigate('/Home');
+// };
+
+// const goToAbout = () => {
+
+// // This will navigate to second component
+// navigate('/About');
+// };
+// const goToSurvey = () => {
+
+// // This will navigate to second component
+// navigate('/Survey');
+// };
+
+
+// /*function OurHeader(){*/
+// return(
+//