Download the PHP package arikislam/replicate-php-client without Composer

On this page you can find all versions of the php package arikislam/replicate-php-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package replicate-php-client

Replicate PHP Client

Latest Stable Version License

A simple PHP client for interacting with the Replicate API, enabling the ability to run machine learning models from your PHP applications. This library provides a clean and reusable way to interact with the API in a Laravel environment but can also be used in other PHP applications.

Features

Installation

To install the package, simply use Composer:

Laravel Configuration

For Laravel applications, the package will automatically register the ReplicatePhpClientServiceProvider and the Replicate alias.

You can publish the config file with:

Usage

Configuration

To use this package, you must have an API key from Replicate.

Set up the API key in your environment file:

Example Request

To create an inference using the Replicate API, use the Replicate facade in your application as shown below:

This example demonstrates how to send a request to the Replicate API with the required parameters.

Detailed Breakdown

1. Input

The input parameter specifies the model input options. In this case:

2. Webhooks

Although webhooks can be used to track the progress of asynchronous tasks, this package allows you to specify a webhook URL and webhook_events_filter to listen for certain events. Currently, the webhook parameter is set to null in the example for simplicity.

3. API Version

The version is an identifier for the version of the Replicate API being used. You can specify which model version you are targeting by using the correct version hash.

Response Handling

The response from the API will contain details of the prediction, including the generated content or the status of the request. You can handle the response as follows:

Testing

This package includes support for unit testing. You can run tests using PHPUnit:

Advanced Usage

Custom HTTP Client

You can provide your own custom HTTP client if needed by extending the Guzzle client. For example:

Facades in Laravel

For Laravel users, the Replicate facade provides a convenient way to interact with the API. However, if you are not using Laravel, you can directly instantiate the Replicate class and make API requests.

Contributing

Contributions are welcome! Please submit a pull request or open an issue to contribute to the development of this package.

License

This package is licensed under the MIT License. See the LICENSE file for more information.

Author

This package is maintained by S M Ariq Islam.


All versions of replicate-php-client with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package arikislam/replicate-php-client contains the following files

Loading the files please wait ....