Download the PHP package fuzzy-ai/sdk without Composer
On this page you can find all versions of the php package fuzzy-ai/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Vendor fuzzy-ai
Package sdk
Short Description Fuzzy.ai PHP Library
License Apache-2.0
Homepage https://fuzzy.ai
Package sdk
Short Description Fuzzy.ai PHP Library
License Apache-2.0
Homepage https://fuzzy.ai
Please rate this library. Is it a good library?
Informations about the package sdk
Fuzzy.ai PHP SDK
PHP library for accessing the fuzzy.ai API.
Requirements
PHP 5.3.3 or later with the cURL extension.
Installation
You can install the library via Composer:
composer require fuzzy-ai/sdk
To load the library, use Composer's autoload:
Usage
All API calls require an API key from https://fuzzy.ai/
Client
This is the main class and serves as an entry point to the API.
- FuzzyAi\Client($key, $root) Constructor that takes the following arguments and returns a new Client object.
key
: Your Fuzzy.ai API keyroot
(optional): The API endpoint (defaults to https://api.fuzzy.ai)
- evaluate($agentId, $inputs) The main method to use, it performs a single inference. Returns an array of outputs and an evaluation ID (for training feedback, see below).
agentId
: The ID of the Agent to perform the evaluation againstinputs
: An associative array of input name => values.
- feedback($evaluationId, $performance) This is the method used for training better results. Returns a feedback object.
evaluationId
: Unique identifier returned from an evaluate() call.performance
: The performance metrics (as an associative array) to provide the learning.
- newAgent($props) Use this method to create a new Agent. Returns an Agent object.
props
: An associative array representing an agent with at leastinputs
,outputs
, andrules
.
- getAgent($agentId) This will fetch an existing agent definition. Returns an Agent object.
agentId
: ID of the agent to retrieve
Agent
This class represents an Agent and provides full CRUD features.
- FuzzyAi\Agent($client) Constructor - takes an HTTP Client object, but it's easier to use either
newAgent
orgetAgent
from above to create the Agent object. - evaluate($inputs) Like Client::evaluate, but on an existing Agent instance. NOTE Returns an Evaluation object.
inputs
: An associative array of input name => values.
- create($props) Creates a new agent (although Client::newAgent is likely easier).
props
: An associative array representing an agent with at leastinputs
,outputs
, andrules
.
- read($props) Reads an agent definition from the API. Probably easier to use Client::getAgent().
id
: Agent ID to read.
- update($props) Updates the current agent instance with $props.
props
: New agent properties.
- delete() Deletes current agent from the API.
Evaluation
This class represents a single evaluation.
- read($id) Load a single evaluation object by ID.
- feedback($values) Provide learning feedback data to a single evaluation . Returns a Feedback object.
values
: the performance metrics to provide for feedback.
Examples
The examples/
directory has some examples of using the library.
Development
Install dependencies:
composer install
Run the tests:
./vendor/bin/phpunit
All versions of sdk with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.3.3
ext-curl Version *
ext-curl Version *
The package fuzzy-ai/sdk contains the following files
Loading the files please wait ....