Skip to content

Hailuo PHP SDK is a robust and community-driven PHP SDK for seamless integration with the MiniMax AI API.

License

Notifications You must be signed in to change notification settings

MiniMax-AI-PHP/hailuo-php-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hailuo PHP SDK

NOTE: this package still under Development (NOT Ready to USe) .

Table of Contents


Overview

Hailuo PHP SDK is a robust and community-driven PHP client library for seamless integration with the MiniMax Hailuo AI API.

Key Features

  • Easy Integration: Simplifies interaction with the Hailuo API using a PHP client.
  • Method Chaining: Supports fluent method chaining for building requests.
  • Customizable: Allows setting different models, query roles, and streaming options.
  • PSR-18 Compliance: Utilizes PSR-18 HTTP client for making API requests.

Installation

You can install the package via Composer:

composer require minimax-ai-php/hailuo-php-sdk

Ensure your project meets the following requirements:

  • PHP 8.1 or later

Quick Start Guide

Basic Usage

use MiniMaxAIPHP\HailuoPhpSdk\HailuoClient;

$apiKey = 'your-api-key';

$response = HailuoClient::build($apiKey)
    ->query('Hello Hailuo, how are you today?')
    ->run();

echo 'API Response:'.$response;

Note: in easy mode it will take defaults for all configs Check Default Values

Advanced Usage

use MiniMaxAIPHP\HailuoPhpSdk\HailuoClient;
use MiniMaxAIPHP\HailuoPhpSdk\Enums\Queries\QueryRoles;
use MiniMaxAIPHP\HailuoPhpSdk\Enums\Models;

$apiKey = 'your-api-key';

$response = HailuoClient::build($apiKey, 'https://api.minimaxi.chat/v1', 500)
    ->query('System setup query', 'system')
    ->query('User input message', 'user')
    ->withModel(Models::CHAT->value)
    ->setTemperature(0.9)
    ->setMaxTokens(2000)
    ->setTopUp(1)
    ->run();

echo 'API Response:'.$response;

Testing

tests will come soon .

Changelog

See CHANGELOG for recent changes.

Contributors ✨

Thanks to these wonderful people for contributing to this project! 💖

Omar AlAlwi
Omar AlAlwi

🏆 Creator

Want to contribute? Check out the contributing guidelines and submit a pull request! 🚀

Security

If you discover any security-related issues, please email creator : [email protected].

License

The MIT License (MIT). See LICENSE for more information.