<?php
require 'examples/boot.php';
use Cognesy\Agents\Builder\AgentBuilder;
use Cognesy\Agents\Capability\Describe\UseSelfDescription;
use Cognesy\Agents\Capability\Prompt\UseSystemPrompt;
use Cognesy\Agents\Profile\AgentIdentity;
$agent = AgentBuilder::base()
->withIdentity(new AgentIdentity(
name: 'release_assistant',
description: 'Reviews release changes and reports what it can do.',
))
->withCapability(new UseSystemPrompt())
->withCapability(new UseSelfDescription())
->build();
$description = $agent->describe();
echo $description->toMarkdown(), "\n\n";
echo json_encode($description->toArray(), JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR), "\n";
assert(in_array(
'describe_self',
array_column($description->toArray()['tools'], 'name'),
true,
));
?>