Skip to content

Releases: alphaolomi/sarufi-php

v0.1.0

07 Jul 15:36
Compare
Choose a tag to compare

Sarufi for PHP v0.1.0

Latest Version on Packagist Tests Total Downloads

Installation

You can install the package via Composer:

composer require alphaolomi/sarufi-php

Usage

use Alphaolomi\Sarufi\Sarufi;

$sarufi = new Sarufi('your_token');

// Create an Empty bot
$bot1 = $sarufi->createBot([
    "name" => "YOUR AWESOME BOT NAME",
    "description" => "PUT DESCRIPTION HERE",
    "industry" => "YOUR BOT INDUSTRY",
    "intents" => [],
    "flows" => [],
]);
print_r($bot1);

// OR
// From files with intent and metadata
$bot2 = $sarufi->createFromFile(
    intents: __DIR__ . 'data/intents.yaml',
    flow:  __DIR__ . 'data/flow.yaml',
    metadata:  __DIR__ . 'data/metadata.yaml'
);


print_r($bot2);

API available

  • Sarufi(string $token)
  • public function createBot(string $name, null|string $description = null, string $industry = "general", $flows = [], $intents = [], bool $visibleOnCommunity = false)
  • public function createFromFile($metadata = null, $intents = null, $flows = null)
  • public function updateBot($id, $name, $industry, $description, $intents, $flows, $visibleOnCommunity)
  • public function updateFromFile( $id, $intents, $flows, $metadata)
  • public function getBot($id)
  • public function chat(int $botId, string $chatId, string $message = "Hello", string $messageType = "text", string $channel = "general")
  • public function deleteBot($id)

Testing

Uses PestPHP.

composer test

Changelog

Please see CHANGELOG for more information on recent changes.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on reporting security vulnerabilities.

Credits

License

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

What's Changed

New Contributors

Full Changelog: v0.0.1...v0.1.0

v0.0.1

28 Oct 22:31
Compare
Choose a tag to compare

Sarufi for PHP v0.0.1

Latest Version on Packagist Tests Total Downloads

Installation

You can install the package via composer:

composer require alphaolomi/sarufi-php

Usage

use Alphaolomi\Sarufi\Sarufi;

$sarufi = new Sarufi('your_email', 'your_password');

// Create Empty bot
$bot1 = $sarufi->createBot([
    "name" => "YOUR AWESOME BOT NAME",
    "description" => "PUT DESCRIPTION HERE",
    "industry" => "YOUR BOT INDUSTRY",
    "intents" => [],
    "flows" => [],
]);
print_r($bot1);

// OR
// From files with intent and metadata
$bot2 = $sarufi->createFromFile(
    intents: __DIR__ . 'data/intents.yaml',
    flow:  __DIR__ . 'data/flow.yaml',
    metadata:  __DIR__ . 'data/metadata.yaml'
);


print_r($bot2);

API available

  • Sarufi(string $username, string $password, null|string $token = null)
  • public function createBot(string $name, null|string $description = null, string $industry = "general", $flow = [], $intents = [], bool $visibleOnCommunity = false)
  • public function createFromFile($metadata = null, $intents = null, $flow = null)
  • public function updateBot($id, $name, $industry, $description, $intents, $flow, $visibleOnCommunity)
  • public function updateFromFile( $id, $intents, $flow, $metadata)
  • public function getBot($id)
  • public function chat(int $botId, string $chatId, string $message = "Hello", string $messageType = "text", string $channel = "general")
  • public function deleteBot($id)

next: Usage in Laravel, Stay tuned for updates.