Update 'index.js'
This commit is contained in:
parent
a40e8add20
commit
fb24781180
1 changed files with 2 additions and 2 deletions
4
index.js
4
index.js
|
@ -2,7 +2,6 @@ import readline from 'readline';
|
||||||
import Ollama from 'ollama-js-client';
|
import Ollama from 'ollama-js-client';
|
||||||
import spawn from 'child_process';
|
import spawn from 'child_process';
|
||||||
|
|
||||||
let generation = 1;
|
|
||||||
let potentialAnswers = [];
|
let potentialAnswers = [];
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,6 +61,7 @@ function getLangID() {
|
||||||
let answer = await instance.prompt(`${problem} - This must be coded in pure ${getLangID()}, no external libraries or requirements. Please provide the code, the full code, and nothing but the code. No chit-chat, no markdown, just code.`);
|
let answer = await instance.prompt(`${problem} - This must be coded in pure ${getLangID()}, no external libraries or requirements. Please provide the code, the full code, and nothing but the code. No chit-chat, no markdown, just code.`);
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
let generation = 1;
|
||||||
let answerParsed = ""
|
let answerParsed = ""
|
||||||
let problemSolved = false;
|
let problemSolved = false;
|
||||||
while (problemSolved == false) {
|
while (problemSolved == false) {
|
||||||
|
@ -71,7 +71,7 @@ async function main() {
|
||||||
langExec(answerParsed);
|
langExec(answerParsed);
|
||||||
problemSolved = true;
|
problemSolved = true;
|
||||||
generation = generation + 1;
|
generation = generation + 1;
|
||||||
console.log(answerParsed)
|
console.log(answer.response)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
answer = await instance.prompt(`There was an error: ${error.message}. Please only provide the code, the full code, and nothing but the code. No chit-chat, no markdown, just code. Also, make sure it's written in ${getLangID()} without any libraries besides included.`)
|
answer = await instance.prompt(`There was an error: ${error.message}. Please only provide the code, the full code, and nothing but the code. No chit-chat, no markdown, just code. Also, make sure it's written in ${getLangID()} without any libraries besides included.`)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue