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