neoban/backend/app/Ai/Agents/CreativeDirectorAgent.php

51 lines
1.2 KiB
PHP

<?php
namespace App\Ai\Agents;
use Laravel\Ai\Attributes\Provider;
use Laravel\Ai\Contracts\Agent;
use Laravel\Ai\Contracts\Conversational;
use Laravel\Ai\Contracts\HasTools;
use Laravel\Ai\Contracts\Tool;
use Laravel\Ai\Enums\Lab;
use Laravel\Ai\Messages\Message;
use Laravel\Ai\Promptable;
use Stringable;
#[Provider(Lab::Groq)]
class CreativeDirectorAgent implements Agent, Conversational, HasTools
{
use Promptable;
/**
* Get the instructions that the agent should follow.
*/
public function instructions(): Stringable|string
{
return 'You are a creative director. Read the following social media post and '.
'write a single, vivid, descriptive image prompt (max 30 words) for an '.
'AI image generator. The scene must be visually compelling and directly '.
"relevant to the post's topic. Return ONLY the image prompt — nothing else.";
}
/**
* Get the list of messages comprising the conversation so far.
*
* @return Message[]
*/
public function messages(): iterable
{
return [];
}
/**
* Get the tools available to the agent.
*
* @return Tool[]
*/
public function tools(): iterable
{
return [];
}
}