Video Submission: https://youtu.be/3H2ICCtP1Ew
- Clone this repository and
cd
into the project folder
git clone https://github.com/rchang0501/open-ai-climate-hack.git
cd open-ai-climate-hack
cd
into the frontend folder and install node modules
cd frontend
npm i
- Start the React app in the frontend folder
npm start
config:
const prompt = `${codeInput}\n\ntranslate the above ${inputType} code to ${outputLanguage} code.`;
const res = await openai.createCompletion({
model: "text-davinci-002",
prompt: prompt,
temperature: 0,
max_tokens: 500,
});
- Simple if-else statement Python code with Text Davinci
simpleIfElseGood.mov
- HVAC controller Python code with Text Davinci
set-hvac-mode-good.mov
*note: translation worked fine but the IF, ELSE statement captilization convention is not preserved. Syntactically is valid though since ST isn't case sensitive.
config:
const prompt = `${codeInput}\n\ntranslate the above ${inputType} code to ${outputLanguage} code`;
const res = await openai.createCompletion({
model: "code-davinci-002",
prompt: prompt,
temperature: 0,
max_tokens: 115,
});
- Simple LeetCode Problem using Code Davinci