<?php
require 'examples/boot.php';
require_once dirname(__DIR__).'/Support.php';
use Cognesy\Tell\Tell;
use Cognesy\Tell\TellRequest;
$project = TellHarnessExample::project();
try {
$result = Tell::open($project)->run(
TellRequest::prompt('In one sentence, explain why stateless jobs are useful.'),
);
echo "=== Tell Result ===\n";
echo 'Completed: '.($result->isCompleted() ? 'yes' : 'no')."\n";
echo 'Durable: '.($result->isDurable() ? 'yes' : 'no')."\n";
echo 'Response: '.$result->text()."\n";
assert($result->isCompleted(), 'Expected a completed Tell result.');
assert(
! $result->isDurable(),
'Stateless Tell execution must not publish history.',
);
assert(
! is_dir($project.'/.tell'),
'Stateless Tell execution must not create a workspace.',
);
} finally {
TellHarnessExample::remove($project);
}