PHP code example of asmpkg / guiche

1. Go to this page and download the library: Download asmpkg/guiche 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/ */

    

asmpkg / guiche example snippets


$guiche->bindIdentity(
    $sessionId,
    [
        'provider' => 'custom-crm',
        'account_id' => $accountId,
        'conversation_id' => $conversationId,
    ]
);

$response = $guiche->handle(
    $sessionId,
    $message
);

$factory = $factory();

$builder->registerTool(new MinhaTool());
$builder->registerPlugin(new MeuPlugin());

$builder
    ->loadTools('InformacoesEmpresa', 'ConsultarPedido')
    ->loadPlugins('Clinica');

$builder
    ->setService(MinhaConexao::class, $conexao)
    ->loadTool('InformacoesEmpresa');

$guiche = $factory([
    'services' => [
        MinhaConexao::class => $conexao,
    ],
    'tools' => [
        'InformacoesEmpresa',
        $toolLegada,
    ],
    'plugins' => [
        'Clinica',
        $pluginLegado,
    ],
]);
text
.env
guiche.prompt.md                 # compatibilidade
guiche.php                       # Composition Root
prompts/
└── comportamento.md             # prompt global
src/
├── Tool/
└── Plugin/
storage/
└── conversations/
bash
composer dump-autoload
bash
cp examples/clinica-piloto/.env.example examples/clinica-piloto/.env
php examples/clinica-piloto/fake-smoke.php