bq/watson

A simple PHP library for accessing IBM's Watson API services

dev-master 2017-03-22 22:11 UTC

This package is not auto-updated.

Last update: 2024-04-27 18:14:50 UTC


README

A simple PHP library for accessing IBM's Watson API services

Basic Setup:

$service = 'retrieve-and-rank';
$config = new \stdClass();
$config->username = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxx';
$config->password = 'xxxxxxxxxxxxxx';
$config->url = sprintf('https://gateway.watsonplatform.net/%s/api',$service);
$config->version = 'v1';

$transportConfig = ['auth' =>  [$config->username, $config->password]];

$client = new Watson\Client($service,$config,$transportConfig);

$clientInstance = $client->getClientInstance();
$clientInstance->setServiceUrl($config->url);
$clientInstance->setServiceVersion($config->version);

TODO

-- Implement unit tests
-- Improve method returning and exception throwing
-- Get rid of Monolog dependency (error logging should not be handled by library)