This commit is contained in:
wameup
2026-03-16 08:08:29 +00:00
parent 7a191d4e2a
commit 1cf29be651
8 changed files with 129 additions and 12 deletions

View File

@@ -19,7 +19,6 @@ const sleep = ms => new Promise((resolve, reject) => setTimeout(resolve, ms))
async function main (
prompt: string = 'Show a welcome message on screen. After the task is complete, ask the user to confirm before ending the program, or ask user for more tasks to perform on the website.',
max_steps: number = 10,
model: string = 'gpt-5.2'
) {
const client = new OpenAI({
@@ -73,7 +72,7 @@ async function main (
content: prompt
})
for (let i = 0; i < max_steps; i++) {
while(true) {
console.log(`\n=== ROUND ${i + 1} ===\n`)
//await sleep(1000) // pause between rounds for readability
const resp = await client.responses.create({
@@ -153,7 +152,7 @@ JavaScript to execute. Write small snippets of interactive code. To persist vari
console.log('response output item =', item)
if (item.type == 'shell_call') {
console.log('shell call item =', item)
let shell_call_output = []
let shell_call_output: { stdout: string; stderr: string; outcome: { type: string; exit_code: number } }[] = [];
item.action.commands.forEach(command => {
console.log('$', command, '\n')