Git Product home page Git Product logo

ccatphp-sdk's Introduction

ccatphp-sdk


CCat PHP SDK (Cheshire cat PHP SDK) is a library to help the implementation of Cheshire Cat on a PHP Project

Installation

To install CCatPHP-SDK you can run this command:

composer require albocode/ccatphp-sdk

Usage

Initialization and usage:

use Albocode\CcatphpSdk\CCatClient;
use Albocode\CcatphpSdk\Clients\HttpClient;
use Albocode\CcatphpSdk\Clients\WSClient;


$cCatClient = new CCatClient(
new WSClient('cheshire_cat_core', 1865, null),
new HttpClient('cheshire_cat_core', 1865, null)
);

Send a message to the websocket:

$notificationClosure = function (string $message) {
 // handle websocket notification, like chat token stream
}

// result is the result of the message
$result = $cCatClient->sendMessage(
new Message("Hello world!", 'user', []),  // message body
$notificationClosure // websocket notification closure handle
);

Load data to the rabbit hole:

//file
$promise = $this->client->rabbitHole($uploadedFile->getPathname(), null, null);
$promise->wait();

//url
$promise = $this->client->rabbitHoleWeb($url, null,null);
$promise->wait();

Memory management utilities:

$this->client->getMemoryCollection(); // get number of vectors in the working memory
$this->client->getMemoryRecall("HELLO"); // recall memories by text

//delete memory points by metadata, like this example delete by source
$this->client->deleteDeclarativeMemoryByMetadata(["source" => $url]);

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.