Skip to main content

NumenoAPI-php

Introduction

Use the Numeno Persona API to create and manage Personas and Agents.

An Agent is responsible of controling one aspect of Numeno according to preferences you express in natural language.

For now we only support the feed Agent which can subscribe to updates on a given feed, rescore the articles it observes on it, and publish them to another feed.

A Persona is a collection of Agents that work together according to the preferences of a person, or a group of people, or any other type of entity. At the moment you cannot interact with the Persona directly but eventually you will be able to send feedback to the Persona or discuss your overarching goals with it.

For more information, please visit https://numeno.ai/.

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Composer

To install the bindings via Composer, add the following to composer.json:

{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
}
],
"require": {
"GIT_USER_ID/GIT_REPO_ID": "*@dev"
}
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/NumenoAPI-php/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure API key authorization: ApiKeyAuth
$config = NumenoPersona\Configuration::getDefaultConfiguration()->setApiKey('X-Numeno-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = NumenoPersona\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Numeno-Key', 'Bearer');


$apiInstance = new NumenoPersona\Api\NumenoPersonaApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$persona_id = 'persona_id_example'; // string | The unique identifier of the Persona.
$agent_id = 'agent_id_example'; // string | The unique identifier of the Agent.
$subscription_message_feed = new \NumenoPersona\Model\SubscriptionMessageFeed(); // \NumenoPersona\Model\SubscriptionMessageFeed

try {
$apiInstance->agentFeedUpdate($persona_id, $agent_id, $subscription_message_feed);
} catch (Exception $e) {
echo 'Exception when calling NumenoPersonaApi->agentFeedUpdate: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://api.numeno.ai/persona

ClassMethodHTTP requestDescription
NumenoPersonaApiagentFeedUpdatePOST /v1/personas/{personaId}/agents/{agentId}/feedUpdateLet a `feed` Agent know that their feed has been updated
NumenoPersonaApicreateAgentPOST /v1/personas/{personaId}/agentsCreate a new Agent for a Persona
NumenoPersonaApicreatePersonaPOST /v1/personasCreate a new Persona
NumenoPersonaApideleteAgentDELETE /v1/personas/{personaId}/agents/{id}Delete an Agent by ID
NumenoPersonaApideletePersonaDELETE /v1/personas/{id}Delete a Persona by ID
NumenoPersonaApigetAgentByIdGET /v1/personas/{personaId}/agents/{id}Get a specific Agent by ID
NumenoPersonaApigetAgentsGET /v1/personas/{personaId}/agentsGet a list of all Agents in a Persona
NumenoPersonaApigetPersonaByIdGET /v1/personas/{id}Get a specific Persona by ID
NumenoPersonaApigetPersonasGET /v1/personasGet a list of all Personas
NumenoPersonaApigetScopesGET /v1/scopesGet the Scopes for this API
NumenoPersonaApihealthCheckGET /healthCheck the health of the API
NumenoPersonaApiscoreArticlesPOST /v1/actions/scoreArticlesScore a list of articles
NumenoPersonaApiupdateAgentPUT /v1/personas/{personaId}/agents/{id}Update an Agent by ID
NumenoPersonaApiupdatePersonaPUT /v1/personas/{id}Update a Persona by ID

Models

Authorization

Authentication schemes defined for the API:

ApiKeyAuth

  • Type: API key
  • API key parameter name: X-Numeno-Key
  • Location: HTTP header

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

support@numeno.ai

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
    • Package version: 0.0.5
    • Generator version: 7.10.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen