PHP code example of halilcosdu / laravel-replicate
1. Go to this page and download the library: Download halilcosdu/laravel-replicate 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/ */
halilcosdu / laravel-replicate example snippets
return [
'api_token' => env('REPLICATE_API_TOKEN'),
'api_url' => env('REPLICATE_API_URL', 'https://api.replicate.com/v1'),
];
Replicate::account()
Replicate::getCollection(string $slug)
Replicate::listCollections()
Replicate::listDeployments()
Replicate::createDeployment(array $data)
Replicate::getDeployment(string $owner, string $name)
Replicate::updateDeployment(string $owner, string $name, array $data)
Replicate::listHardware()
Replicate::createModel(array $data)
Replicate::getModel(string $owner, string $name)
Replicate::getModelVersion(string $owner, string $name, string $version)
Replicate::listModelVersions(string $owner, string $name)
Replicate::deleteModelVersion(string $owner, string $name, string $version)
Replicate::updateModel(string $owner, string $name, array $data)
Replicate::searchModels(string $query)
Replicate::listModelExamples(string $owner, string $name, array $query = [])
Replicate::getModelReadme(string $owner, string $name)
Replicate::deleteModel(string $owner, string $name)
Replicate::listModels(array $query = [])
Replicate::createPrediction(array $data, array $headers = [])
Replicate::getPrediction(string $id)
Replicate::cancelPrediction($id)
Replicate::listPredictions(array $query = [])
Replicate::listTrainings(array $query = [])
Replicate::createTraining(string $owner, string $name, string $version, array $data)
Replicate::getTraining(string $id)
Replicate::cancelTraining($id)
Replicate::defaultSecret()
Replicate::createDeploymentPrediction(string $owner, string $name, array $data, array $headers = [])
Replicate::createModelPrediction(string $owner, string $name, string $version, array $data, array $headers = [])
Replicate::deleteDeployment(string $owner, string $name)
Replicate::search(string $query, ?int $limit = null)
Replicate::createPrediction(
['version' => '...', 'input' => ['prompt' => 'a cat']],
['Prefer' => 'wait=60', 'Cancel-After' => '5m']
);
use HalilCosdu\Replicate\Facades\Replicate;
$response = Replicate::account();