NumenoAPI-php
Introduction
Use the Numeno Chat API to record your chat conversations with an agent. The agent can be configured to follow a number of Numeno internal playbooks, or it can be configured as a neutral
agent and configured using custom system messages.
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 = NumenoChat\Configuration::getDefaultConfiguration()->setApiKey('X-Numeno-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = NumenoChat\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Numeno-Key', 'Bearer');
$apiInstance = new NumenoChat\Api\NumenoChatApi(
// 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
);
$conversation_id = 'conversation_id_example'; // string | The unique identifier of the Conversation.
try {
$apiInstance->cancelLastMessage($conversation_id);
} catch (Exception $e) {
echo 'Exception when calling NumenoChatApi->cancelLastMessage: ', $e->getMessage(), PHP_EOL;
}
API Endpoints
All URIs are relative to https://api.numeno.ai/chat
Class | Method | HTTP request | Description |
---|---|---|---|
NumenoChatApi | cancelLastMessage | POST /v1/conversations/{conversationId}/cancel | Cancel a the last Message in a Conversation |
NumenoChatApi | createConversation | POST /v1/conversations | Create a new Conversation |
NumenoChatApi | createMessage | POST /v1/conversations/{conversationId}/messages | Create a new Message for a Conversation |
NumenoChatApi | deleteConversation | DELETE /v1/conversations/{id} | Delete a Conversation by ID |
NumenoChatApi | getConversationById | GET /v1/conversations/{id} | Get a specific Conversation by ID |
NumenoChatApi | getConversations | GET /v1/conversations | Get a list of all Conversations |
NumenoChatApi | getMessageById | GET /v1/conversations/{conversationId}/messages/{id} | Get a specific Message by ID |
NumenoChatApi | getMessages | GET /v1/conversations/{conversationId}/messages | Get a list of all Messages in a Conversation |
NumenoChatApi | getScopes | GET /v1/scopes | Get the Scopes for this API |
NumenoChatApi | healthCheck | GET /health | Check the health of the API |
NumenoChatApi | updateConversation | PUT /v1/conversations/{id} | Update a Conversation by ID |
Models
- ConversationBase
- ConversationBaseIn
- ConversationBaseOut
- ConversationList
- ConversationNew
- ConversationOut
- ConversationResource
- ConversationStatus
- ConversationUpdate
- ErrorDetail
- ErrorResponse
- HealthCheck
- MessageBase
- MessageList
- MessageNew
- MessageNewOut
- MessageOut
- MessageResource
- MessageState
- MessageStateContext
- Scopes
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.1
- Generator version:
7.10.0
- Package version:
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen