Skip to main content

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

ClassMethodHTTP requestDescription
NumenoChatApicancelLastMessagePOST /v1/conversations/{conversationId}/cancelCancel a the last Message in a Conversation
NumenoChatApicreateConversationPOST /v1/conversationsCreate a new Conversation
NumenoChatApicreateMessagePOST /v1/conversations/{conversationId}/messagesCreate a new Message for a Conversation
NumenoChatApideleteConversationDELETE /v1/conversations/{id}Delete a Conversation by ID
NumenoChatApigetConversationByIdGET /v1/conversations/{id}Get a specific Conversation by ID
NumenoChatApigetConversationsGET /v1/conversationsGet a list of all Conversations
NumenoChatApigetMessageByIdGET /v1/conversations/{conversationId}/messages/{id}Get a specific Message by ID
NumenoChatApigetMessagesGET /v1/conversations/{conversationId}/messagesGet a list of all Messages in a Conversation
NumenoChatApigetScopesGET /v1/scopesGet the Scopes for this API
NumenoChatApihealthCheckGET /healthCheck the health of the API
NumenoChatApiupdateConversationPUT /v1/conversations/{id}Update a Conversation 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.1
    • Generator version: 7.10.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen