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
Class | Method | HTTP request | Description |
---|---|---|---|
NumenoPersonaApi | agentFeedUpdate | POST /v1/personas/{personaId}/agents/{agentId}/feedUpdate | Let a `feed` Agent know that their feed has been updated |
NumenoPersonaApi | createAgent | POST /v1/personas/{personaId}/agents | Create a new Agent for a Persona |
NumenoPersonaApi | createPersona | POST /v1/personas | Create a new Persona |
NumenoPersonaApi | deleteAgent | DELETE /v1/personas/{personaId}/agents/{id} | Delete an Agent by ID |
NumenoPersonaApi | deletePersona | DELETE /v1/personas/{id} | Delete a Persona by ID |
NumenoPersonaApi | getAgentById | GET /v1/personas/{personaId}/agents/{id} | Get a specific Agent by ID |
NumenoPersonaApi | getAgents | GET /v1/personas/{personaId}/agents | Get a list of all Agents in a Persona |
NumenoPersonaApi | getPersonaById | GET /v1/personas/{id} | Get a specific Persona by ID |
NumenoPersonaApi | getPersonas | GET /v1/personas | Get a list of all Personas |
NumenoPersonaApi | getScopes | GET /v1/scopes | Get the Scopes for this API |
NumenoPersonaApi | healthCheck | GET /health | Check the health of the API |
NumenoPersonaApi | scoreArticles | POST /v1/actions/scoreArticles | Score a list of articles |
NumenoPersonaApi | updateAgent | PUT /v1/personas/{personaId}/agents/{id} | Update an Agent by ID |
NumenoPersonaApi | updatePersona | PUT /v1/personas/{id} | Update a Persona by ID |
Models
- AgentBase
- AgentBaseIn
- AgentBaseOut
- AgentFeedBase
- AgentFeedOptions
- AgentFeedOut
- AgentFull
- AgentFullFeed
- AgentList
- AgentNew
- AgentNewFeed
- AgentOut
- AgentResource
- AgentUpdate
- AgentUpdateFeed
- ArticleInFeed
- ArticleLong
- ArticleShort
- ErrorDetail
- ErrorResponse
- HealthCheck
- PersonaBase
- PersonaList
- PersonaNew
- PersonaOut
- PersonaResource
- PersonaUpdate
- Scopes
- ScoreArticleParams
- ScoredArticle
- ScoredArticleList
- SubscriptionMessageFeed
- SubscriptionMessageFeedItem
- TopicAndWeight
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
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
- Package version:
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen