<?php
use Mindee\Client;
use Mindee\Product\Generated\GeneratedV1;
use Mindee\Input\PredictMethodOptions;
// Init a new client
$mindeeClient = new Client("my-api-key");
// Load a file from disk
$inputSource = $mindeeClient->sourceFromPath("/path/to/the/file.ext");
// Create a custom endpoint
$customEndpoint = $mindeeClient->createEndpoint(
"my-endpoint",
"my-account",
"my-version"
);
// Add the custom endpoint to the prediction options.
$predictOptions = new PredictMethodOptions();
$predictOptions->setEndpoint($customEndpoint);
// Parse the file
$apiResponse = $mindeeClient->parse(GeneratedV1::class, $inputSource, $predictOptions);
echo strval($apiResponse->document);
|