定制 sharpapi/laravel-custom-workflow 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sharpapi/laravel-custom-workflow

Composer 安装命令:

composer require sharpapi/laravel-custom-workflow

包简介

Laravel wrapper for SharpAPI Custom AI Workflow SDK - build and execute no-code AI API endpoints

README 文档

README

SharpAPI GitHub cover

SharpAPI Laravel Custom Workflow

🎯 Laravel wrapper for SharpAPI Custom AI Workflows — build and execute no-code AI API endpoints.

Latest Version on Packagist Total Downloads

Check the full documentation on the Custom AI Workflows page.

Quick Links

Resource Link
Product Details SharpAPI.com
PHP SDK (non-Laravel) sharpapi/php-custom-workflow
SDK Libraries GitHub - SharpAPI SDKs

Requirements

  • PHP >= 8.1
  • Laravel 10, 11, or 12
  • A SharpAPI account with an API key

Installation

Step 1. Install the package via Composer:

composer require sharpapi/laravel-custom-workflow

Step 2. Visit SharpAPI to get your API key.

Step 3. Add your API key to .env:

SHARP_API_KEY=your-api-key

Step 4 (Optional). Publish the configuration:

php artisan vendor:publish --tag=sharpapi-custom-workflow

What it does

This package provides a Laravel-native wrapper around sharpapi/php-custom-workflow. It adds:

  • Service Provider with deferred loading (singleton only created when first used)
  • Facade for quick static access
  • Dependency Injection support
  • Publishable configuration with auto-discovery

Usage (Facade)

use SharpAPI\LaravelCustomWorkflow\Facades\CustomWorkflow;

// Execute a workflow
$statusUrl = CustomWorkflow::executeWorkflow('my-sentiment-analyzer', [
    'text' => 'Great product!',
    'score' => 4.5,
]);

// Fetch results when ready
$result = CustomWorkflow::fetchResults($statusUrl);

// List your workflows
$workflows = CustomWorkflow::listWorkflows();

// Describe a workflow's schema
$definition = CustomWorkflow::describeWorkflow('my-analyzer');

// Validate + execute in one call
$statusUrl = CustomWorkflow::validateAndExecute('my-analyzer', ['text' => 'hello']);

Usage (Dependency Injection)

use SharpAPI\CustomWorkflow\CustomWorkflowClient;

class AnalyzeController extends Controller
{
    public function analyze(CustomWorkflowClient $client)
    {
        $statusUrl = $client->executeWorkflow('my-sentiment-analyzer', [
            'text' => 'Great product!',
        ]);

        return $client->fetchResults($statusUrl);
    }
}

Configuration

After publishing, the config file is at config/sharpapi-custom-workflow.php:

return [
    'api_key' => env('SHARP_API_KEY', env('SHARPAPI_API_KEY')),
    'base_url' => env('SHARPAPI_BASE_URL', 'https://sharpapi.com/api/v1'),
];

Do you think our API is missing some obvious functionality?

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

License: MIT

The MIT License (MIT). Please see License File for more information.

Social Media

🚀 For the latest news, tutorials, and case studies, don't forget to follow us on:

统计信息

  • 总下载量: 43
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固