编程

[Laravel 扩展包]Replicate Laravel PHP 客户端

210 2024-05-27 15:42:00

Replicate Laravel 包是 Replicate API 的 PHP 客户端,Replicate API 是用于运行和微调开源 AI 模型的 API。以下是使用 Replicate Laravel 客户端的一个示例:

use HalilCosdu\Replicate\Facades\Replicate;
 
$response = Replicate::createModel($data)
 
 
// Response methods
$response->body(); // string
$response->json($key = null, $default = null); // mixed
$response->object(); // object
$response->collect($key = null); // Illuminate\Support\Collection
$response->status(); // int
$response->successful(); // bool
$response->redirect(); // bool
$response->failed(); // bool
$response->clientError(); // bool
$response->header($header); // string
$response->headers(); // array

在本文发布时,Replicate Laravel客户端具有以下节点:

  • Account
  • Models
  • Predictions
  • Trainings
  • Model collection
  • Deployments
  • Model hardware
  • 等等...

有关使用示例,请参阅完整的 Replicate API 文档。Replicate API 允许你使用数千个社区模型生成图像、文本、视频、音乐、语音等。要开始在应用中使用 Replicate Laravel,请在 GitHub 上查看此包,网址为 halilcosdu/laravel-replicate