PHP code example of serhiilabs / inscribe

1. Go to this page and download the library: Download serhiilabs/inscribe library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

serhiilabs / inscribe example snippets


$prompt = "You are a helpful assistant.\n\n";
$prompt .= "Context: The user is asking about {$topic}.\n\n";
$prompt .= "User question: {$question}\n\n";
$prompt .= "Please provide a detailed answer.";

use SerhiiLabs\Inscribe\Facades\Inscribe;

$prompt = Inscribe::make()
    ->context(['topic' => 'Laravel'])
    ->i.instruction')
    ->build();

use SerhiiLabs\Inscribe\Contracts\TemplateBuilderInterface;

class EmailService
{
    public function __construct(
        private TemplateBuilderInterface $templates,
    ) {}

    public function buildEmail(string $name): string
    {
        return $this->templates->make()
            ->context(['sender' => 'Support Team'])
            ->

$text = Inscribe::make()
    ->context(['name' => 'John', 'company' => 'Acme'])
    ->

$text = Inscribe::make()
    ->ame' => 'Support Team'])
    ->build();

$text = Inscribe::make()
    ->context(['name' => 'Guest', 'date' => 'today'])
    ->lude('farewell', ['date' => 'tomorrow']) // name=Guest, date=tomorrow
    ->build();

$text = Inscribe::make()
    ->te' => 'Thanks for reading!'])
    ->

// Double newline between paragraphs
$text = Inscribe::make()
    ->separator("\n\n")
    ->oncatenation)
$text = Inscribe::make()
    ->separator('')
    ->

use SerhiiLabs\Inscribe\Facades\Inscribe;

$text = Inscribe::make()
    ->
bash
php artisan vendor:publish --tag=inscribe-config
bash
php artisan inscribe:validate