<?php

use boru\boruai\Models\Response;

require __DIR__."/init.php";

$reference = "some_reference"; //used to continue a conversation.
$user = null; //user id (if any), to separate conversations with the same reference
$create = true; //create a new response if an existing one is not found

$response = Response::withReference($reference,$user,$create);
$response->model("gpt-4.1");
$response->instructions("You are a helpful assistant.");
$response->addMessage("Hello, how are you?");
$result = $response->create();

if($result) {
    echo $result->getResult()."\n";
    $response = $result;
} else {
    echo "No result\n";
    exit();
}

//continuing if you wish:

$response = $result;
$response->addMessage("Please review this file and tell me what you think");
$response->addFile("test.txt");
$result = $response->create();

if($result) {
    echo $result->getResult()."\n";
    $response = $result;
} else {
    echo "No result\n";
    exit();
}