PHP code example of sistemas-eel / agente-ia-client
1. Go to this page and download the library: Download sistemas-eel/agente-ia-client 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/ */
sistemas-eel / agente-ia-client example snippets
use SistemasEel\AgenteIaClient\Agente\TokenValidator;
$validator = new TokenValidator([
'introspection_endpoint' => getenv('AGENTE_INTROSPECTION_ENDPOINT'), // URL que confirma se o token recebido é válido e ativo
'client_id' => getenv('AGENTE_CLIENT_ID'),
'client_secret' => getenv('AGENTE_CLIENT_SECRET'),
'
use App\Http\Controllers\Agente\ConsultarDocumentosController;
use App\Http\Controllers\Agente\CriarSolicitacaoController;
use Illuminate\Support\Facades\Route;
Route::post('/agente/documentos/consultar', ConsultarDocumentosController::class);
Route::post('/agente/solicitacoes/criar', CriarSolicitacaoController::class);
use App\Agente\ConsultarDocumentosHandler;
use Illuminate\Http\Request;
use SistemasEel\AgenteIaClient\Agente\Laravel\LaravelAgenteEndpoint;
class ConsultarDocumentosController
{
public function __invoke(
Request $request,
LaravelAgenteEndpoint $endpoint,
ConsultarDocumentosHandler $handler
) {
return $endpoint->handle($request, $handler, [
['chave' => 'termo', 'tipo' => 'string', 'obrigatorio' => false],
['chave' => 'limite', 'tipo' => 'integer', 'obrigatorio' => false],
], 'consultar');
}
}