Repository navigation
2.1.0
Allows StructuredPrompt in system / developer prompts. Eg.
$prompt = new ElliotJReed\AI\Claude\Prompt('API KEY', 'claude-3-5-haiku-latest');
$request = (new ElliotJReed\AI\Entity\Request())
->setSystemPrompt('You are responding to customer queries from a web form.')
->setSystemPrompt((new ElliotJReed\AI\Entity\StructuredPrompt())
->setContext('The customer is querying via a form on a e-commerce website based in the United Kingdom.')
->setInstructions('Respond using the data from the FAQs in a friendly and accurate way using British English.')
->setData('FAQs. Q: Do you offer next day deliver. A: Yes we do, however we do not offer same day delivery.')
->setExamples(['Hello! Unfortunately we are not open on Bank Holidays.']))
->setTextPrompt((new ElliotJReed\AI\Entity\StructuredPrompt())
->setContext('The current date and time is: ' . (new DateTime())->format('Y-m-d H:i:s'))
->setUserInput('Can you deliver today at my address?'))
->setMaximumTokens(300);
$response = $prompt->send($request);