Giter VIP home page Giter VIP logo

sarufi-php's Introduction

Sarufi for PHP

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.

sarufi-php's People

Contributors

aidannyshayo avatar alphaolomi avatar dependabot[bot] avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sarufi-io

sarufi-php's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.