#can you show an example of what you re
10 messages ยท Page 1 of 1 (latest)
import fs from 'fs'
import { Configuration, OpenAIApi } from "openai"
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
const inFile = process.argv[2]
console.log("Infile:" , inFile)
const content = fs.readFileSync(inFile)
async function convertByEdit(code) {
console.log(code)
const response = await openai.createEdit({
model: "code-davinci-edit-001",
instruction: `Convert from enzyme to react testing library\n javascript\n\n`,
input: `${code}`,
});
console.log("edit:", response.data.choices.length, response.data.choices[0].finish_reason)
fs.writeFileSync("/tmp/response.edit.wholefile.ai.json", response.data.choices[0].text)
return response.data
}
const promise2 = convertByEdit(content)
await Promise.resolve(promise2)
console.log("done!")
what does the enzyme thingy look like @coarse bough
sorry ๐
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
There you go.
What issue are you having? The code output appears to look okay with my attempt
Hmm, now it worked ๐ Yay!
@fierce trail thanks for helping me!
np!