bq / watson
A simple PHP library for accessing IBM's Watson API services
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/bq/watson
Requires
- php: >=5.6.0
- guzzlehttp/guzzle: ^6.2
- keboola/csv: ^1.1
- monolog/monolog: ^1.22
This package is not auto-updated.
Last update: 2025-09-28 02:00:06 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)